Re: Bitmap reuse

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Bitmap reuse
Date: 2021-07-20 23:25:29
Message-ID: 645393.1626823529@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeff Janes <jeff(dot)janes(at)gmail(dot)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.

If the output of the subplan was indeed constant, I'd expect the planner
to stick a Materialize node atop it. That would almost certainly win
more than re-using the index output to scan the heap additional times.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2021-07-21 00:08:24 Re: badly calculated width of emoji in psql
Previous Message Jeff Janes 2021-07-20 23:10:41 Bitmap reuse