Chris Hornung duplicate rows in spite of multi-column unique constraint
Mar 23, 2015; 13:20
Chris Hornung
duplicate rows in spite of multi-column unique constraint
Hello,
I'm come across a situation where a table in our production DB has a relatively small number of duplicative rows that seemingly defy the unique constraint present on that table.
We're running MySQL 5.6.19a via Amazon RDS. The table in question is ~250M rows.
Interestingly, these dupe records can't seem to be queried when using both columns from the unique constraint in the WHERE clause:
mysql> select * from app_customergroupmembership where customer_id = 'ajEiQA' and group_id = 'ddH6Ev'; +-------------+-------------+----------+---------------------+ | id | customer_id | group_id | created | +-------------+-------------+----------+---------------------+ | 20279608258 | ajEiQA | ddH6Ev | 2015-02-17 00:14:54 | +-------------+-------------+----------+---------------------+
Any thoughts on how this situation came to pass, and how to prevent it from happening?
Thanks, -- Chris Hornung
Mar 24
Johan De Meersman Re: duplicate rows in spite of multi-column unique constraint
Mar 24, 2015; 11:08
Johan De Meersman
Re: duplicate rows in spite of multi-column unique constraint
Mar 24
Chris Hornung Re: duplicate rows in spite of multi-column unique constraint
Mar 24, 2015; 10:07
Chris Hornung
Re: duplicate rows in spite of multi-column unique constraint
Mar 24
shawn l.green Re: duplicate rows in spite of multi-column unique constraint
Mar 24, 2015; 10:23
shawn l.green
Re: duplicate rows in spite of multi-column unique constraint
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!