Re: About PostgreSQL Query Plan - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: About PostgreSQL Query Plan
Date
Msg-id Z4U0gAcTLQ8sX29J@depesz.com
Whole thread Raw
List pgsql-general
On Mon, Jan 13, 2025 at 05:26:09PM +0300, Eşref Halıcıoğlu wrote:
> Hello,
>  
> I have a query in PostgreSQL and I want this query to retrieve only data from the last 3 months. However, when I
examinethe query
 
> plan, I see that all partitions are listed.

Please note that your explain is for update, not select (which
"retrieve" in your mail would suggest).

> This raises a few questions in my mind:
> 
>   • Are all partitions really being accessed, or only the partitions of the last 3 months are being accessed while
theother
 
>     partitions have to be shown in the query plan?

Not really possible to tell without reading explain *analyze*.
Potentially all. But perhaps just fewer.

Best regards,

depesz




pgsql-general by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: pg_repack and locks
Next
From: Adrian Klaver
Date:
Subject: Re: Intermittent errors when fetching cursor rows on PostgreSQL 16