Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cU1rJ-0006FP-IA for pgsql-committers@arkaria.postgresql.org; Thu, 19 Jan 2017 01:49:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cU1rI-0004lh-GM for pgsql-committers@arkaria.postgresql.org; Thu, 19 Jan 2017 01:49:48 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cU1r4-0004Wz-TS for pgsql-committers@postgresql.org; Thu, 19 Jan 2017 01:49:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cU1r0-0005dE-2F for pgsql-committers@postgresql.org; Thu, 19 Jan 2017 01:49:33 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v0J1nRBL021831; Wed, 18 Jan 2017 20:49:27 -0500 From: Tom Lane To: Andres Freund cc: pgsql-committers@postgresql.org Subject: Re: pgsql: Adapt python regression tests to 69f4b9c85f16. In-reply-to: <20170119003933.vkgng32dfw56gw3m@alap3.anarazel.de> References: <18876.1484786092@sss.pgh.pa.us> <20170119003933.vkgng32dfw56gw3m@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Wed, 18 Jan 2017 16:39:33 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21829.1484790567.1@sss.pgh.pa.us> Date: Wed, 18 Jan 2017 20:49:27 -0500 Message-ID: <21830.1484790567@sss.pgh.pa.us> X-Pg-Spam-Score: -5.1 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org Andres Freund 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