Add a note to the CREATE INDEX reference page about the impact of
authorTom Lane
Sun, 16 Mar 2008 23:57:51 +0000 (23:57 +0000)
committerTom Lane
Sun, 16 Mar 2008 23:57:51 +0000 (23:57 +0000)
maintenance_work_mem and effective_cache_size on index creation speed.

doc/src/sgml/ref/create_index.sgml

index 7686700d78d696990acc142e09fcfa16a3f1e064..32b7bbebd998da9edfbd41dde5fb836a2a2014dc 100644 (file)
@@ -1,5 +1,5 @@
 
 
@@ -32,7 +32,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] name
   Description
 
   
-   CREATE INDEX constructs an index 
+   CREATE INDEX constructs an index named 
    class="parameter">name on the specified table.
    Indexes are primarily used to enhance database performance (though
    inappropriate use can result in slower performance).
@@ -433,6 +433,23 @@ Indexes:
    sort high, in queries that depend on indexes to avoid sorting steps.
   
 
+  
+   For most index methods, the speed of creating an index is
+   dependent on the setting of .
+   Larger values will reduce the time needed for index creation, so long
+   as you don't make it larger than the amount of memory really available,
+   which would drive the machine into swapping.  For hash indexes, the
+   value of  is also relevant to
+   index creation time: PostgreSQL will use one
+   of two different hash index creation methods depending on whether the
+   estimated index size is more or less than effective_cache_size.
+   For best results, make sure that this parameter is also set to something
+   reflective of available memory, and be careful that the sum of
+   maintenance_work_mem and effective_cache_size is
+   less than the machine's RAM less whatever space is needed by other
+   programs.
+  
+
   
    Use 
    to remove an index.