public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michał Kłeczek <[email protected]>
To: PG-General Mailing List <[email protected]>
Subject: Partitionwise aggregate and runtime partition pruning
Date: Thu, 26 Sep 2024 09:58:18 +0200
Message-ID: <[email protected]> (raw)

Hi All,

I have a question about partition pruning.

Does runtime partition pruning (ie. pruning performed during execution) work with partition wise aggregates?

1) I have a setup with a mix of foreign (postgres_fdw) and local partitions.
2) I want to perform an aggregate query and I want the aggregates to be pushed down to remote servers.

To make it possible I set enable_partitionwise_aggregate to on.

My observation is that partition pruning works during planning time
But with plan_cache_mode = force_generic_plan, explain analyse execute prepared_stmt(params) shows that
_all_ partitions are scanned (and queries sent to remote severs for all remote partitions).

When I set enable_hashagg to false runtime partition pruning works but no pushdown is taking place.

Am I missing something or runtime partition pruning is not going to work for generic plans and partitionwise aggregates?

Thanks,
Michal







reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: Partitionwise aggregate and runtime partition pruning
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox