pg_dump and cluster

Started by Angvaover 19 years ago3 messagesgeneral
Jump to latest
#1Angva
angvaw@gmail.com

Hello,

I have a question regarding pg_dump and table clustering. Each night a
job runs that basically does the following:

1) load large amounts of data from flat files into a schema
2) cluster the data
3) pg_dump that schema
4) copy the resulting dmp to several destination databases
5) pg_restore the dmp on the destinations

Can anyone tell me if the restored data will remain clustered? That is,
does the dmp contain the data in clustered order, and if so, does
pg_restore preserve this order? I would like to know whether there
should be a step 6) cluster the data on the destinations, or if it
would just be a waste of time. (I need the whole job to run as quickly
as possible.)

Thanks,
Mark

#2Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Angva (#1)
Re: pg_dump and cluster

Angva wrote:

Hello,

I have a question regarding pg_dump and table clustering. Each night a
job runs that basically does the following:

1) load large amounts of data from flat files into a schema
2) cluster the data
3) pg_dump that schema
4) copy the resulting dmp to several destination databases
5) pg_restore the dmp on the destinations

Can anyone tell me if the restored data will remain clustered? That is,
does the dmp contain the data in clustered order, and if so, does
pg_restore preserve this order?

Yes.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

#3Angva
angvaw@gmail.com
In reply to: Angva (#1)
Re: pg_dump and cluster

Thanks Alvaro!