From c11453ce0aeaa377cbbcc9a3fc418acb94629330 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Tue, 14 Mar 2017 13:27:02 -0400 Subject: hash: Add write-ahead logging support. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- doc/src/sgml/backup.sgml | 13 ------------- doc/src/sgml/config.sgml | 7 +++---- doc/src/sgml/high-availability.sgml | 6 ------ doc/src/sgml/indices.sgml | 12 ------------ doc/src/sgml/ref/create_index.sgml | 13 ------------- 5 files changed, 3 insertions(+), 48 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml index 12f2a14a5c7..69c599e1803 100644 --- a/doc/src/sgml/backup.sgml +++ b/doc/src/sgml/backup.sgml @@ -1536,19 +1536,6 @@ archive_command = 'local_backup_script.sh "%p" "%f"' technique. These will probably be fixed in future releases: - - - 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 - each such index after completing a recovery operation. - - - If a diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 69844e5b299..eadbfcd22fb 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 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 snapshot too old error on scanning. diff --git a/doc/src/sgml/high-availability.sgml b/doc/src/sgml/high-availability.sgml index 48de2ced236..0e619912d8f 100644 --- a/doc/src/sgml/high-availability.sgml +++ b/doc/src/sgml/high-availability.sgml @@ -2351,12 +2351,6 @@ LOG: database system is ready to accept read only connections These can and probably will be fixed in future releases: - - - Operations on hash indexes are not presently WAL-logged, so - replay will not update these indexes. - - Full knowledge of running transactions is required before snapshots diff --git a/doc/src/sgml/indices.sgml b/doc/src/sgml/indices.sgml index 271c1355199..e40750e8ec2 100644 --- a/doc/src/sgml/indices.sgml +++ b/doc/src/sgml/indices.sgml @@ -193,18 +193,6 @@ CREATE INDEX name ON table - - - Hash index operations are not presently WAL-logged, - so hash indexes might need to be rebuilt with 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. - - - index diff --git a/doc/src/sgml/ref/create_index.sgml b/doc/src/sgml/ref/create_index.sgml index fcb7a60ce3e..7163b032b1b 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. - - - Hash index operations are not presently WAL-logged, - so hash indexes might need to be rebuilt with 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. - - - Currently, only the B-tree, GiST, GIN, and BRIN index methods support multicolumn indexes. Up to 32 fields can be specified by default. -- cgit v1.2.3