Re: Query Planner not taking advantage of HASH PARTITION

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Benjamin Tingle <ben(at)tingle(dot)org>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Query Planner not taking advantage of HASH PARTITION
Date: 2022-04-17 18:50:14
Message-ID: 202204171850.iqpjc2mmr47y@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 2022-Apr-14, Benjamin Tingle wrote:

> It doesn't help if I partition temp_data by textfield beforehand either
> (using the same scheme as the target table). It still opts to concatenate
> all of temp_data, hash it, then perform a sequential scan against the
> target partitions.

Does it still do that if you set
SET enable_partitionwise_join TO on;
? If the partition strategies are identical, that might get you a
better plan. (Actually, in pg13 and upwards the strategies don't need
to be exactly identical, just "compatible".)

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end." (2nd Commandment for C programmers)

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Goti 2022-04-18 14:02:49 How to find the final transformed query in postgresql
Previous Message Tom Lane 2022-04-17 18:20:24 Re: Query Planner not taking advantage of HASH PARTITION