Re: Bitmap reuse - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Bitmap reuse
Date
Msg-id 645393.1626823529@sss.pgh.pa.us
Whole thread Raw
In response to Bitmap reuse  (Jeff Janes <jeff.janes@gmail.com>)
Responses Re: Bitmap reuse  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-hackers
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.

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



pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: Bitmap reuse
Next
From: Jacob Champion
Date:
Subject: Re: badly calculated width of emoji in psql