Re: Use case stuck due to Partitioning - Mailing list pgsql-general

From Michael Lewis
Subject Re: Use case stuck due to Partitioning
Date
Msg-id CAHOFxGqB0_5LqkcYFFKDCDU+i1Diu-dzjZ+o4d5J8S-fJRVmwg@mail.gmail.com
Whole thread Raw
In response to Re: Use case stuck due to Partitioning  (Shubham Mittal <mittalshubham30@gmail.com>)
Responses Re: Use case stuck due to Partitioning  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
I am unclear exactly what you want to do with modified_date. Can you write pseudo code perhaps?

It sounds like you are wanting to union all the results of the query you gave, with the results of a similar query where modified_date >= '2021-03-01 08:16:13.589' and created_at < '2021-03-01 08:16:13.589'.

However, if modified date is not null, and is set to the created_date by default, then there seems no reason to check the created_date except if partition pruning at plan time is very important.

Are you experiencing an actual performance problem, are you unsure how to write the query for the data you want, or is this premature optimization?

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: ALTER TABLE ... DETACH PARTITION just sitting there
Next
From: Ron
Date:
Subject: Re: ALTER TABLE ... DETACH PARTITION just sitting there