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

Commite48b9b5

Browse files
committed
Minor documentation updates from Simon Riggs.
1 parente505a70 commite48b9b5

File tree

3 files changed

+44
-21
lines changed

3 files changed

+44
-21
lines changed

‎doc/src/sgml/ref/reindex.sgml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/reindex.sgml,v 1.24 2004/10/24 22:52:04 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/reindex.sgml,v 1.25 2004/11/04 19:08:08 tgl Exp $
33
PostgreSQL documentation
44
-->
55

@@ -29,7 +29,7 @@ REINDEX { DATABASE | TABLE | INDEX } <replaceable class="PARAMETER">name</replac
2929

3030
<para>
3131
<command>REINDEX</command> rebuilds an index based on the data
32-
stored in the table, replacing the old copy of the index. There are
32+
stored in theindex'stable, replacing the old copy of the index. There are
3333
two main reasons to use <command>REINDEX</command>:
3434

3535
<itemizedlist>
@@ -98,6 +98,8 @@ REINDEX { DATABASE | TABLE | INDEX } <replaceable class="PARAMETER">name</replac
9898
<para>
9999
The name of the specific database, table, or index to be
100100
reindexed. Table and index names may be schema-qualified.
101+
Presently, <command>REINDEX DATABASE</> can only reindex the current
102+
database, so its parameter must match the current database's name.
101103
</para>
102104
</listitem>
103105
</varlistentry>
@@ -119,13 +121,7 @@ REINDEX { DATABASE | TABLE | INDEX } <replaceable class="PARAMETER">name</replac
119121
<para>
120122
If you suspect corruption of an index on a user table, you can
121123
simply rebuild that index, or all indexes on the table, using
122-
<command>REINDEX INDEX</command> or <command>REINDEX
123-
TABLE</command>. Another approach to dealing with a corrupted
124-
user-table index is just to drop and recreate it. This may in fact
125-
be preferable if you would like to maintain some semblance of
126-
normal operation on the table meanwhile. <command>REINDEX</>
127-
acquires exclusive lock on the table, while <command>CREATE
128-
INDEX</> only locks out writes not reads of the table.
124+
<command>REINDEX INDEX</command> or <command>REINDEX TABLE</command>.
129125
</para>
130126

131127
<para>
@@ -187,6 +183,22 @@ REINDEX { DATABASE | TABLE | INDEX } <replaceable class="PARAMETER">name</replac
187183
a btree</> errors.)
188184
</para>
189185

186+
<para>
187+
<command>REINDEX</command> is similar to a drop and recreate of the index
188+
in that the index contents are rebuilt from scratch. However, the locking
189+
considerations are rather different. <command>REINDEX</> locks out writes
190+
but not reads of the index's parent table. It also takes an exclusive lock
191+
on the specific index being processed, which will block reads that attempt
192+
to use that index. In contrast, <command>DROP INDEX</> momentarily takes
193+
exclusive lock on the parent table, blocking both writes and reads. The
194+
subsequent <command>CREATE INDEX</> locks out writes but not reads; since
195+
the index is not there, no read will attempt to use it, meaning that there
196+
will be no blocking but reads may be forced into expensive sequential
197+
scans. Another important point is that the drop/create approach
198+
invalidates any cached query plans that use the index, while
199+
<command>REINDEX</> does not.
200+
</para>
201+
190202
<para>
191203
Prior to <productname>PostgreSQL</productname> 7.4, <command>REINDEX
192204
TABLE</> did not automatically process TOAST tables, and so those had

‎doc/src/sgml/runtime.sgml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.289 2004/10/17 22:01:49 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.290 2004/11/04 19:08:30 tgl Exp $
33
-->
44

55
<Chapter Id="runtime">
@@ -583,7 +583,7 @@ SET ENABLE_SEQSCAN TO OFF;
583583
<listitem>
584584
<para>
585585
Specifies the main server configuration file
586-
(customarily called <filename>postgresql.conf</>).
586+
(customarily called <filename>postgresql.conf</>).
587587
This option can only be set on the postmaster command line.
588588
</para>
589589
</listitem>
@@ -615,8 +615,8 @@ SET ENABLE_SEQSCAN TO OFF;
615615
<listitem>
616616
<para>
617617
Specifies that the <application>postmaster</> should create an
618-
additional process-id (PID) file for use by server administration
619-
programs.
618+
additional process-id (PID) file for use by server administration
619+
programs.
620620
This option can only be set at server start.
621621
</para>
622622
</listitem>
@@ -1666,9 +1666,20 @@ archive_command = 'copy "%p" /mnt/server/archivedir/"%f"' # Win32
16661666
<listitem>
16671667
<para>
16681668
Sets the planner's assumption about the effective size of the
1669-
disk cache (that is, the portion of the kernel's disk cache
1670-
that will be used for <productname>PostgreSQL</productname>
1671-
data files). This is measured in disk pages, which are
1669+
disk cache that is available to a single index scan. This is
1670+
factored into estimates of the cost of using an index; a higher
1671+
value makes it more likely index scans will be used, a lower
1672+
value makes it more likely sequential scans will be used. When
1673+
setting this parameter you should consider both
1674+
<productname>PostgreSQL</productname>'s shared buffers and the
1675+
portion of the kernel's disk cache that will be used for
1676+
<productname>PostgreSQL</productname> data files. Also, take into
1677+
account the expected number of concurrent queries using different
1678+
indexes, since they will have to share the available space.
1679+
This parameter has no effect on the size of shared memory
1680+
allocated by PostgreSQL, nor does it reserve kernel disk cache;
1681+
it is used only for estimation purposes.
1682+
The value is measured in disk pages, which are
16721683
normally 8192 bytes each. The default is 1000.
16731684
</para>
16741685
</listitem>
@@ -1678,7 +1689,7 @@ archive_command = 'copy "%p" /mnt/server/archivedir/"%f"' # Win32
16781689
<term><varname>random_page_cost</varname> (<type>floating point</type>)</term>
16791690
<listitem>
16801691
<para>
1681-
Sets thequeryplanner's estimate of the cost of a
1692+
Sets the planner's estimate of the cost of a
16821693
nonsequentially fetched disk page. This is measured as a
16831694
multiple of the cost of a sequential page fetch. A higher
16841695
value makes it more likely a sequential scan will be used, a
@@ -1692,7 +1703,7 @@ archive_command = 'copy "%p" /mnt/server/archivedir/"%f"' # Win32
16921703
<term><varname>cpu_tuple_cost</varname> (<type>floating point</type>)</term>
16931704
<listitem>
16941705
<para>
1695-
Sets thequeryplanner's estimate of the cost of processing
1706+
Sets the planner's estimate of the cost of processing
16961707
each row during a query. This is measured as a fraction of
16971708
the cost of a sequential page fetch. The default is 0.01.
16981709
</para>
@@ -1703,7 +1714,7 @@ archive_command = 'copy "%p" /mnt/server/archivedir/"%f"' # Win32
17031714
<term><varname>cpu_index_tuple_cost</varname> (<type>floating point</type>)</term>
17041715
<listitem>
17051716
<para>
1706-
Sets thequeryplanner's estimate of the cost of processing
1717+
Sets the planner's estimate of the cost of processing
17071718
each index row during an index scan. This is measured as a
17081719
fraction of the cost of a sequential page fetch. The default
17091720
is 0.001.

‎src/backend/utils/misc/guc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.246 2004/10/22 19:48:19 tgl Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.247 2004/11/04 19:08:42 tgl Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -1344,7 +1344,7 @@ static struct config_real ConfigureNamesReal[] =
13441344
"pages, which are normally 8 kB each.")
13451345
},
13461346
&effective_cache_size,
1347-
DEFAULT_EFFECTIVE_CACHE_SIZE,0,DBL_MAX,NULL,NULL
1347+
DEFAULT_EFFECTIVE_CACHE_SIZE,1,DBL_MAX,NULL,NULL
13481348
},
13491349
{
13501350
{"random_page_cost",PGC_USERSET,QUERY_TUNING_COST,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp