Re: issue partition scan - Mailing list pgsql-performance

From Christophe Pettus
Subject Re: issue partition scan
Date
Msg-id 566EF81B-F9B2-4CD2-900E-5163732770FF@thebuild.com
Whole thread Raw
In response to Re: issue partition scan  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-performance

> On May 25, 2021, at 17:16, David Rowley <dgrowleyml@gmail.com> wrote:
>
> It's because of the OR condition.  If it was an AND condition then the
> planner wouldn't have to consider the fact that records in other
> partitions might be required for the join.

The OP might consider rewriting the query as a UNION, with each part of the top-lkevel OR being a branch of the UNION,
butexcluding the partitioned table from the JOINs for the branch of the UNION that doesn't appear to actually require
them.


pgsql-performance by date:

Previous
From: David Rowley
Date:
Subject: Re: issue partition scan
Next
From: Eugen Konkov
Date:
Subject: Count (select 1) subquery as constant