Skip site navigation (1) Skip section navigation (2)

Re: pgsql: Adapt python regression tests to 69f4b9c85f16.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Adapt python regression tests to 69f4b9c85f16.
Date: 2017-01-19 02:09:52
Message-ID: 22891.1484791792@sss.pgh.pa.us (view raw, whole thread or download thread mbox)
Thread:
Lists: pgsql-committers
I wrote:
> If you don't want an ORDER BY, maybe turn off enable_hashagg for
> these queries?  But you'll get the same plan either way.

Or not ... I forgot it has a better model of the rowcount changes now:

regression=# explain SELECT few.dataa, count(*), min(id), max(id), unnest('{1,1,3}'::int[]) FROM few WHERE few.id = 1 GROUP BY few.dataa, unnest('{1,1,3}'::int[]) order by few.dataa, unnest('{1,1,3}'::int[]);
                              QUERY PLAN                               
-----------------------------------------------------------------------
 Sort  (cost=27.75..27.76 rows=4 width=52)
   Sort Key: dataa, (unnest('{1,1,3}'::integer[]))
   ->  HashAggregate  (cost=27.66..27.71 rows=4 width=52)
         Group Key: dataa, unnest('{1,1,3}'::integer[])
         ->  ProjectSet  (cost=0.00..22.66 rows=400 width=40)
               ->  Seq Scan on few  (cost=0.00..20.62 rows=4 width=36)
                     Filter: (id = 1)
(7 rows)
regression=# set enable_hashagg TO 0;
SET
regression=# explain SELECT few.dataa, count(*), min(id), max(id), unnest('{1,1,3}'::int[]) FROM few WHERE few.id = 1 GROUP BY few.dataa, unnest('{1,1,3}'::int[]);
                              QUERY PLAN                               
-----------------------------------------------------------------------
 GroupAggregate  (cost=39.94..45.99 rows=4 width=52)
   Group Key: dataa, (unnest('{1,1,3}'::integer[]))
   ->  Sort  (cost=39.94..40.94 rows=400 width=40)
         Sort Key: dataa, (unnest('{1,1,3}'::integer[]))
         ->  ProjectSet  (cost=0.00..22.66 rows=400 width=40)
               ->  Seq Scan on few  (cost=0.00..20.62 rows=4 width=36)
                     Filter: (id = 1)
(7 rows)

So which plan would you rather test?

			regards, tom lane


In response to

Responses

pgsql-committers by date

Next:From: Amit KapilaDate: 2017-01-19 10:43:44
Subject: Re: pgsql: Add function to import operating system collations
Previous:From: Tom LaneDate: 2017-01-19 01:49:27
Subject: Re: pgsql: Adapt python regression tests to 69f4b9c85f16.

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group