Re: pgbench with partitioned tables

From: Sami Imseih <samimseih(at)gmail(dot)com>
To: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Melanie Plageman <melanieplageman(at)gmail(dot)com>, Sergey Tatarintsev <s(dot)tatarintsev(at)postgrespro(dot)ru>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgbench with partitioned tables
Date: 2025-02-03 02:58:14
Message-ID: CAA5RZ0sP4X=D484AmQ9V0wBtAVnwUTcyC8okSBjhiqwLd=ov5w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I was looking at the comments [1] for why COPY FREEZE is
not allowed on a parent table, and it was mainly due
to having to open up partitions to check if they are able
to take the optimization (table created or truncated in the
current transaction ). Obviously as the number of
partitions grow, it will take more to perform these
checks. My suspicious is that in the cases in which partitions
are used, the benefits of COPY FREEZE could outweigh
the overhead of these additional checks.

So while we could try to solve the COPY FREEZE issue
specifically for pgbench, I wonder if we should try to do better
and see if the limitation on a parent partition can be removed.

I can provide a patch and some benchmark numbers unless
there is something bigger I am missing about the reason this
limitation exists?

[1] https://github.com/postgres/postgres/blob/master/src/backend/commands/copyfrom.c#L727-L735

Regards,

Sami

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michel Pelletier 2025-02-03 03:02:16 Re: Using Expanded Objects other than Arrays from plpgsql
Previous Message jian he 2025-02-03 02:45:43 Re: Proposal to Enable/Disable Index using ALTER INDEX (with patch)