> 14 июля 2018 г., в 14:39, Heikki Linnakangas <hlinn...@iki.fi> написал(а):
> 
> On 14/07/18 10:26, Andrey Borodin wrote:
>> This is tradeoff between complex concurrency feature and possibility
>> of few dead tuples left after VACUUM. I want to understand: is it
>> something dangerous in this dead tuples?
> Yeah, that's bad. When a new heap tuple is inserted in the same location, the 
> old index tuple will point to the new, unrelated, tuple, and you will get 
> incorrect query results.

PFA v8: at the beginning of physical scan I grab GetInsertRecPtr() and if leaf 
page have rightlink lefter in file and NSN higher than LSN of start we get back 
to scan that page one more time. This is recursive.


I'm still not very comfortable with storing deletion xid in opaque data: we 
reuse rightlink field under very specific conditions instead of using totally 
unused pd_prune_xid. We have a remark in bufpage.h
 * pd_prune_xid is a hint field that helps determine whether pruning will be
 * useful.  It is currently unused in index pages.
Or may be we should use some other place on those empty 8Kb page.

Deleted page do not have rightlink now, but in B-trees rightlink on deleted 
pages is actively used.
We either cannot reuse NSN: rightlink is useless without NSN anyway. We cannot 
reuse flags, page is deleted in flags after all. uint16 gist_page_id is just 
not enough.

Best regards, Andrey Borodin.

Attachment: 0002-Physical-GiST-scan-during-VACUUM-v8.patch
Description: Binary data

Attachment: 0001-Delete-pages-during-GiST-VACUUM-v8.patch
Description: Binary data

Reply via email to