Performance improvement for unique checks - Mailing list pgsql-hackers

From Gokulakannan Somasundaram
Subject Performance improvement for unique checks
Date
Msg-id 9362e74e1003261353r22f96499h2ae2bc26a07170c8@mail.gmail.com
Whole thread Raw
Responses Re: Performance improvement for unique checks
List pgsql-hackers
Hi,<br />   Since we insert a new entry into the index for every update that's being made into the table, we inevitably
makea unique check against the older version of the newly inserted row, even when the values are not updated. Of course
iam talking about non-HOT updates. (We will not go to the index for HOT updates)<br /><br />a) The page which contains
theindex entry is Exclusively locked<br />b) We go ahead and visit the heap page for its HeapTupleSatisfiesDirty.<br
/><br/>If we have the information of the old tuple(its tuple-id) after a heap update, during the index insert, we can
avoidthe uniqueness check for this tuple,as we know for sure that tuple won't satisfy the visibility criteria. If the
tablehas 'n' unique indexes it avoids 'n' heap tuple lookups, also increasing the concurrency in the btree, as the
writelock duration is reduced.<br /><br />Any comments?<br /><br />Thanks,<br />Gokul.<br /> 

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Augment WAL records for btree delete with GetOldestXmin() to
Next
From: Steve Singer
Date:
Subject: Re: dtester-0.1 released