Re: Number of rows returned by Sort node

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vitaliy Garnashevich <vgarnashevich(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Number of rows returned by Sort node
Date: 2018-01-09 15:23:30
Message-ID: 28041.1515511410@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Vitaliy Garnashevich <vgarnashevich(at)gmail(dot)com> writes:
> How, according to EXPLAIN ANALYZE, the Sort node could return more rows
> as output (rows=767662), than it had for input from its child node
> (rows=135627)?

Unsurprising when it's the inner input of a merge join --- that reflects
the merge join rescanning parts of the inner input. It has to do that
whenever the outer input has duplicate keys.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2018-01-09 16:13:59 Re: Getting started with first user.
Previous Message Vitaliy Garnashevich 2018-01-09 15:20:23 Number of rows returned by Sort node