From: Tom Lane <tgl@sss.pgh.pa.us>
To: Vitaliy Garnashevich <vgarnashevich@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Number of rows returned by Sort node
Date: Tue, 09 Jan 2018 10:23:30 -0500
Message-ID: <28041.1515511410@sss.pgh.pa.us> (raw)
In-Reply-To: <6979dc4e-a7d1-993d-f2a4-bcdaff05106d@gmail.com>
References: <6979dc4e-a7d1-993d-f2a4-bcdaff05106d@gmail.com>
Vitaliy Garnashevich <vgarnashevich@gmail.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, vgarnashevich@gmail.com
Subject: Re: Number of rows returned by Sort node
In-Reply-To: <28041.1515511410@sss.pgh.pa.us>
References: <6979dc4e-a7d1-993d-f2a4-bcdaff05106d@gmail.com> <28041.1515511410@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox