Re: Update obsolete text in indexam.sgml - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Update obsolete text in indexam.sgml
Date
Msg-id 23747.1352248620@sss.pgh.pa.us
Whole thread Raw
In response to Re: Update obsolete text in indexam.sgml  ("Etsuro Fujita" <fujita.etsuro@lab.ntt.co.jp>)
Responses Re: Update obsolete text in indexam.sgml  ("Etsuro Fujita" <fujita.etsuro@lab.ntt.co.jp>)
List pgsql-hackers
"Etsuro Fujita" <fujita.etsuro@lab.ntt.co.jp> writes:
> Agreed.  However, I am concerned about the next comment in the current code:

> /*
>  * Our generic assumption is that the index pages will be read
>  * sequentially, so they cost seq_page_cost each, not random_page_cost.
>  * ...

> I think this assumption is completely wrong, which has given me a motivation to
> propose a patch, though I am missing something.

Mph.  It's pretty hard to argue that it's wrong without considering a
specific index implementation, which in practice would have a ton of
other details that need to be accounted for here.  I don't have a strong
objection to changing the sample code to use random_page_cost instead,
but I doubt it will help anybody one way or another.

FWIW, the docs' sample code was an accurate transcription of what
genericcostestimate did at the time (8.1 era).  I think the case we were
thinking of when that code was written was a recently-rebuilt btree
index, in which logically adjacent leaf pages would indeed often be
sequential.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Merlin Moncure
Date:
Subject: WIP patch for hint bit i/o mitigation
Next
From: "Etsuro Fujita"
Date:
Subject: Re: Update obsolete text in indexam.sgml