Normal query for a specific primary key is showing row count as 1. But when trying to fetch the duplicate records in a table (sample command: SELECT name, email, COUNT(*) FROM users GROUP BY name, email HAVING COUNT(*) > 1 ) is showing count as 2 for the same primary key.
Strange thing is after we delete this duplicate record, when we check again for duplicate records, a new row is being displayed with count as 2.
Checked the triggers as well and no new rows being created on delete.
Tried with below options as well:
SET LOCAL enable_indexscan = off;
SET LOCAL enable_bitmapscan = off;
SET LOCAL enable_indexonlyscan = off;
Please let me know if you have come across any similar situation and if any workaround/reason for such situation ?
Thanks in advance!!!
|