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
> 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
regards, tom lane