Re: Add table access method as an option to pgbench

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: David Zhang <david(dot)zhang(at)highgo(dot)ca>, Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add table access method as an option to pgbench
Date: 2020-12-27 17:39:43
Message-ID: 20201227173943.GA26311@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Dec 27, 2020 at 09:14:53AM -0400, Fabien COELHO wrote:
> > src/test/regress/sql/create_am.sql:CREATE ACCESS METHOD heap2 TYPE TABLE HANDLER heap_tableam_handler;
> > ...
> > src/test/regress/sql/create_am.sql:DROP ACCESS METHOD heap2;
>
> > Or maybe using SET default_tablespace instead of modifying the CREATE sql.
> > That'd need to be done separately for indexes, and RESET after creating the
> > tables, to avoid accidentally affecting indexes, too.
>
> Why should it not affect indexes?

I rarely use pgbench, and probably never looked at its source before, but I saw
that it has a separate --tablespace and --index-tablespace, and that
--tablespace is *not* the default for indexes.

So if we changed it to use SET default_tablespace instead of amending the DDL
sql, we'd need to make sure the SET applied only to the intended CREATE
command, and not all following create commands. In the case that
--index-tablespace is not specified, it would be buggy to do this:

SET default_tablespace=foo;
CREATE TABLE ...
CREATE INDEX ...
CREATE TABLE ...
CREATE INDEX ...
...

--
Justin

PS. Thanks for patching it to work with partitioned tables :)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2020-12-27 17:44:50 Re: pgsql: Add pg_alterckey utility to change the cluster key
Previous Message Bruce Momjian 2020-12-27 17:25:26 Re: Proposed patch for key managment