Plan weirdness. A sort produces more rows than the node beneath it

From: Dane Foster <studdugie(at)gmail(dot)com>
To: psql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Plan weirdness. A sort produces more rows than the node beneath it
Date: 2023-08-04 14:59:19
Message-ID: CA+WxinKHxRUgDwbUfsKNiq5MXn8kRFayo0KqZzTmxXG93BbK4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hello,

I'm trying to understand a bit of weirdness in a plan output. There is a
sort node above a sequential scan node where the scan node produces 26,026
rows yet the sort node above it produces 42,995,408. How is it possible to
sort more data than you received?

https://explain.dalibo.com/plan/1ee665h69f92chc5

The PostgreSQL version is 14.2 running on Amazon's RDS. Thanks.

Dane

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Jeff Janes 2023-08-04 15:07:19 Re: Plan weirdness. A sort produces more rows than the node beneath it
Previous Message Laurenz Albe 2023-07-31 06:30:39 Re: Table copy with SERIALIZABLE is incredibly slow