Re: Bitmap reuse

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Bitmap reuse
Дата
Msg-id CAApHDvopTfKCFb=s-+s7jEd3T8hLFKNQUser=U_q4StaUV2i-w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Bitmap reuse  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Bitmap reuse
Список pgsql-hackers
On Wed, 21 Jul 2021 at 11:25, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Jeff Janes <jeff.janes@gmail.com> writes:
> > For some queries PostgreSQL can spend most of its time creating the exact
> > same bitmap over and over.  For example, in the below case: (also attached
> > as a file because line-wrapping is going to make a mess of it)
>
> Uh .... it's not the "exact same bitmap each time", because the selected
> rows vary depending on the value of g.i.

I imagined Jeff was meaning the bitmap from the scan of foo_x_idx, not
the combined ANDed bitmap from both indexes.

I didn't look in detail, but I'd think it would just be a matter of
caching the bitmap then in ExecReScanBitmapIndexScan(), if the
PlanState's chgParam indicate a parameter has changed, then throw away
the cache.  Then if the cache is still valid in
MultiExecBitmapIndexScan(), return it.  Not too sure about the memory
context part for the cache. As I said, I didn't look in detail.

David



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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Micro-optimizations to avoid some strlen calls.
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Micro-optimizations to avoid some strlen calls.