<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>