blobcity/db

Delete dropping data but not index entry

Opened this issue · 0 comments

The delete query properly deletes the data, but retains the index entry for the deleted record. This causes select distinct to give inconsistent results.

delete from ds.collection where code = '123'

Now run a select distinct on the table for code

select distinct code from ds.collection

The code 123 is present in the response.

However the data is actually not present, so the delete has properly executed

select * from ds.collection where code = '123`

The above statement will return 0 rows, thereby making the select distinct operation return inconsistent results.