Sort returns more rows than seq scan?

Started by Pavel Stehuleabout 10 years ago3 messageshackers
Jump to latest
#1Pavel Stehule
pavel.stehule@gmail.com

Hi

I don't understand how is possible to get more rows from Sort node than in
nested seq scan?

http://explain.depesz.com/s/568O

Sec scan returns 1.6M rows, Sort returns 2.7M rows

Regards

Pavel

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Pavel Stehule (#1)
Re: Sort returns more rows than seq scan?

Pavel Stehule <pavel.stehule@gmail.com> writes:

I don't understand how is possible to get more rows from Sort node than in
nested seq scan?

The "extra" rows are re-fetches triggered by mark/restore requests from
the parent mergejoin. The EXPLAIN instrumentation counts re-fetches as
if they were new rows.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Pavel Stehule
pavel.stehule@gmail.com
In reply to: Tom Lane (#2)
Re: Sort returns more rows than seq scan?

2016-03-01 15:45 GMT+01:00 Tom Lane <tgl@sss.pgh.pa.us>:

Pavel Stehule <pavel.stehule@gmail.com> writes:

I don't understand how is possible to get more rows from Sort node than

in

nested seq scan?

The "extra" rows are re-fetches triggered by mark/restore requests from
the parent mergejoin. The EXPLAIN instrumentation counts re-fetches as
if they were new rows.

aha,

Thank you for explain

Regards

Pavel

Show quoted text

regards, tom lane