Performance improvement for unique checks
От | Gokulakannan Somasundaram |
---|---|
Тема | Performance improvement for unique checks |
Дата | |
Msg-id | 9362e74e1003261353r22f96499h2ae2bc26a07170c8@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Performance improvement for unique checks
|
Список | 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 по дате отправления: