"Jim C. Nasby" <jim@nasby.net> writes:
> On Tue, Jun 10, 2003 at 02:15:11AM -0400, Tom Lane wrote:
>> ... In reality, most of the upper btree levels will no doubt
>> stay in memory during such a query, and so this estimate charges many
>> more reads than really occur. Fixing this is on the todo list, but no
>> one's got to it yet. (It's not clear to me how to put the consideration
>> into the planner's cost algorithms in a clean way.)
> What about just ignoring all but the leaf pages?
IIRC, we already know what cost model we want to use. The problem is
that the planner's code structure makes it difficult for the indexscan
coster to know that the indexscan will be applied repeatedly rather than
just once. That's what has to be solved.
regards, tom lane