Re: Startup cost of sequential scan

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Startup cost of sequential scan
Date: 2018-08-30 19:43:59
Message-ID: CA+TgmoY+XwhcgdAX8=F2=1i6rdJGdfwZ19xdBw7OD36_bDaKdA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 30, 2018 at 10:04 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2018-08-30 19:55:58 Re: Use C99 designated initializers for some structs
Previous Message Magnus Hagander 2018-08-30 19:37:55 Re: Extra word in src/backend/optimizer/README