Re: Startup cost of sequential scan - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Startup cost of sequential scan
Date
Msg-id CA+TgmoY+XwhcgdAX8=F2=1i6rdJGdfwZ19xdBw7OD36_bDaKdA@mail.gmail.com
Whole thread Raw
In response to Re: Startup cost of sequential scan  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Startup cost of sequential scan
List pgsql-hackers
On Thu, Aug 30, 2018 at 10:04 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Alexander Korotkov <a.korotkov@postgrespro.ru> writes:
>> But I think there is another issue in sequential scan cost.  We have
>> zero startup cost for sequential scan.  But why?
>
> Because it's what the mental model of startup cost says it should be.

Whose mental model?  I guess the Tom Lane mind is the canonical one
for this project, but I'm not sure that it entirely agrees with mine.
IIRC, it was previously proposed that we ought to charge
random_page_cost for the first block of a sequential scan, because at
present the cost of fetching 1 block differs depending on whether we
are fetching it from a heap or an index, which seems unprincipled.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Extra word in src/backend/optimizer/README
Next
From: Robert Haas
Date:
Subject: Re: Use C99 designated initializers for some structs