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