pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Benjamin Tingle <ben@tingle.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: Query Planner not taking advantage of HASH PARTITION
Date: Sun, 17 Apr 2022 20:50:14 +0200
Message-ID: <202204171850.iqpjc2mmr47y@alvherre.pgsql> (raw)
In-Reply-To: <CABTcpyvoSYrn-2S4p8hRwAsCe3PkOUS4dFxmr6gUy4x9u5PDKA@mail.gmail.com>

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)





view thread (7+ messages)  latest in thread

Message-ID: <202204171850.iqpjc2mmr47y@alvherre.pgsql>
Permalink:  ../202204171850.iqpjc2mmr47y@alvherre.pgsql/
Also on:    postgresql.org/message-id/202204171850.iqpjc2mmr47y@alvherre.pgsql

 · 

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: pgsql-performance@postgresql.org
  Cc: alvherre@alvh.no-ip.org, ben@tingle.org
  Subject: Re: Query Planner not taking advantage of HASH PARTITION
  In-Reply-To: <202204171850.iqpjc2mmr47y@alvherre.pgsql>

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

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