wide table, many many partitions, poor query performance

From: S Bob <sbob(at)quadratum-braccas(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: wide table, many many partitions, poor query performance
Date: 2021-03-15 16:53:06
Message-ID: 6fc233c8-eba9-b042-5578-525270724bec@quadratum-braccas.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

All;

We have a client that is running PostgreSQL 12, they have a table with
212 columns and 723 partitions

It seems the planning time is consumed by generating 723 sub plans

I suspect it's due to the fact that they are using hash based
partitioning, example:

CREATE TABLE rental_transaction_hash_p723 PARTITION OF
rental_transaction FOR VALUES WITH (MODULUS 723, REMAINDER 723);

Based on a strategy like this, queries will ALWAYS scan all partitions
unless a hash value is specified as part of the query, correct? I
suspect this is the issue... looking for confirmation, or feedback if
i'm off base

Thanks in advance

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Justin Pryzby 2021-03-15 17:03:35 Re: wide table, many many partitions, poor query performance
Previous Message Luca Ferrari 2021-03-15 13:35:49 Re: FreeBSD UFS & fsync