Subject | RE: [firebird-support] DUP key on restore |
---|---|
Author | Svein Erling Tysvær |
Post date | 2011-11-17T07:10:35Z |
>Hi Tomasz. I already checked the source database for duplicated entries,Exactly how did you check it for duplicate entries? The point is that if there's a problem with an index or key, then doing
>and found none, but i did not tried to verify the database with gfix.
SELECT MyIndexedField, count(*)
FROM MyTable
GROUP BY 1
HAVING count(*) > 1
will use the index/key and not discover the duplicate entry, whereas
SELECT MyIndexedField+0, count(*)
FROM MyTable
GROUP BY 1
HAVING count(*) > 1
cannot use the index and will find such duplicates.
HTH,
Set