From 6c0398a73f0a8173996fb0bd638ca6ab7c82e5b6 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 2 Sep 2005 03:19:53 +0000 Subject: [PATCH] Add some notes about how pg_dump relates to the practices recommended under 'Populating a Database'. --- doc/src/sgml/perform.sgml | 50 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/doc/src/sgml/perform.sgml b/doc/src/sgml/perform.sgml index 458272a2e8..a965c9641b 100644 --- a/doc/src/sgml/perform.sgml +++ b/doc/src/sgml/perform.sgml @@ -1,5 +1,5 @@ @@ -878,6 +878,54 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse; statistics. + + + Some Notes About <application>pg_dump</> + + + Dump scripts generated by pg_dump automatically apply + several, but not all, of the above guidelines. To reload a + pg_dump dump as quickly as possible, you need to + do a few extra things manually. (Note that these points apply while + restoring a dump, not while creating it. + The same points apply when using pg_restore to load + from a pg_dump archive file.) + + + + By default, pg_dump uses COPY, and when + it is generating a complete schema-and-data dump, it is careful to + load data before creating indexes and foreign keys. So in this case + the first several guidelines are handled automatically. What is left + for you to do is to set appropriate (i.e., larger than normal) values + for maintenance_work_mem and + checkpoint_segments before loading the dump script, + and then to run ANALYZE afterwards. + + + + A data-only dump will still use COPY, but it does not + drop or recreate indexes, and it does not normally touch foreign + keys. + + + + You can get the effect of disabling foreign keys by using + the + + + So when loading a data-only dump, it is up to you to drop and recreate + indexes and foreign keys if you wish to use those techniques. + It's still useful to increase checkpoint_segments + while loading the data, but don't bother increasing + maintenance_work_mem; rather, you'd do that while + manually recreating indexes and foreign keys afterwards. + And don't forget to ANALYZE when you're done. + + -- 2.39.5