Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitff21323

Browse files
committed
Add a note to the CREATE INDEX reference page about the impact of
maintenance_work_mem and effective_cache_size on index creation speed.
1 parent787eba7 commitff21323

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

‎doc/src/sgml/ref/create_index.sgml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
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 $
33
PostgreSQL documentation
44
-->
55

@@ -32,7 +32,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] <replaceable class="parameter">name</re
3232
<title>Description</title>
3333

3434
<para>
35-
<command>CREATE INDEX</command> constructs an index <replaceable
35+
<command>CREATE INDEX</command> constructs an indexnamed<replaceable
3636
class="parameter">name</replaceable> on the specified table.
3737
Indexes are primarily used to enhance database performance (though
3838
inappropriate use can result in slower performance).
@@ -433,6 +433,23 @@ Indexes:
433433
sort high</>, in queries that depend on indexes to avoid sorting steps.
434434
</para>
435435

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+
436453
<para>
437454
Use <xref linkend="sql-dropindex" endterm="sql-dropindex-title">
438455
to remove an index.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp