Re: InnoDB interaction between secondary and primary keys.

2013-02-01 Thread Jeremy Chase
; > -Original Message- > > From: Rick James > > Sent: Wednesday, January 30, 2013 1:08 PM > > To: 'Jeremy Chase'; mysql@lists.mysql.com > > Subject: RE: InnoDB interaction between secondary and primary keys. > > > > secondarykey and r

RE: InnoDB interaction between secondary and primary keys.

2013-01-30 Thread Rick James
ql@lists.mysql.com > Subject: RE: InnoDB interaction between secondary and primary keys. > > secondarykey and redundantkey are redundant with each other -- in all > versions of InnoDB. > > One "expert" said that redundant key would have two copies of `1`,`2`. > I think h

RE: InnoDB interaction between secondary and primary keys.

2013-01-30 Thread Rick James
.com > Subject: InnoDB interaction between secondary and primary keys. > > Hello, > > I've been working with a secondary index and would like some > clarification about how the primary columns are included. So, in the > following example, is the secondaryKey effective

Re: Two Primary Keys

2010-06-29 Thread Kyong Kim
This isn't true for innodb. I think the only requirement is that you need to have a unique index on the auto increment column. We created a composite primary key + auto_increment to take advantage of clustering by primary key while satisfying unique constraint for the primary key. It worked out wel

RE: Two Primary Keys

2010-06-29 Thread Steven Staples
y projects I am working on, where I've done this, but done it in code, rather than in mysql. Steven Staples > -Original Message- > From: Dušan Pavlica [mailto:pavl...@unidataz.cz] > Sent: June 29, 2010 11:26 AM > To: Victor Subervi > Cc: mysql@lists.mysql.com >

Re: Two Primary Keys

2010-06-29 Thread petya
You were talking about multiple fields in the primary key, not multiple primary keys. On 06/29/2010 03:51 PM, Johan De Meersman wrote: Correct, but you still can't have more than one primary key. Kind of defeats the idea of it being primary, really. On Tue, Jun 29, 2010 at 3:36 PM,

Re: Two Primary Keys

2010-06-29 Thread Dušan Pavlica
to_increment primary key, you cant have any other field in its primary key. Makes sense. Actually, I was just copying what someone else gave me and adding the auto_increment, then I got to wondering, what is the purpose of having two primary keys? TIA, V -- MySQL General Mailing List F

Re: Two Primary Keys

2010-06-29 Thread Victor Subervi
2010/6/29 João Cândido de Souza Neto > I think the best, or may be the right way is to use picture_id as primary > key and a unique index to product_sku. > Yes, sounds good. So the purpose, then, is to speed lookups on fields commonly accessed. I'd forgotten that. Thanks, V

Re: Two Primary Keys

2010-06-29 Thread Jo�o C�ndido de Souza Neto
I think the best, or may be the right way is to use picture_id as primary key and a unique index to product_sku. -- João Cândido de Souza Neto "Victor Subervi" escreveu na mensagem news:aanlktikzksmbx5hue0x_q3hx_68gicndghpkjdrna...@mail.gmail.com... > Hi; > I have the following: > > create

Re: Two Primary Keys

