pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: aditya desai <admad123@gmail.com>
To: Pgsql Performance <pgsql-performance@lists.postgresql.org>
Subject: Re: Query going to all paritions
Date: Fri, 01 Oct 2021 09:53:03 +0200
Message-ID: <9b0fc158ae0701e0e3cbd03d7f022735dc4e3f24.camel@cybertec.at> (raw)
In-Reply-To: <CAN0SRDFTummB0w5L_ijZq+ufZx8s6+Wdm96SEwqkQZYeUjpf=w@mail.gmail.com>
References: <CAN0SRDFTummB0w5L_ijZq+ufZx8s6+Wdm96SEwqkQZYeUjpf=w@mail.gmail.com>

On Fri, 2021-10-01 at 12:58 +0530, aditya desai wrote:
> Hi,
> Query on  one of our partitioned tables which is range partitioned on "run"date" column is going to all partitions despite having run_date in WHERE clause. "enable_parition_pruning" is also on. I am
> unable to generate a query plan as the query never runs fully even waiting for say half an hour.
> 
> We have composite indexes on run_date,status. Do I need to create an index on run_date only?

You need to share the query and probably the table definition.  EXPLAIN output
(without ANALYZE) will also help.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






view thread (5+ messages)  latest in thread

Message-ID: <9b0fc158ae0701e0e3cbd03d7f022735dc4e3f24.camel@cybertec.at>
Permalink:  ../9b0fc158ae0701e0e3cbd03d7f022735dc4e3f24.camel@cybertec.at/
Also on:    postgresql.org/message-id/9b0fc158ae0701e0e3cbd03d7f022735dc4e3f24.camel@cybertec.at

 · 

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-performance@postgresql.org
  Cc: laurenz.albe@cybertec.at, admad123@gmail.com, pgsql-performance@lists.postgresql.org
  Subject: Re: Query going to all paritions
  In-Reply-To: <9b0fc158ae0701e0e3cbd03d7f022735dc4e3f24.camel@cybertec.at>

* 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