Re: Bitmap reuse - Mailing list pgsql-hackers

From David Rowley
Subject Re: Bitmap reuse
Date
Msg-id CAApHDvoDSKkvvYiZ_XKZa6qtEwhCYZpBK1HaDzn1q6_JZ9b4rQ@mail.gmail.com
Whole thread Raw
In response to Re: Bitmap reuse  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Bitmap reuse  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-hackers
On Wed, 21 Jul 2021 at 13:32, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> David Rowley <dgrowleyml@gmail.com> writes:
> > I imagined Jeff was meaning the bitmap from the scan of foo_x_idx, not
> > the combined ANDed bitmap from both indexes.
>
> To re-use that, you'd need a way to prevent the upper node from
> destructively modifying the tidbitmap.

Yeah.  And that would slow things down in the case where it was just
executed once as we'd need to make a copy of it to prevent the cached
version from being modified regardless if it would ever be used again
or not.

Maybe the planner would need to be involved in making the decision of
if the bitmap index scan should tuck away a carbon copy of the
resulting TIDBitmap after the first scan.  That way on rescan we could
just make a copy of the cached version and return that.  That saves
having to modify the callers to tell them not to damage the returned
TIDBitmap.

David



pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: add 'noError' to euc_tw_and_big5.c
Next
From: David Rowley
Date:
Subject: Re: Bitmap reuse