Re: BUG #10816: explain analyze reports different rows counts before and after sort

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #10816: explain analyze reports different rows counts before and after sort
Дата
Msg-id 4200.1404137817@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #10816: explain analyze reports different rows counts before and after sort  (bashtanov@imap.cc)
Список pgsql-bugs
bashtanov@imap.cc writes:
> Please have a look at the two bottom nodes of the plan. Function scan
> produces 1000 rows, then they are sorted and turn into 3201 rows! How could
> this happen?

The discrepancy is easily explained because the sort is the righthand
child of a merge join.  Merge join will rewind and rescan its right
child every time the left child produces duplicate keys, so that the
appropriate right-child rows get joined to all the similarly-keyed
rows from the left child.  And you do have duplicate outputs coming
from that left child ...

IOW, it's just a measurement artifact arising from re-fetching the
same rows repeatedly.  I think there's a warning about this in the
docs.

            regards, tom lane

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

Предыдущее
От: Asif Naeem
Дата:
Сообщение: Re: [HACKERS] BUG #9652: inet types don't support min/max
Следующее
От: rameshparnanditech@gmail.com
Дата:
Сообщение: BUG #10817: archive settings