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

pg_dump additional options for performance

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: pg_dump additional options for performance
Date: 2008-02-06 15:13:24
Message-ID: 1202310804.29242.54.camel@ebony.site (view raw or flat)
Thread:
Lists: pgsql-hackers
pg_dump allows you to specify -s --schema-only, or -a --data-only.

The -s option creates the table, as well as creating constraints and
indexes. These objects need to be dropped prior to loading, if we are to
follow the performance recommendations in the docs. But the only way to
do that is to manually edit the script to produce a cut down script.

So it would be good if we could dump objects in 3 groups
1. all commands required to re-create table
2. data
3. all commands required to complete table after data load

My proposal is to provide two additional modes:
--schema-pre-load corresponding to (1) above
--schema-post-load corresponding to (3) above

This would then allow this sequence of commands 

pg_dump --schema-pre-load
pg_dump --data-only
pg_dump --schema-post-load

to be logically equivalent, but faster than

pg_dump --schema-only
pg_dump --data-only

both forms of which are equivalent to just

pg_dump


[Assuming data isn't changing between invocations...]

-- 
  Simon Riggs
  2ndQuadrant  http://www.2ndQuadrant.com 


Responses

pgsql-hackers by date

Next:From: Magnus HaganderDate: 2008-02-06 15:13:42
Subject: Re: [BUGS] BUG #3909: src\tools\msvc\clean.bat clears parse.h file
Previous:From: Gregory StarkDate: 2008-02-06 14:56:16
Subject: Re: Why are we waiting?

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