Re: gist vacuum seaq access

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: gist vacuum seaq access
Дата
Msg-id 541367DA.1000104@vmware.com
обсуждение исходный текст
Ответ на gist vacuum seaq access  (Костя Кузнецов <chapaev28@ya.ru>)
Ответы Re: gist vacuum seaq access  (Костя Кузнецов <chapaev28@ya.ru>)
Список pgsql-hackers
On 09/11/2014 12:16 PM, Костя Кузнецов wrote:
> After discussion of gist seaq access in vaccum there are 2 issue:
> Heikki says :
> Vacuum needs to memorize the current NSN when it begins
> 1) how i may getting corect NSN.

The "current NSN" is just current WAL insert location, so 
GetXLogInsertRecPtr() will do it. Or if it's an unlogged table, 
GistGetFakeNSN().

> Also i must setting F_DELETED flag on empty page and to clean parent from link
> on deleted_pages
> 2) how i may getting parent of page fast??

No idea. The B-tree code uses the page's high key to search the tree, 
but that doesn't work too well for GiST. There is no high key on the 
page to search with, although you could use e.g. the last key you remove 
from the page for that. But a search from the root with that key might 
need to visit many pages before finding the deleted page, so it's not 
very fast.

I think you need to take a different approach. For example, leave the 
empty page in the tree in vacuum, but remember its page number. After 
vacuum has finished, make another full scan of the index, searching for 
the downlinks of all the empty pages.

- Heikki




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: bad estimation together with large work_mem generates terrible slow hash joins
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: bad estimation together with large work_mem generates terrible slow hash joins