summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2017-03-14 13:27:02 -0400
committerRobert Haas <rhaas@postgresql.org>2017-03-14 13:27:02 -0400
commitc11453ce0aeaa377cbbcc9a3fc418acb94629330 (patch)
treeb7e0c1952bd7167ce826b8ed4bf8204012f4a47b /doc
parent2b32ac2a59df18246c3b79e96a209bfdb39bb918 (diff)
downloadpostgresql-c11453ce0aeaa377cbbcc9a3fc418acb94629330.tar.gz
hash: Add write-ahead logging support.
The warning about hash indexes not being write-ahead logged and their use being discouraged has been removed. "snapshot too old" is now supported for tables with hash indexes. Most importantly, barring bugs, hash indexes will now be crash-safe and usable on standbys. This commit doesn't yet add WAL consistency checking for hash indexes, as we now have for other index types; a separate patch has been submitted to cure that lack. Amit Kapila, reviewed and slightly modified by me. The larger patch series of which this is a part has been reviewed and tested by Álvaro Herrera, Ashutosh Sharma, Mark Kirkwood, Jeff Janes, and Jesper Pedersen. Discussion: http://postgr.es/m/CAA4eK1JOBX=YU33631Qh-XivYXtPSALh514+jR8XeD7v+K3r_Q@mail.gmail.com
Diffstat (limited to 'doc')
-rw-r--r--doc/src/sgml/backup.sgml13
-rw-r--r--doc/src/sgml/config.sgml7
-rw-r--r--doc/src/sgml/high-availability.sgml6
-rw-r--r--doc/src/sgml/indices.sgml12
-rw-r--r--doc/src/sgml/ref/create_index.sgml13
5 files changed, 3 insertions, 48 deletions
diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml
index 12f2a14a5c..69c599e180 100644
--- a/doc/src/sgml/backup.sgml
+++ b/doc/src/sgml/backup.sgml
@@ -1538,19 +1538,6 @@ archive_command = 'local_backup_script.sh "%p" "%f"'
<itemizedlist>
<listitem>
<para>
- Operations on hash indexes are not presently WAL-logged, so
- replay will not update these indexes. This will mean that any new inserts
- will be ignored by the index, updated rows will apparently disappear and
- deleted rows will still retain pointers. In other words, if you modify a
- table with a hash index on it then you will get incorrect query results
- on a standby server. When recovery completes it is recommended that you
- manually <xref linkend="sql-reindex">
- each such index after completing a recovery operation.
- </para>
- </listitem>
-
- <listitem>
- <para>
If a <xref linkend="sql-createdatabase">
command is executed while a base backup is being taken, and then
the template database that the <command>CREATE DATABASE</> copied
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 69844e5b29..eadbfcd22f 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -2153,10 +2153,9 @@ include_dir 'conf.d'
has materialized a result set, no error will be generated even if the
underlying rows in the referenced table have been vacuumed away.
Some tables cannot safely be vacuumed early, and so will not be
- affected by this setting. Examples include system catalogs and any
- table which has a hash index. For such tables this setting will
- neither reduce bloat nor create a possibility of a <literal>snapshot
- too old</> error on scanning.
+ affected by this setting, such as system catalogs. For such tables
+ this setting will neither reduce bloat nor create a possibility
+ of a <literal>snapshot too old</> error on scanning.
</para>
</listitem>
</varlistentry>
diff --git a/doc/src/sgml/high-availability.sgml b/doc/src/sgml/high-availability.sgml
index 48de2ced23..0e619912d8 100644
--- a/doc/src/sgml/high-availability.sgml
+++ b/doc/src/sgml/high-availability.sgml
@@ -2353,12 +2353,6 @@ LOG: database system is ready to accept read only connections
<itemizedlist>
<listitem>
<para>
- Operations on hash indexes are not presently WAL-logged, so
- replay will not update these indexes.
- </para>
- </listitem>
- <listitem>
- <para>
Full knowledge of running transactions is required before snapshots
can be taken. Transactions that use large numbers of subtransactions
(currently greater than 64) will delay the start of read only
diff --git a/doc/src/sgml/indices.sgml b/doc/src/sgml/indices.sgml
index 271c135519..e40750e8ec 100644
--- a/doc/src/sgml/indices.sgml
+++ b/doc/src/sgml/indices.sgml
@@ -193,18 +193,6 @@ CREATE INDEX <replaceable>name</replaceable> ON <replaceable>table</replaceable>
</synopsis>
</para>
- <caution>
- <para>
- Hash index operations are not presently WAL-logged,
- so hash indexes might need to be rebuilt with <command>REINDEX</>
- after a database crash if there were unwritten changes.
- Also, changes to hash indexes are not replicated over streaming or
- file-based replication after the initial base backup, so they
- give wrong answers to queries that subsequently use them.
- For these reasons, hash index use is presently discouraged.
- </para>
- </caution>
-
<para>
<indexterm>
<primary>index</primary>
diff --git a/doc/src/sgml/ref/create_index.sgml b/doc/src/sgml/ref/create_index.sgml
index fcb7a60ce3..7163b032b1 100644
--- a/doc/src/sgml/ref/create_index.sgml
+++ b/doc/src/sgml/ref/create_index.sgml
@@ -510,19 +510,6 @@ Indexes:
they can be useful.
</para>
- <caution>
- <para>
- Hash index operations are not presently WAL-logged,
- so hash indexes might need to be rebuilt with <command>REINDEX</>
- after a database crash if there were unwritten changes.
- Also, changes to hash indexes are not replicated over streaming or
- file-based replication after the initial base backup, so they
- give wrong answers to queries that subsequently use them.
- Hash indexes are also not properly restored during point-in-time
- recovery. For these reasons, hash index use is presently discouraged.
- </para>
- </caution>
-
<para>
Currently, only the B-tree, GiST, GIN, and BRIN index methods support
multicolumn indexes. Up to 32 fields can be specified by default.