Re: pgbench with partitioned tables

From: Sergey Tatarintsev <s(dot)tatarintsev(at)postgrespro(dot)ru>
To: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Melanie Plageman <melanieplageman(at)gmail(dot)com>
Cc: "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 04:37:09
Message-ID: 2d4bd03d-1767-4471-9488-623f7fb7a981@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


02.02.2025 20:45, Álvaro Herrera пишет:
> On 2025-Jan-31, Melanie Plageman wrote:
>
>> Maybe instead of just not using COPY FREEZE on a table if it is
>> partitioned, we could add new data generation init_steps. Perhaps one
>> that is client-side data generation (g) but with no freezing? I'm not
>> really sure what the letter would be (f? making it f, g, and G?).
> I think it makes sense to do what you suggest, but on the other hand,
> the original code that Sergey is patching looks like a hack in the sense
> that it hardcodes which tables to use FREEZE with. There's no point to
> doing things that way actually, so accepting Sergey's patch to replace
> that with a relkind check feels sensible to me.
>
> I think the query should be
> SELECT relkind FROM pg_catalog.pg_class WHERE oid='%s'::pg_catalog.regclass
> if only for consistency with pgbench's other query on catalogs.
>
>
> Your proposal to add different init_steps might be reasonable, at least
> if we allowed partitionedness of tables to vary in other ways (eg. if we
> made pgbench_history partitioned), but I don't think it conflicts with
> Sergey's patch in spirit.

Thanks for the note. I changed the query in the patch (v2 patch attached)

Btw, an additional benefit from the patch is that we can use foreign tables
(for example, to test postgres_fdw optimizations)

--
With best regards,
Sergey Tatarintsev,
PostgresPro

Attachment Content-Type Size
v1-0002-Fix-pgbench-client-side-data-generation-f.patch text/x-patch 2.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2025-02-03 05:04:35 Re: Introduce XID age and inactive timeout based replication slot invalidation
Previous Message Amul Sul 2025-02-03 04:27:18 Re: NOT ENFORCED constraint feature