Skip site navigation (1) Skip section navigation (2)

Re: Set maintenance work mem for pg_restore

From: Deron <fecastle(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Set maintenance work mem for pg_restore
Date: 2007-12-18 22:40:43
Message-ID: ad143ba80712181440v2a922ef6ibbe52aa1cc8e153@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-admin
Thanks for this and the other suggestions.  This is exactly what I was
looking for.

Deron



On 12/18/07, Alvaro Herrera <alvherre(at)commandprompt(dot)com> wrote:
>
> 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
>

In response to

pgsql-admin by date

Next:From: Scott MarloweDate: 2007-12-18 22:46:29
Subject: Re: How to uses self query plan
Previous:From: olivier.boissard@cerene.frDate: 2007-12-18 22:21:15
Subject: How to uses self query plan

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group