pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Ribe <scott_ribe@elevated-dev.com>
To: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: regression in PG 15.1
Date: Mon, 28 Nov 2022 07:41:24 -0700
Message-ID: <D86D21A2-20CB-4E28-AF0A-8C2C0139DA97@elevated-dev.com> (raw)

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/








view thread (8+ messages)  latest in thread

Message-ID: <D86D21A2-20CB-4E28-AF0A-8C2C0139DA97@elevated-dev.com>
Permalink:  ../D86D21A2-20CB-4E28-AF0A-8C2C0139DA97@elevated-dev.com/
Also on:    postgresql.org/message-id/D86D21A2-20CB-4E28-AF0A-8C2C0139DA97@elevated-dev.com

 · 

reply

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: <D86D21A2-20CB-4E28-AF0A-8C2C0139DA97@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