Re: pgbench - allow to create partitioned tables

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Asif Rehman <asifr(dot)rehman(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgbench - allow to create partitioned tables
Date: 2019-09-24 13:29:42
Message-ID: alpine.DEB.2.21.1909240813280.5923@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Amit,

> {...]
> If you agree with this, then why haven't you changed below check in patch:
>
> + if (partition_method != PART_NONE)
> + printf("partition method: %s\npartitions: %d\n",
> + PARTITION_METHOD[partition_method], partitions);
>
> This is exactly the thing bothering me. It won't be easy for others
> to understand why this check for partitioning information is different
> from other checks.

As I tried to explain with an example, using "partitions > 0" does not
work in this case because you can have a partitioned table with zero
partitions attached while benchmarking, but this cannot happen while
creating.

> For you or me, it might be okay as we have discussed this case, but it
> won't be apparent to others. This doesn't buy us much, so it is better
> to keep this code consistent with other places that check for
> partitions.

Attached uses "partition_method != PART_NONE" consistently, plus an assert
on "partitions > 0" for checking and for triggering the default method at
the end of option processing.

--
Fabien.

Attachment Content-Type Size
pgbench-init-partitioned-16.patch text/x-diff 14.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nikolay Shaplov 2019-09-24 13:49:11 Re: [PATCH] src/test/modules/dummy_index -- way to test reloptions from inside of access method
Previous Message Alexey Kondratov 2019-09-24 13:02:39 Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly