Re: Set maintenance work mem for pg_restore

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Set maintenance work mem for pg_restore
Дата
Msg-id 20071218204957.GE8088@alvh.no-ip.org
обсуждение исходный текст
Ответ на Set maintenance work mem for pg_restore  (Deron <fecastle@gmail.com>)
Ответы Re: Set maintenance work mem for pg_restore  (Deron <fecastle@gmail.com>)
Список pgsql-admin
Deron escribió:
> I see a lot of suggestions to increase maintenance work mem if running
> pg_restore.  This is to help with the index creation and initial sort from
> what I understand.  A few tests I ran does show this helps.
> Does anyone know if there is a way to only "temporarily" set this setting?
> I have some DBs that are bloated and I have a script to run off hours (I
> don't like working late).  This uses pg_dump and pg_restore to recover the
> disk space.  I found that this is usually faster than 'vacuum full', and is
> useful in some cases.

You can specify it via PGOPTIONS:

$ PGOPTIONS='-c maintenance_work_mem=1GB' psql
Welcome to psql 8.2.5, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

alvherre=# show maintenance_work_mem ;
 maintenance_work_mem
----------------------
 1GB
(1 row)

alvherre=# \q

$ psql
Welcome to psql 8.2.5, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

alvherre=# show maintenance_work_mem ;
 maintenance_work_mem
----------------------
 16MB
(1 row)



--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

В списке pgsql-admin по дате отправления:

Предыдущее
От: Deron
Дата:
Сообщение: Set maintenance work mem for pg_restore
Следующее
От: "Scott Marlowe"
Дата:
Сообщение: Re: Set maintenance work mem for pg_restore