Re: Add table access method as an option to pgbench

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема Re: Add table access method as an option to pgbench
Дата
Msg-id 20201227173943.GA26311@telsasoft.com
обсуждение исходный текст
Ответ на Re: Add table access method as an option to pgbench  (Fabien COELHO <coelho@cri.ensmp.fr>)
Ответы Re: Add table access method as an option to pgbench  (David Zhang <david.zhang@highgo.ca>)
Список 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 по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Proposed patch for key managment
Следующее
От: Zhihong Yu
Дата:
Сообщение: Re: range_agg