Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozfMl-0001Jg-W2 for pgsql-admin@arkaria.postgresql.org; Mon, 28 Nov 2022 14:44:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ozfMk-0000qy-Mb for pgsql-admin@arkaria.postgresql.org; Mon, 28 Nov 2022 14:44:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozfMk-0000qp-C3 for pgsql-admin@lists.postgresql.org; Mon, 28 Nov 2022 14:44:14 +0000 Received: from mailout.easymail.ca ([64.68.200.34]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozfMi-0008NT-1h for pgsql-admin@lists.postgresql.org; Mon, 28 Nov 2022 14:44:13 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 5334CE6FBA for ; Mon, 28 Nov 2022 14:44:11 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at emo08-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo08-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Op8XojJK-6q1 for ; Mon, 28 Nov 2022 14:44:11 +0000 (UTC) Received: from smtpclient.apple (unknown [165.140.184.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 09D52E6FA7 for ; Mon, 28 Nov 2022 14:44:10 +0000 (UTC) From: Scott Ribe Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.200.110.1.12\)) Subject: Re: regression in PG 15.1 Date: Mon, 28 Nov 2022 07:44:00 -0700 References: To: Pgsql-admin In-Reply-To: Message-Id: <31E8683D-121B-4428-823A-A626BCBC54CB@elevated-dev.com> X-Mailer: Apple Mail (2.3731.200.110.1.12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I should have noted that vacuum analyze on parent table did not help. > On Nov 28, 2022, at 7:41 AM, Scott Ribe = wrote: >=20 > Table is partitioned on a column tbl_id, with an increasing = "transaction id". >=20 > select * from tbl where txid > something and tbl_id =3D someval; >=20 > ^^^ works as normal, searches the single partition, taking 0.044ms >=20 > select * from tbl where txid > something and tbl_id =3D (select id = from reftbl where name =3D 'someval'); >=20 > ^^^ fails to exclude partitions, kicks off parallel scans on all 142, = takes 23,170ms >=20 > Queries in question are NOT auto-generated from some ORM, so there is = an obvious easy workaround. Before trying that, and before digging into = full table defs here, does anyone have an idea how to nudge the planner = toward excluding the partitions. >=20 > -- > Scott Ribe > scott_ribe@elevated-dev.com > https://www.linkedin.com/in/scottribe/ >=20 >=20 >=20 >=20 >=20