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)