Re: Recognizing range constraints (was Re: [PERFORM] Plan for relatively simple query seems to be very inefficient) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Recognizing range constraints (was Re: [PERFORM] Plan for relatively simple query seems to be very inefficient)
Date
Msg-id 6827.1112828794@sss.pgh.pa.us
Whole thread Raw
In response to Recognizing range constraints (was Re: [PERFORM] Plan for relatively simple query seems to be very inefficient)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
John A Meinel <john@arbash-meinel.com> writes:
> Actually, I think he was saying do a nested loop, and for each item in
> the nested loop, re-evaluate if an index or a sequential scan is more
> efficient.

> I don't think postgres re-plans once it has started, though you could
> test this in a plpgsql function.

It doesn't, and in any case that's a microscopic view of the issue.
The entire shape of the plan might change depending on what we think
the selectivity is --- much more than could be handled by switching
scan types at the bottom level.

Also, I anticipate that bitmap-driven index scans will change things
considerably here.  The range of usefulness of pure seqscans will
drop drastically...

            regards, tom lane

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Recognizing range constraints (was Re: [PERFORM] Plan for relatively simple query seems to be very inefficient)
Next
From: Simon Riggs
Date:
Subject: Re: Recognizing range constraints (was Re: [PERFORM] Plan for