2010-06-29 Thread Shawn Green (MySQL)
ed to auto_increment and declare primary key on two fields. How do? TIA, Victor Use the other syntax for defining keys: create table pics ( picture_id int auto_increment, product_sku int not null, picture_num int not null, picture_desc varchar(100), picture_data longblob, PRIMAR

Re: Two Primary Keys

2010-06-29 Thread petya
If you use innodb, primary key lookups are far faster than secondary indexes. Peter On 06/29/2010 03:34 PM, João Cândido de Souza Neto wrote: I think the real question is: What´s the purpose of any other field in my primary key if the first one is an auto_increment and will never repeat?

Re: Two Primary Keys

2010-06-29 Thread Jo�o C�ndido de Souza Neto
t is the purpose of having two primary keys? TIA, V -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: Two Primary Keys

2010-06-29 Thread Victor Subervi
at is the purpose of having two primary keys? TIA, V

Re: Two Primary Keys

2010-06-29 Thread Jo�o C�ndido de Souza Neto
As far as I know, if you have an auto_increment primary key, you cant have any other field in its primary key. João Cândido. "Victor Subervi" escreveu na mensagem news:aanlktikzksmbx5hue0x_q3hx_68gicndghpkjdrna...@mail.gmail.com... > Hi; > I have the following: > > create table pics ( > p

Two Primary Keys

2010-06-29 Thread Victor Subervi
Hi; I have the following: create table pics ( picture_id int auto_increment primary key, product_sku int not null primary key, picture_num int not null, picture_desc varchar(100), picture_data longblob ); which doesn't work I need to auto_increment and declare primary key on two fi

RE: different type column and keys for EXPLAIN

2009-12-15 Thread Manish Ranjan
new index would work. -Original Message- From: Sergey Petrunya [mailto:pser...@askmonty.org] Sent: Monday, December 14, 2009 5:58 PM To: Manish Ranjan Cc: mysql@lists.mysql.com Subject: Re: different type column and keys for EXPLAIN Manish, On Mon, Dec 14, 2009 at 05:33:43PM +0530, Man

Re: different type column and keys for EXPLAIN

2009-12-14 Thread Sergey Petrunya
checking for lastname 'clark'. > Rest everything is same with these two queries. However, the explain output > shows "ref" for the first query and uses only one key for the first query > whereas second query uses "index_merge" and both keys. > > ... >

Re: different type column and keys for EXPLAIN

2009-12-14 Thread Johan De Meersman
Behalf Of Johan De > Meersman > Sent: Monday, December 14, 2009 8:33 PM > To: Manish Ranjan > Cc: mysql@lists.mysql.com > Subject: Re: different type column and keys for EXPLAIN > > > > I don't think there's an actual problem as such, the optimiser is just > maki

RE: different type column and keys for EXPLAIN

2009-12-14 Thread Manish Ranjan
Cc: mysql@lists.mysql.com Subject: Re: different type column and keys for EXPLAIN Heh. Try running "analyze table", so the index stats are correct. If that doesn't help, you may have stumbled upon an optimizer glitch, or maybe there's something happening that I'm not se

RE: different type column and keys for EXPLAIN

2009-12-14 Thread Manish Ranjan
9 8:33 PM To: Manish Ranjan Cc: mysql@lists.mysql.com Subject: Re: different type column and keys for EXPLAIN I don't think there's an actual problem as such, the optimiser is just making a decision to merge the lastname and firstname indices for the second query. At a guess, I'd say

Re: different type column and keys for EXPLAIN

2009-12-14 Thread Johan De Meersman
uot; for the first query and uses only one key for the first query > whereas second query uses "index_merge" and both keys. > > > > mysql> explain select count(*) from tblList where fldFIRSTNAME='michael' > and > fldLASTNAME='clarke'; > > &g

different type column and keys for EXPLAIN

2009-12-14 Thread Manish Ranjan
in output shows "ref" for the first query and uses only one key for the first query whereas second query uses "index_merge" and both keys. mysql> explain select count(*) from tblList where fld

Join between columns with unique keys randomly uses the keys, or uses a temporary table (which fails).

2009-12-11 Thread Matthew Blissett
d then doing the EXPLAIN again sometimes changes the plan. I assume this is because the cardinalities are recalculated. I expect the CatalogNumber unique keys to always be used for this query. Even if I do: SELECT [...] FROM newdarwincoredata n FORCE INDEX (CatalogNumber) INNER JOIN darwincore

Re: Foreign Keys Problem

2009-11-20 Thread Victor Subervi
On Thu, Nov 19, 2009 at 9:34 PM, Ye Yuan wrote: > Hi Victor, > > It looks to me the foreign key syntax is wrong. Can you create the > Relationship table on your database by using below ddl? > > create table if not exists Relationship > (ID integer auto_increment primary key, > Parent integer not

Foreign Keys Problem

2009-11-19 Thread Victor Subervi
Hi; I don't claim to be an expert in MySQL. The following code was largely supplied to me by someone who was. I don't really understand foreign keys. He wrote this off the top of his head, and it's throwing an error. Here's the python code: def catTree(): user, pass

Re: foreign keys: Cannot create InnoDB table

2009-08-20 Thread wabiko.takuma
ATUS \G > > And look for the "LATEST FOREIGN KEY ERROR" section. It'll explain the > reason for the (errno: 150) message. > > Regards, > Gavin Towey > > -Original Message- > From: wabiko.takuma [mailto:wab...@sysrdc.ns-sol.co.jp] > Sent: Fr

RE: foreign keys: Cannot create InnoDB table

2009-08-14 Thread Gavin Towey
35 AM To: mysql@lists.mysql.com Subject: foreign keys: Cannot create InnoDB table Hi, All, I can't create InnoDB table with foreign key constraints using more than 3 colmuns. When I create table `test_fk`.`tbl1`, it gives me: Can't create table 'test_fk.tbl1' (errno: 1

Re: foreign keys: Cannot create InnoDB table

2009-08-14 Thread Martijn Tonies
Hi, I can't create InnoDB table with foreign key constraints using more than 3 colmuns. When I create table `test_fk`.`tbl1`, it gives me: Can't create table 'test_fk.tbl1' (errno: 150) why? CREATE TABLE syntax looks perfectly right to me. Any suggestions are welcome. Thank you, wabi --

foreign keys: Cannot create InnoDB table

2009-08-14 Thread wabiko.takuma
Hi, All, I can't create InnoDB table with foreign key constraints using more than 3 colmuns. When I create table `test_fk`.`tbl1`, it gives me: Can't create table 'test_fk.tbl1' (errno: 150) why? CREATE TABLE syntax looks perfectly right to me. Any suggestions are welcome. Thank you, wabi

Re: Foreign Keys

2008-10-08 Thread Perrin Harkins
On Wed, Oct 8, 2008 at 11:56 AM, Jim Lyons <[EMAIL PROTECTED]> wrote: > Indexes speed up joins. Foreign keys should be indexes themselves, so they > can also speed up joins. If the FK is not an index, it won't help. So, > index your FKs If you add a FOREIGN KEY constraint

Re: Foreign Keys

2008-10-08 Thread Peter Brawley
h!/ Ben A. Hilleli *Programmer / Analyst* *From:* Arthur Fuller [mailto:[EMAIL PROTECTED] *Sent:* October 8, 2008 2:55 PM *To:* Ben A.H. *Cc:* mysql@lists.mysql.com *Subject:* Re: Foreign Keys So you are talking about parent-child relationships in a single table, or in the

RE: Foreign Keys

2008-10-08 Thread Ben A. Hilleli
mentioned, thank-you so much! Ben A. Hilleli Programmer / Analyst _ From: Arthur Fuller [mailto:[EMAIL PROTECTED] Sent: October 8, 2008 2:55 PM To: Ben A.H. Cc: mysql@lists.mysql.com Subject: Re: Foreign Keys So you are talking about parent-child relationships in a single ta

Re: Foreign Keys

2008-10-08 Thread Arthur Fuller
; > USER: > > emailID > > userName > > |1 > > |many > > FRIEND: > > emailID > > |many > > |1 > > USER: > > emailID > > username > > > > (i.e. it's two records in the same USER table)

Re: Foreign Keys

2008-10-08 Thread Ben A.H.
(i.e. it's two records in the same USER table) How are relationships between records in the same table usually dealt with in terms of design? Implementation? ThanX, Ben ""Jim Lyons"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Indexes

Re: Foreign Keys

2008-10-08 Thread Jim Lyons
Indexes speed up joins. Foreign keys should be indexes themselves, so they can also speed up joins. If the FK is not an index, it won't help. So, index your FKs On Wed, Oct 8, 2008 at 10:43 AM, Ben A.H. <[EMAIL PROTECTED]> wrote: > Does using foreign keys simply enforce referen

Foreign Keys

2008-10-08 Thread Ben A.H.
Does using foreign keys simply enforce referential integrity OR can it also speed up JOIN queries? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Fwd: Why dont my query use the index keys?

2008-09-19 Thread chandru
Hi joerg, that was a excellent explanation. Regards, Pradeep Chandru. Joerg Bruehe wrote: Hi ! Parikh, Dilip Kumar schrieb: Hi , So you are trying to say that 1) when the Table has Low Cardinality, Mysql wont use Index? Is this the logic behind your words? Extreme example: If

Re: Fwd: Why dont my query use the index keys?

2008-09-18 Thread Joerg Bruehe
Hi ! Parikh, Dilip Kumar schrieb: > > Hi , > > So you are trying to say that 1) when the Table has Low Cardinality, Mysql > wont use Index? Is this the logic behind your words? Extreme example: If you are manually looking up one entry from a list of five (say, in a cookbook), would you go th

Re: Fwd: Why dont my query use the index keys?

2008-09-18 Thread chandru
, 2008 11:36 AM To: Johan Thorvaldsson Cc: mysql@lists.mysql.com <mailto:mysql@lists.mysql.com> Subject: Re: Fwd: Why dont my query use the index keys? Hi Johan, the query is going for a temporary table creation "Using temporary; Using filesort" In case your s

RE: Fwd: Why dont my query use the index keys?

2008-09-18 Thread Parikh, Dilip Kumar
t: Re: Fwd: Why dont my query use the index keys? Hi Dilip, MySQL algorithm decides based on cardinality. Cardinality means the value of unique entries in the table. Hence when MySQL finds that there are very less unique values, mysql does not use that index. If the table is optimized then value

Re: Fwd: Why dont my query use the index keys?

2008-09-18 Thread Nagaraj S
lso looks like ok seems let me check, Please try >>> to send the output of global status. >>> >>>Show global status; >>> >>> >>> >>>Thanks & Regards, >>>Dilipkumar >>> >>>-Original Me

Re: Fwd: Why dont my query use the index keys?

2008-09-18 Thread chandru
PROTECTED] *Sent:* Thursday, September 18, 2008 12:23 PM *To:* Parikh, Dilip Kumar *Cc:* Johan Thorvaldsson; mysql@lists.mysql.com *Subject:* Re: Fwd: Why dont my query use the index keys? Hi Dilip, I dont think forcing MySQL to use Index can improve your performance. MySQL

Re: Fwd: Why dont my query use the index keys?

2008-09-18 Thread chandru
gards, Dilipkumar -Original Message- From: chandru [mailto:[EMAIL PROTECTED] Sent: Thursday, September 18, 2008 11:36 AM To: Johan Thorvaldsson Cc: mysql@lists.mysql.com <mailto:mysql@lists.mysql.com> Subject: Re: Fwd: Why dont my query use the index keys? H

Re: Fwd: Why dont my query use the index keys?

2008-09-18 Thread Nagaraj S
, Please try to send > the output of global status. > > Show global status; > > > > Thanks & Regards, > Dilipkumar > > -Original Message- > From: chandru [mailto:[EMAIL PROTECTED] <[EMAIL PROTECTED]>] > Sent: Thursday, September 18, 2008 11:3

Re: Fwd: Why dont my query use the index keys?

2008-09-18 Thread Nagaraj S
, Please try to send > the output of global status. > > Show global status; > > > > Thanks & Regards, > Dilipkumar > > -Original Message- > From: chandru [mailto:[EMAIL PROTECTED] <[EMAIL PROTECTED]>] > Sent: Thursday, September 18, 2008 11:3

RE: Fwd: Why dont my query use the index keys?

2008-09-18 Thread Parikh, Dilip Kumar
m: chandru [mailto:[EMAIL PROTECTED] Sent: Thursday, September 18, 2008 12:23 PM To: Parikh, Dilip Kumar Cc: Johan Thorvaldsson; mysql@lists.mysql.com Subject: Re: Fwd: Why dont my query use the index keys? Hi Dilip, I dont think for

Re: Fwd: Why dont my query use the index keys?

2008-09-17 Thread chandru
global status; Thanks & Regards, Dilipkumar -Original Message- From: chandru [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 18, 2008 11:36 AM To: Johan Thorvaldsson Cc: mysql@lists.mysql.com Subject: Re: Fwd: Why dont my query use the index keys? Hi Johan, the query is going

RE: Fwd: Why dont my query use the index keys?

2008-09-17 Thread Parikh, Dilip Kumar
aldsson Cc: mysql@lists.mysql.com Subject: RE: Fwd: Why dont my query use the index keys? Hi johan, U can use and try to write a query to use index in it (like use index(index name) before where condition. And other variables also looks like ok seems let me check, Please try to send the output of

RE: Fwd: Why dont my query use the index keys?

2008-09-17 Thread Parikh, Dilip Kumar
inal Message- From: chandru [mailto:[EMAIL PROTECTED] Sent: Thursday, September 18, 2008 11:36 AM To: Johan Thorvaldsson Cc: mysql@lists.mysql.com Subject: Re: Fwd: Why dont my query use the index keys? Hi Johan, the query is going for a temporary table creation "Using temporary; Using

Re: Why dont my query use the index keys?

2008-09-17 Thread chandru
Hi johan, you have allocated 4M for your sort buffer size is ok. So i feel that the query is loading more than 4MB of data so it is creating a temporary file to do a sorting. please try to put some logic into the query that you use to load the appropriate data. I find that the tag_id has a car

Re: Why dont my query use the index keys?

2008-09-17 Thread Johan Thorvaldsson
mysql> show global variables like 'sort%'; +--+-+ | Variable_name| Value | +--+-+ | sort_buffer_size | 4194296 | +--+-+ 1 row in set (0.01 sec) 18 sep 2008 kl. 08.05 skrev chandru: Hi Johan, the query is going for a t

Re: Fwd: Why dont my query use the index keys?

2008-09-17 Thread chandru
D]> Datum: ti 16 sep 2008 13.19.43 GMT+02:00 Till: "Johan Thorvaldsson" <[EMAIL PROTECTED]> Kopia: mysql@lists.mysql.com Ämne: Re: Why dont my query use the index keys? Hi Johan, Its doing a range based search, so its using index. regards anandkl On 9/16/08, Johan Thorvaldss

Re: Foreign Keys

2008-08-25 Thread Tom Nugent
OTECTED]> wrote: > >> Hi Steffan, all ! >> >> >> Steffan A. Cline wrote: >> >>> [[...]] >>> >>> I am hoping that by using FK based relationships I can just do one >>> massive >>> insert into the parent table and include all related col

Re: Foreign Keys

2008-08-25 Thread Tom Nugent
gt; I am hoping that by using FK based relationships I can just do one massive >> insert into the parent table and include all related columns and somehow >> magically all field and relational keys fall into place. >> > > AFAIK, this isn't possible. > > Foreign

Re: Foreign Keys

2008-08-25 Thread Joerg Bruehe
Hi Steffan, all ! Steffan A. Cline wrote: [[...]] I am hoping that by using FK based relationships I can just do one massive insert into the parent table and include all related columns and somehow magically all field and relational keys fall into place. AFAIK, this isn't pos

Foreign Keys

2008-08-23 Thread Steffan A. Cline
I am hoping for a little clarification/education here. My understanding of how foreign keys work is very minimal. In using MySQL for the last several years as a backend to web apps I have always managed relationships amongst the tables with auto increment primary keys myself. I have a new

Re: enable and disable keys

2008-06-16 Thread Krishna Chandra Prajapati
> >> try csplit to break the files into small chunks >> >> On Fri, Jun 13, 2008 at 12:21 PM, Ananda Kumar <[EMAIL PROTECTED]> wrote: >> >>> How do i split file during ENABLE KEYS >>> >>> >>> On 6/13/08, Krishna Chandra Prajapati

Re: enable and disable keys

2008-06-16 Thread Ananda Kumar
t;> How do i split file during ENABLE KEYS >> >> >> On 6/13/08, Krishna Chandra Prajapati <[EMAIL PROTECTED]> wrote: >>> >>> increase bulk_insert_buffer_size and if possible split the bigger file >>> into small chunks. It will help you. >>

Re: enable and disable keys

2008-06-15 Thread Krishna Chandra Prajapati
try csplit to break the files into small chunks On Fri, Jun 13, 2008 at 12:21 PM, Ananda Kumar <[EMAIL PROTECTED]> wrote: > How do i split file during ENABLE KEYS > > > On 6/13/08, Krishna Chandra Prajapati <[EMAIL PROTECTED]> wrote: >> >> increase bulk_inse

Re: enable and disable keys

2008-06-12 Thread Ananda Kumar
How do i split file during ENABLE KEYS On 6/13/08, Krishna Chandra Prajapati <[EMAIL PROTECTED]> wrote: > > increase bulk_insert_buffer_size and if possible split the bigger file into > small chunks. It will help you. > > On Thu, Jun 12, 2008 at 1:51 PM, Ananda Kumar <

Re: enable and disable keys

2008-06-12 Thread Krishna Chandra Prajapati
the method we are following. > > 1. create empty table with all the indexes. > 2. disable keys > 3. Load data using LOAD DATA INFILE, close to 99 Million records which > takes > around 3 hrs > 4 . Enable keys > > Table size is around 19.5 gb > > There is one prima

Re: enable and disable keys

2008-06-12 Thread Ananda Kumar
yes, this is the default folder its configured. On 6/12/08, Boyd, Todd M. <[EMAIL PROTECTED]> wrote: > > From: Ananda Kumar [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 12, 2008 10:27 AM > To: Boyd, Todd M. > Cc: mysql > Subject: Re: enable and disable keys > >

RE: enable and disable keys

2008-06-12 Thread Boyd, Todd M.
From: Ananda Kumar [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2008 10:27 AM To: Boyd, Todd M. Cc: mysql Subject: Re: enable and disable keys /tmp has 16GB free space On 6/12/08, Boyd, Todd M. <[EMAIL PROTECTED]> wrote: > -Original Message- > From: Ananda Kumar [m

Re: enable and disable keys

2008-06-12 Thread Ananda Kumar
/tmp has 16GB free space On 6/12/08, Boyd, Todd M. <[EMAIL PROTECTED]> wrote: > > > -Original Message- > > From: Ananda Kumar [mailto:[EMAIL PROTECTED] > > Sent: Thursday, June 12, 2008 9:41 AM > > To: [EMAIL PROTECTED] > > Cc: mysql > > Su

RE: enable and disable keys

2008-06-12 Thread Boyd, Todd M.
> -Original Message- > From: Ananda Kumar [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 12, 2008 9:41 AM > To: [EMAIL PROTECTED] > Cc: mysql > Subject: Re: enable and disable keys > > We have 200GB of free space on the file system where our database is > loc

Re: enable and disable keys

2008-06-12 Thread Ken Menzel
create empty table with all the indexes. 2. disable keys 3. Load data using LOAD DATA INFILE, close to 99 Million records which takes around 3 hrs 4 . Enable keys Table size is around 19.5 gb There is one primary key, 2 non unique indexes and one FULLTEXT INDEX. Enable kyes goes fine for couple

Re: enable and disable keys

2008-06-12 Thread Ananda Kumar
ethod we are following. >> >> 1. create empty table with all the indexes. >> 2. disable keys >> 3. Load data using LOAD DATA INFILE, close to 99 Million records which >> takes >> around 3 hrs >> 4 . Enable keys >> >> Table size is around 19.5 gb &

Re: enable and disable keys

2008-06-12 Thread Ken Menzel
Ananda Kumar wrote: Hi All, We are doing load data into a table using LOAD DATA INFILE process. Below is the method we are following. 1. create empty table with all the indexes. 2. disable keys 3. Load data using LOAD DATA INFILE, close to 99 Million records which takes around 3 hrs 4 . Enable

enable and disable keys

2008-06-12 Thread Ananda Kumar
Hi All, We are doing load data into a table using LOAD DATA INFILE process. Below is the method we are following. 1. create empty table with all the indexes. 2. disable keys 3. Load data using LOAD DATA INFILE, close to 99 Million records which takes around 3 hrs 4 . Enable keys Table size is

Re: Foreign keys on non-unique columns (problem)

2007-11-04 Thread Yves Goergen
On 04.11.2007 21:10 CE(S)T, Martijn Tonies wrote: >> Now I have added this foreign key constraint: >> >> ALTER TABLE "user" ADD FOREIGN KEY ("AdditionalKeylist") REFERENCES >> "keylist" ("KeylistId") ON DELETE SET NULL; > > This cannot work. The column in KEYLIST to which you are > pointing should

Re: Foreign keys on non-unique columns (problem)

2007-11-04 Thread Martijn Tonies
Hi Yves, > I have a problem with my foreign keys. I have the following two tables: > > CREATE TABLE "keylist" ( > "KeylistId" INTEGER NOT NULL, > "UserId" INTEGER NOT NULL, > PRIMARY KEY (KeylistId, UserId)); > > CREATE TABL

Re: Foreign keys on non-unique columns (problem)

2007-11-03 Thread Yves Goergen
On 03.11.2007 22:52 CE(S)T, Yves Goergen wrote: > Is my design bad? I should explain why I do it this way at all. There's some other tables in my system that need to keep a list of "keys" (i.e. user IDs) for several actions. A message (one of the tables) has one keylist for re

Foreign keys on non-unique columns (problem)

2007-11-03 Thread Yves Goergen
Hi, I have a problem with my foreign keys. I have the following two tables: CREATE TABLE "keylist" ( "KeylistId" INTEGER NOT NULL, "UserId" INTEGER NOT NULL, PRIMARY KEY (KeylistId, UserId)); CREATE TABLE "user" ( "UserId" IN

Re: Comparing keys in two tables

2007-10-26 Thread Baron Schwartz
Rob Wultsch wrote: On 10/26/07, Baron Schwartz <[EMAIL PROTECTED]> wrote: Aaron Fischer wrote: Thanks Peter and Baron, these both worked well. The "left join on" took .1919 seconds and the "left outer join as" took .1780 seconds. They are synonymous in MySQL. The only difference is 6 extra c

Re: Comparing keys in two tables

2007-10-26 Thread Peter Brawley
Aaron >The "left join on" took .1919 seconds and the "left outer join as" took .1780 seconds. Caching :) PB - Aaron Fischer wrote: Thanks Peter and Baron, these both worked well. The "left join on" took .1919 seconds and the "left outer join as" took .1780 seconds. =) On Oct 26,

Re: Comparing keys in two tables

2007-10-26 Thread Rob Wultsch
On 10/26/07, Baron Schwartz <[EMAIL PROTECTED]> wrote: > > Aaron Fischer wrote: > > Thanks Peter and Baron, these both worked well. > > > > The "left join on" took .1919 seconds and the "left outer join as" took > > .1780 seconds. > > They are synonymous in MySQL. The only difference is 6 extra ch

Re: Comparing keys in two tables

2007-10-26 Thread Baron Schwartz
Aaron Fischer wrote: Thanks Peter and Baron, these both worked well. The "left join on" took .1919 seconds and the "left outer join as" took .1780 seconds. They are synonymous in MySQL. The only difference is 6 extra characters in the query text. The difference was probably due to caches.

Re: Comparing keys in two tables

2007-10-26 Thread mysql
Aaron Fischer wrote: Greetings! I have a problem that it seems would best be solved using subqueries. However, I am working on a server that is running MySQL 3.23.58, so subqueries are not available to me. What I am trying to do: I have two tables, each containing approximately 37,000 rec

Re: Comparing keys in two tables

2007-10-26 Thread Aaron Fischer
Thanks Peter and Baron, these both worked well. The "left join on" took .1919 seconds and the "left outer join as" took .1780 seconds. =) On Oct 26, 2007, at 11:37 AM, Peter Brawley wrote: Aaron An exclusion join: SELECT a.col FROM a LEFT JOIN b ON a.col=b.col WHERE b.col IS NULL; PB

Re: Comparing keys in two tables

2007-10-26 Thread Peter Brawley
Aaron An exclusion join: SELECT a.col FROM a LEFT JOIN b ON a.col=b.col WHERE b.col IS NULL; PB Aaron Fischer wrote: Greetings! I have a problem that it seems would best be solved using subqueries. However, I am working on a server that is running MySQL 3.23.58, so subqueries are not avai

Re: Comparing keys in two tables

2007-10-26 Thread Baron Schwartz
Aaron Fischer wrote: Greetings! I have a problem that it seems would best be solved using subqueries. However, I am working on a server that is running MySQL 3.23.58, so subqueries are not available to me. What I am trying to do: I have two tables, each containing approximately 37,000 recor

Comparing keys in two tables

2007-10-26 Thread Aaron Fischer
Greetings! I have a problem that it seems would best be solved using subqueries. However, I am working on a server that is running MySQL 3.23.58, so subqueries are not available to me. What I am trying to do: I have two tables, each containing approximately 37,000 records. I want to com

Re: Suse Linux (SLES10), Portuguese characters and "dead keys" in "MySQL monitor" in SSH sessions with Unicode (UTF-8)

2007-08-08 Thread Ricardo Dias Marques
lient), when I'm in a SSH (Secure Shell) Session, in a SUSE Linux Enterprise Server 10, configured to use Unicode (UTF-8 encoding). The Portuguese accented characters appeared well, in the same SSH session, for other shell (bash) commands and in Vim editing sessions (using the same Portuguese keyb

Suse Linux (SLES10), Portuguese characters and "dead keys" in "MySQL monitor" in SSH sessions with Unicode (UTF-8)

2007-07-31 Thread Ricardo Dias Marques
Session, in a Linux Server configured to use Unicode (UTF-8 encoding). I'm using "dead keys" - http://en.wikipedia.org/wiki/Dead_key - to enter the accented characters. That is, if I press the ã (tilde sign) key on my keyboard and then press "a" (lowercase a) then I get &q

Re: when rebuilding keys?

2007-04-12 Thread Martijn Tonies
t; sorry ,my english is poor. > > There is a observable event. > My table's engine is myisam. > Rows above 100 in my table. > I did "alter table ..disable keys" before loading data. > I did "alter table ..enable keys" after loading data. > Th

RE: when rebuilding keys?

2007-04-12 Thread Addison, Mark
From: wangxu Sent: Thu 12/04/2007 08:38 > - Original Message - > From: "Martijn Tonies" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Thursday, April 12, 2007 3:17 PM > Subject: Re: when rebuilding keys? &

Re: when rebuilding keys?

2007-04-12 Thread wangxu
- Original Message - From: "Martijn Tonies" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, April 12, 2007 3:17 PM Subject: Re: when rebuilding keys? > > >> yes. > >> >> before load data. >&

Re: when rebuilding keys?

2007-04-12 Thread Martijn Tonies
> yes. > >> before load data. > > > > You want to rebuild the indices after loading data, > > correct? Then what exactly is the question? Please write your answer BELOW, not above. Martijn Tonies Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle & MS SQL Server Upscen

Re: when rebuilding keys?

2007-04-11 Thread wangxu
yes. - Original Message - From: "Martijn Tonies" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; Sent: Thursday, April 12, 2007 1:43 AM Subject: Re: when rebuilding keys? > > > >> before load data. > > You want to rebuild the indices after l

Re: when rebuilding keys?

2007-04-11 Thread Martijn Tonies
rum! http://www.databasedevelopmentforum.com > >> My table is myisam. > >> > >> I disable key using "alter table ... disable keys" before load data in the > > table. > >> > >> The manual tell me MySQL to stop updating non-unique indexes

Re: when rebuilding keys?

2007-04-11 Thread wangxu
before load data. - Original Message - From: "Martijn Tonies" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; Sent: Wednesday, April 11, 2007 7:45 PM Subject: Re: when rebuilding keys? > > > >> My table is myisam. >> >> I disable key

Re: when rebuilding keys?

2007-04-11 Thread Martijn Tonies
> My table is myisam. > > I disable key using "alter table ... disable keys" before load data in the table. > > The manual tell me MySQL to stop updating non-unique indexes for a MyISAM table. > > When mysql server updating non-unique index after loading

Re: find hanging keys

2007-03-16 Thread mos
At 03:27 PM 3/16/2007, you wrote: How to find all the values of column a in table A that are not values of column b in table B? Thanks YL, You need to do a Left Join and it will use NULL's for rows in the second table if the row is missing. select A.* from TableA TA left join TableB TB

Re: Retrieving foreign keys and references

2007-02-21 Thread Tim Johnson
On Wednesday 21 February 2007 17:51, Paul McCullagh wrote: > Hi Tim, Hello Paul > Foreign key definitions are parsed but ignored by MyISAM tables. Understood. Thanks > Try InnoDB or PBXT (http://www.primebase.com/xt) :) for the time being, I'm going to stick with MyISAM. I've got a possible solu

Re: Retrieving foreign keys and references

2007-02-21 Thread Tim Johnson
On Wednesday 21 February 2007 17:43, Rolando Edwards wrote: > SHOW INDEXES FROM `providers`; > > By the way, what version of MySQL are you using ??? 4.0.20 -- Tim Johnson <[EMAIL PROTECTED]> Palmer, Alaska, USA -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To u

Re: Retrieving foreign keys and references

2007-02-21 Thread Paul McCullagh
Hi Tim, Foreign key definitions are parsed but ignored by MyISAM tables. Try InnoDB or PBXT (http://www.primebase.com/xt) :) On Feb 21, 2007, at 9:35 AM, Tim Johnson wrote: On Wednesday 21 February 2007 17:01, Rolando Edwards wrote: SHOW CREATE TABLE providers\G Hi Rolando: That doesn't do

Re: Retrieving foreign keys and references

2007-02-21 Thread Rolando Edwards
SHOW INDEXES FROM `providers`; By the way, what version of MySQL are you using ??? - Original Message - From: "Tim Johnson" <[EMAIL PROTECTED]> To: mysql@lists.mysql.com Sent: Wednesday, February 21, 2007 3:35:46 AM (GMT-0500) Auto-Detected Subject: Re: Retrieving

Re: Retrieving foreign keys and references

2007-02-21 Thread Tim Johnson
On Wednesday 21 February 2007 17:01, Rolando Edwards wrote: > SHOW CREATE TABLE providers\G Hi Rolando: That doesn't do it on my machine (linux, ver 4.0.2) Here's what I see mysql> SHOW CREATE TABLE providers\G *** 1. row *** Table: providers

Re: Retrieving foreign keys and references

2007-02-21 Thread Rolando Edwards
SHOW CREATE TABLE providers\G - Original Message - From: "Tim Johnson" <[EMAIL PROTECTED]> To: "MySQL General Mailing List" Sent: Wednesday, February 21, 2007 2:59:35 AM (GMT-0500) Auto-Detected Subject: Retrieving foreign keys and references Hi: Below is the

Retrieving foreign keys and references

2007-02-21 Thread Tim Johnson
Hi: Below is the following relevant create table syntax CREATE Table providers( [snipped] FOREIGN KEY (status) REFERENCES provider_status(ID,title), UNIQUE KEY ID (ID) ) TYPE=MyISAM; and below is the relevant output from a describe query: mysql> show columns from providers; +---

  1   2   3   4   5   6   7   8   9   >