Re: [PATCH] Microvacuum for gist. - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Re: [PATCH] Microvacuum for gist.
Date
Msg-id 55FAEDF4.4020609@sigaev.ru
Whole thread Raw
In response to Re: [PATCH] Microvacuum for gist.  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-hackers
> But I don't understand this comment:
>
> +               /*
> +                * While we delete only one tuple at once we could mix calls
> +                * PageIndexTupleDelete() here and PageIndexMultiDelete() in
> +                * gistRedoPageUpdateRecord()
> +                */
>
> Does this mean:
>
> Since we delete only one tuple per WAL record here, we can call
> PageIndexTupleDelete() here and re-play it with PageIndexMultiDelete() in
> gistRedoPageUpdateRecord()

yes. The problem was when we delete tuples with offset (2,4,6) with 
PageIndexMultiDelete() we will delete exctly pointed tuples. Bur if we delete 
tuple by PageIndexTupleDelete() with offset  2 then 4-th tuple will be moved 3 3 
and 6 become 5. So, next tuple to delete now is 3 and we should call 
PageIndexTupleDelete(3) and so on. And bug was: we deleted tuples in 
ginpagevacuum with a help of PageIndexMultiDelete() and write to WAL his 
argument, and recovery process uses  PageIndexTupleDelete() without correcting 
offset.

-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 



pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: Re: [PATCH] Microvacuum for gist.
Next
From: "Shulgin, Oleksandr"
Date:
Subject: Re: On-demand running query plans using auto_explain and signals