gist vacuum seaq access
<div>After discussion of gist seaq access in vaccum there are 2 issue:</div><div>О©╫</div><div>Heikki says :</div><div><span style="font-size:15px;line-height:21.504px;white-space:pre-wrap;background-color:#eeeeee;">Vacuum needs to </span><span style="font-size:15px;line-height:21.504px;white-space:pre-wrap;background-color:#eeeeee;">memorize the current NSN when it begins</span></div><div>1) how i may getting corect NSN.</div><div>О©╫</div><div>Also i must setting F_DELETED flag on empty page and to clean parent from link on deleted_pages<span style="font-size:15px;line-height:21.504px;white-space:pre-wrap;background-color:#eeeeee;"><br /></span></div><div>2) how i may getting parent of page fast??<span style="font-size:15px;line-height:21.504px;background-color:#eeeeee;"><br /></span></div><div>О©╫</div><div>Thanks.</div><div>О©╫</div>
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
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
<p>Heikki.<br />I have idea. when i begining vacuum i must create structure like hash table. And the first action i fill this hash table.<br />in code this look like:<br /><br />for( blkno = ..; all pages; blkno++) {<br />О©╫О©╫if(! gistPageIsLeaf(blkno)) {<br />О©╫О©╫О©╫О©╫О©╫for( all tuples in blkno ) {<br />О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫hash[ blkno that is referenced by the tuple] = blkno;<br />О©╫О©╫О©╫О©╫О©╫}<br />О©╫О©╫}<br />}</p><p>getting is parent of page is fast and simple( hash[page] ).</p><p>But this solution is need 2 full reading of index.О©╫</p><p>but Alexander says me that: this solution may be have a problem, because there is <span style="font-size:15px;line-height:21.504px;background-color:#eeeeee;">maintenance_work_mem.</span></p>