Re: Query going to all paritions - Mailing list pgsql-performance

From Laurenz Albe
Subject Re: Query going to all paritions
Date
Msg-id 9b0fc158ae0701e0e3cbd03d7f022735dc4e3f24.camel@cybertec.at
Whole thread Raw
In response to Query going to all paritions  (aditya desai <admad123@gmail.com>)
Responses Re: Query going to all paritions  (aditya desai <admad123@gmail.com>)
List pgsql-performance
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 despitehaving 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




pgsql-performance by date:

Previous
From: aditya desai
Date:
Subject: Query going to all paritions
Next
From: aditya desai
Date:
Subject: Re: Query going to all paritions