Re: Startup cost of sequential scan

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Startup cost of sequential scan
Дата
Msg-id 9842.1535643199@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Startup cost of sequential scan  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Список pgsql-hackers
Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> The model (assuming I understand it rightly) is that what we're actually
> tracking is a startup cost and a per-output-row cost, but for comparison
> purposes we actually store the rows and the computed total, rather than
> just the per-row cost:

> rows
> startup_cost
> total_cost = startup_cost + (rows * per_row_cost)

Right.  I tend to think of it differently: the cost to retrieve the
first K rows out of a total of N is
    startup_cost + (total_cost - startup_cost) * K/N
but that comes out to the same thing as what Andrew said.

            regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Gierth
Дата:
Сообщение: Re: Startup cost of sequential scan
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: Startup cost of sequential scan