pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-committers@postgresql.org
Subject: Re: pgsql: Adapt python regression tests to 69f4b9c85f16.
Date: Wed, 18 Jan 2017 20:49:27 -0500
Message-ID: <21830.1484790567@sss.pgh.pa.us> (raw)
In-Reply-To: <20170119003933.vkgng32dfw56gw3m@alap3.anarazel.de>
References: <E1cU0KI-0002Nx-FA@gemulon.postgresql.org>
	<18876.1484786092@sss.pgh.pa.us>
	<20170119003933.vkgng32dfw56gw3m@alap3.anarazel.de>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Andres Freund <andres@anarazel.de> writes:
> Termite is also failing due to differing row orders from the rest of the
> animals. I'd intentionally left those undefined, because I wanted some
> queries without an ORDER BY.  Haven't decided what the best fix is yet.

Looks to me like all the bigendian critters are unhappy with that.
The previous plan (trying it on 9.6) was

 GroupAggregate  (cost=20.68..22.77 rows=400 width=52)
   Group Key: dataa, (unnest('{1,1,3}'::integer[]))
   ->  Sort  (cost=20.68..20.69 rows=4 width=40)
         Sort Key: dataa, (unnest('{1,1,3}'::integer[]))
         ->  Seq Scan on few  (cost=0.00..20.64 rows=4 width=40)
               Filter: (id = 1)

and now we get

 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)

This is a good thing: it's coming up with a saner rowcount estimate,
ie it realizes that the sort or hash is going to see a number of rows
inflated by the SRF, and that's prompting it to go with a hashagg not
a sortagg.  But then you get platform-dependent output order from
the hashagg.

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.

			regards, tom lane


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



view thread (6+ messages)  latest in thread

Message-ID: <21830.1484790567@sss.pgh.pa.us>
Permalink:  ../21830.1484790567@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21830.1484790567@sss.pgh.pa.us

 · 

reply

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-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de
  Subject: Re: pgsql: Adapt python regression tests to 69f4b9c85f16.
  In-Reply-To: <21830.1484790567@sss.pgh.pa.us>
  References: <E1cU0KI-0002Nx-FA@gemulon.postgresql.org> <18876.1484786092@sss.pgh.pa.us> <20170119003933.vkgng32dfw56gw3m@alap3.anarazel.de> <21830.1484790567@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