Disable/Enable Keys and Duplicate Records

2003-10-13 Thread Randy Chrismon
I'm not clear on this. What happens to duplicates under the following
scenario?

MyISAM table with either (or both!) a primary key or a unique index.
Alter table my_table disable keys.
Import 200K records.
Alter table my_table enable keys.

But it turns out there are duplicate records. Does MySQL abort the
enable key? Does it drop one of the offending records? If so, which
one? MySQL apparently does not have table where offending rows -- the
ones deleted -- are stored?

Thanks.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Disable/Enable Keys and Duplicate Records

2003-10-13 Thread Matt W
Hi Randy,

Unique keys are not disabled with DISABLE KEYS -- so the unique
constraint isn't violated. From
http://www.mysql.com/doc/en/ALTER_TABLE.html

ALTER TABLE ... DISABLE KEYS makes MySQL to stop updating *non-unique*
indexes for MyISAM table.


Matt


- Original Message -
From: Randy Chrismon
Sent: Monday, October 13, 2003 9:48 AM
Subject: Disable/Enable Keys and Duplicate Records


I'm not clear on this. What happens to duplicates under the following
scenario?

MyISAM table with either (or both!) a primary key or a unique index.
Alter table my_table disable keys.
Import 200K records.
Alter table my_table enable keys.

But it turns out there are duplicate records. Does MySQL abort the
enable key? Does it drop one of the offending records? If so, which
one? MySQL apparently does not have table where offending rows -- the
ones deleted -- are stored?

Thanks.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]