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

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
(view: Whole thread, Raw)
In response to: Recognizing range constraints (was Re: [PERFORM] Plan for relatively simple query seems to be very inefficient)  (Tom Lane)
List: pgsql-hackers


John A Meinel <> 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:

From: Tom Lane
Date:
Subject: Re: prepared statements don't log arguments?
From: "Qingqing Zhou"
Date:
Subject: Re: Did this issue ever get resolved?