[PATCH] Make skipped sort explicit in EXPLAIN ANALYZE

Marti Raudsepp <marti@juffo.org>

From: Marti Raudsepp <marti@juffo.org>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2012-05-25T13:30:01Z
Lists: pgsql-hackers

Attachments

Hi,

This is just a small clarity improvement. tuplesort_performsort()
skips sorting entirely when the result set has 0 or 1 tuples, but
EXPLAIN still says it's using "quicksort". The patch changes that to
"skipped"

For example:

db=# explain analyze select * from now() order by 1;
 Sort  (cost=0.02..0.03 rows=1 width=8) (actual time=0.126..0.126
rows=1 loops=1)
   Sort Key: now
   Sort Method: skipped  Memory: 25kB
   ->  Function Scan on now  (cost=0.00..0.01 rows=1 width=8) (actual
time=0.032..0.033 rows=1 loops=1)

Patch attached.

Regards,
Marti