Re: 7k records into Sort node, 4.5m out?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: 7k records into Sort node, 4.5m out?
Дата
Msg-id 1059.1345477224@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: 7k records into Sort node, 4.5m out?  (Josh Berkus <josh@agliodbs.com>)
Ответы Re: 7k records into Sort node, 4.5m out?  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-performance
Josh Berkus <josh@agliodbs.com> writes:
> I guess what I'm really not understanding is why it's calculating a cost
> of 3.7m for the index scan, and then discarding that *entire* cost and
> not including it in the total cost of the query?

It isn't ... or at least, you've offered no evidence that it is.
It's discounting some fraction of the cost on the (apparently correct)
basis that the merge won't read that input all the way to the end.
Whether it's discounted by an appropriate fraction is hard to tell
from the information given.  The actual rows count is about a quarter
the whole-scan estimate, so a multiplier of 0.25 seems right in
hindsight, and that seems to match up roughly right with the mergejoin
cost estimate --- but not knowing the actual table size, there's a lot
of uncertainty here.

            regards, tom lane


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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: 7k records into Sort node, 4.5m out?
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: 7k records into Sort node, 4.5m out?