|
1 | 1 | <!--
|
2 |
| -$PostgreSQL: pgsql/doc/src/sgml/ref/create_index.sgml,v 1.66 2007/11/26 21:36:33 petere Exp $ |
| 2 | +$PostgreSQL: pgsql/doc/src/sgml/ref/create_index.sgml,v 1.67 2008/03/16 23:57:51 tgl Exp $ |
3 | 3 | PostgreSQL documentation
|
4 | 4 | -->
|
5 | 5 |
|
@@ -32,7 +32,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] <replaceable class="parameter">name</re
|
32 | 32 | <title>Description</title>
|
33 | 33 |
|
34 | 34 | <para>
|
35 |
| - <command>CREATE INDEX</command> constructs an index <replaceable |
| 35 | + <command>CREATE INDEX</command> constructs an index named <replaceable |
36 | 36 | class="parameter">name</replaceable> on the specified table.
|
37 | 37 | Indexes are primarily used to enhance database performance (though
|
38 | 38 | inappropriate use can result in slower performance).
|
@@ -433,6 +433,23 @@ Indexes:
|
433 | 433 | sort high</>, in queries that depend on indexes to avoid sorting steps.
|
434 | 434 | </para>
|
435 | 435 |
|
| 436 | + <para> |
| 437 | + For most index methods, the speed of creating an index is |
| 438 | + dependent on the setting of <xref linkend="guc-maintenance-work-mem">. |
| 439 | + Larger values will reduce the time needed for index creation, so long |
| 440 | + as you don't make it larger than the amount of memory really available, |
| 441 | + which would drive the machine into swapping. For hash indexes, the |
| 442 | + value of <xref linkend="guc-effective-cache-size"> is also relevant to |
| 443 | + index creation time: <productname>PostgreSQL</productname> will use one |
| 444 | + of two different hash index creation methods depending on whether the |
| 445 | + estimated index size is more or less than <varname>effective_cache_size</>. |
| 446 | + For best results, make sure that this parameter is also set to something |
| 447 | + reflective of available memory, and be careful that the sum of |
| 448 | + <varname>maintenance_work_mem</> and <varname>effective_cache_size</> is |
| 449 | + less than the machine's RAM less whatever space is needed by other |
| 450 | + programs. |
| 451 | + </para> |
| 452 | + |
436 | 453 | <para>
|
437 | 454 | Use <xref linkend="sql-dropindex" endterm="sql-dropindex-title">
|
438 | 455 | to remove an index.
|
|
0 commit comments