Re: Add table access method as an option to pgbench - Mailing list pgsql-hackers

From Justin Pryzby
Subject Re: Add table access method as an option to pgbench
Date
Msg-id 20201227173943.GA26311@telsasoft.com
Whole thread Raw
In response to Re: Add table access method as an option to pgbench  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: Add table access method as an option to pgbench
List 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 :)



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Proposed patch for key managment
Next
From: Zhihong Yu
Date:
Subject: Re: range_agg