From: Scott Ribe <scott_ribe@elevated-dev.com>
To: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: regression in PG 15.1
Date: Mon, 28 Nov 2022 07:44:00 -0700
Message-ID: <31E8683D-121B-4428-823A-A626BCBC54CB@elevated-dev.com> (raw)
In-Reply-To: <D86D21A2-20CB-4E28-AF0A-8C2C0139DA97@elevated-dev.com>
References: <D86D21A2-20CB-4E28-AF0A-8C2C0139DA97@elevated-dev.com>
I should have noted that vacuum analyze on parent table did not help.
> On Nov 28, 2022, at 7:41 AM, Scott Ribe <scott_ribe@elevated-dev.com> wrote:
>
> Table is partitioned on a column tbl_id, with an increasing "transaction id".
>
> select * from tbl where txid > something and tbl_id = someval;
>
> ^^^ works as normal, searches the single partition, taking 0.044ms
>
> select * from tbl where txid > something and tbl_id = (select id from reftbl where name = 'someval');
>
> ^^^ fails to exclude partitions, kicks off parallel scans on all 142, takes 23,170ms
>
> 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.
>
> --
> Scott Ribe
> scott_ribe@elevated-dev.com
> https://www.linkedin.com/in/scottribe/
>
>
>
>
>
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: scott_ribe@elevated-dev.com, pgsql-admin@lists.postgresql.org
Subject: Re: regression in PG 15.1
In-Reply-To: <31E8683D-121B-4428-823A-A626BCBC54CB@elevated-dev.com>
* 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