Re: Delaying the planning of unnamed statements until Bind - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Delaying the planning of unnamed statements until Bind
Date
Msg-id 16676.1085178615@sss.pgh.pa.us
Whole thread Raw
In response to Re: Delaying the planning of unnamed statements until Bind  (Greg Stark <gsstark@mit.edu>)
Responses Re: Delaying the planning of unnamed statements until Bind  (Andrew Dunstan <andrew@dunslane.net>)
Re: Delaying the planning of unnamed statements until Bind  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
Greg Stark <gsstark@mit.edu> writes:
> If the planner had the expected value as well as the variance of the cost
> distribution then it might realize that in this case for instance that the
> penalty for guessing wrong with an index scan is only going to be a small
> slowdown factor, perhaps 2-4x slower. Whereas the penalty for guessing wrong
> with a sequential scan could be a factor in the thousands or more.

Au contraire --- a full-table index scan can be vastly slower than a
full-table seqscan.  I think it's wishful thinking to assume that
picking an indexscan is the right thing when we don't know any better.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Delaying the planning of unnamed statements until Bind
Next
From: Andrew Dunstan
Date:
Subject: Re: Delaying the planning of unnamed statements until Bind