Re: regression in PG 15.1

From: Scott Ribe <scott_ribe(at)elevated-dev(dot)com>
To: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: regression in PG 15.1
Date: 2022-11-28 14:44:00
Message-ID: 31E8683D-121B-4428-823A-A626BCBC54CB@elevated-dev.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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(at)elevated-dev(dot)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(at)elevated-dev(dot)com
> https://www.linkedin.com/in/scottribe/
>
>
>
>
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2022-11-28 14:44:50 Re: regression in PG 15.1
Previous Message Scott Ribe 2022-11-28 14:41:24 regression in PG 15.1