Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cU2Aq-0007JH-4E for pgsql-committers@arkaria.postgresql.org; Thu, 19 Jan 2017 02:10:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cU2Ap-0005qN-NK for pgsql-committers@arkaria.postgresql.org; Thu, 19 Jan 2017 02:09:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cU2Ap-0005pz-6I for pgsql-committers@postgresql.org; Thu, 19 Jan 2017 02:09:59 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cU2Al-0006ru-V3 for pgsql-committers@postgresql.org; Thu, 19 Jan 2017 02:09:58 +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 v0J29qPx022892; Wed, 18 Jan 2017 21:09:52 -0500 From: Tom Lane To: Andres Freund cc: pgsql-committers@postgresql.org Subject: Re: pgsql: Adapt python regression tests to 69f4b9c85f16. In-reply-to: <21830.1484790567@sss.pgh.pa.us> References: <18876.1484786092@sss.pgh.pa.us> <20170119003933.vkgng32dfw56gw3m@alap3.anarazel.de> <21830.1484790567@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 18 Jan 2017 20:49:27 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <22890.1484791792.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 18 Jan 2017 21:09:52 -0500 Message-ID: <22891.1484791792@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 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=3D# explain SELECT few.dataa, count(*), min(id), max(id), unnest= ('{1,1,3}'::int[]) FROM few WHERE few.id =3D 1 GROUP BY few.dataa, unnest('= {1,1,3}'::int[]) order by few.dataa, unnest('{1,1,3}'::int[]); QUERY PLAN=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ----------------------------------------------------------------------- Sort (cost=3D27.75..27.76 rows=3D4 width=3D52) Sort Key: dataa, (unnest('{1,1,3}'::integer[])) -> HashAggregate (cost=3D27.66..27.71 rows=3D4 width=3D52) Group Key: dataa, unnest('{1,1,3}'::integer[]) -> ProjectSet (cost=3D0.00..22.66 rows=3D400 width=3D40) -> Seq Scan on few (cost=3D0.00..20.62 rows=3D4 width=3D36) Filter: (id =3D 1) (7 rows) regression=3D# set enable_hashagg TO 0; SET regression=3D# explain SELECT few.dataa, count(*), min(id), max(id), unnest= ('{1,1,3}'::int[]) FROM few WHERE few.id =3D 1 GROUP BY few.dataa, unnest('= {1,1,3}'::int[]); QUERY PLAN=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ----------------------------------------------------------------------- GroupAggregate (cost=3D39.94..45.99 rows=3D4 width=3D52) Group Key: dataa, (unnest('{1,1,3}'::integer[])) -> Sort (cost=3D39.94..40.94 rows=3D400 width=3D40) Sort Key: dataa, (unnest('{1,1,3}'::integer[])) -> ProjectSet (cost=3D0.00..22.66 rows=3D400 width=3D40) -> Seq Scan on few (cost=3D0.00..20.62 rows=3D4 width=3D36) Filter: (id =3D 1) (7 rows) So which plan would you rather test? regards, tom lane --=20 Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers