Re: Sort returns more rows than seq scan?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Sort returns more rows than seq scan?
Date: 2016-03-01 14:45:12
Message-ID: 9409.1456843512@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavel Stehule <pavel(dot)stehule(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2016-03-01 14:45:24 Re: WIP: Upper planner pathification
Previous Message Aleksander Alekseev 2016-03-01 14:43:13 Re: Patch: fix lock contention for HASHHDR.mutex