Re: [PATCH] Microvacuum for gist.
От | Anastasia Lubennikova |
---|---|
Тема | Re: [PATCH] Microvacuum for gist. |
Дата | |
Msg-id | 55EDB304.5020006@postgrespro.ru обсуждение исходный текст |
Ответ на | Re: [PATCH] Microvacuum for gist. (Teodor Sigaev <teodor@sigaev.ru>) |
Ответы |
Re: [PATCH] Microvacuum for gist.
|
Список | pgsql-hackers |
04.09.2015 15:11, Teodor Sigaev: > Some notices > > 1 gistvacuumpage(): > OffsetNumber deletable[MaxOffsetNumber]; > Seems, MaxOffsetNumber is too much, MaxIndexTuplesPerPage is enough Fixed. > 2 Loop in gistkillitems() for searching heap pointer. It seems to me that > it could be a performance problem. To fix it, it's needed to remember > index tuple's offset number somewhere near > GISTScanOpaqueData->killedItems. And > gistkillitems() will loop over offsets and compare heap pointer from > killedItems and index tuple, if they doesn't match then just skip this > index tuple. Thanks for suggestion. I've rewritten this function. Now killedItems[] contains only OffsetNumbers of tuples which we are going to delete. PageLSN check is enough to ensure that nothing has changed on the page. Heap pointer recheck is unnecessary. (It's really important for btree, where tuple could be inserted in the middle of page. But we can't have such situation for GiST index page). It works 50% faster than before. > 3 Connected with previous, could you show some performance tests? Perfomance test is attached. Test is following - portion of tuples is deleted and after that selected several times. Without microvacuum. All 'select' queries are executed at about same time Time: 360,468 ms Time: 243,197 ms Time: 238,310 ms Time: 238,018 ms With microvacuum. First 'select' invokes gistkillitems(). It's executed a bit slower than before. But following queries are executed significantly faster than without microvacuum. Time: 368,780 ms Time: 69,769 ms Time: 9,545 ms Time: 12,427 ms Please, review the patch again. I could have missed something. P.S. Do I need to write any documentation update? -- Anastasia Lubennikova Postgres Professional: http://www.postgrespro.com The Russian Postgres Company
Вложения
В списке pgsql-hackers по дате отправления: