In the last few days I've been doing some prototyping on mysql 4.1.1 (mainly because I want fulltext indexes against utf-8 data).

I have a table, artists_search_A, in which I want to load ~100K records. My load process will routinely load 14783 records successfully. After 14783 inserts, any insert attempt results in a 1062 error, duplicate entry; specifically,

Duplicate entry 'en-us' for key 2 error 1062 recorded

That's on the lang_code column. Looking through my source data, I have precisely 4 distinct lang_codes, and at this point _only_ en-us data have been loaded. The prior 14783 records should not have loaded successfully if the index were truly unique. A quick check in the output of 'show index' (pasted below) shows the lang_code index to be non-unique.

Out of ~20 separate attempts in the last few days (each time I tweak something hoping to find a remedy), in only one case did all the data load. Sadly, I have no idea what was unique about that run. All other attempts bomb out after precisely 14783 records...

Anyone else encountering this? It sounds a lot like bug 2401

http://bugs.mysql.com/bug.php?id=2401

except that it happens even if no other thread accesses the table during the load, and it always occurs after exactly the same number of inserts.

- mark


mysql> desc artists_search_A; +------------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------------+--------------+------+-----+---------+-------+ | artist_id | int(11) | | PRI | 0 | | | lang_code | varchar(5) | | PRI | | | | name | varchar(128) | | MUL | | | | major_cat | smallint(6) | | MUL | 0 | | | minor_cat | smallint(6) | | MUL | 0 | | | events_scheduled | char(1) | | MUL | n | | | unmapped | char(1) | YES | MUL | NULL | | | team | char(1) | YES | MUL | NULL | | | dma_ids | varchar(255) | YES | MUL | NULL | | | national_ids | varchar(64) | YES | MUL | NULL | | | keywords | text | YES | MUL | NULL | | | tmol_modified | timestamp | YES | | NULL | | +------------------+--------------+------+-----+---------+-------+ 12 rows in set (0.00 sec)

This is the second index on lang_code, snipped from show index...

+------------------+------------+------------------+--------------+------------------+-----------+-------------+----------+--------+------+------------+---------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+------------------+------------+------------------+--------------+------------------+-----------+-------------+----------+--------+------+------------+---------+
| artists_search_A | 0 | PRIMARY | 1 | artist_id | A | NULL | NULL | NULL | | BTREE | |
| artists_search_A | 0 | PRIMARY | 2 | lang_code | A | 14783 | NULL | NULL | | BTREE | |
| artists_search_A | 1 | lang_code | 1 | lang_code | A | NULL | NULL | NULL | | BTREE | |
[snip]


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



Reply via email to