]> granicus.if.org Git - postgresql/commit
Allow HOT updates for some expression indexes
authorSimon Riggs <simon@2ndQuadrant.com>
Tue, 27 Mar 2018 18:57:02 +0000 (19:57 +0100)
committerSimon Riggs <simon@2ndQuadrant.com>
Tue, 27 Mar 2018 18:57:02 +0000 (19:57 +0100)
commitc203d6cf81b4d7e43edb2b75ec1b741ba48e04e0
treecf9e4a14290ef99232a5f5f477d5b2672df57629
parent1944cdc98273dbb8439ad9b387ca2858531afcf0
Allow HOT updates for some expression indexes

If the value of an index expression is unchanged after UPDATE,
allow HOT updates where previously we disallowed them, giving
a significant performance boost in those cases.

Particularly useful for indexes such as JSON->>field where the
JSON value changes but the indexed value does not.

Submitted as "surjective indexes" patch, now enabled by use
of new "recheck_on_update" parameter.

Author: Konstantin Knizhnik
Reviewer: Simon Riggs, with much wordsmithing and some cleanup
13 files changed:
doc/src/sgml/ref/create_index.sgml
src/backend/access/common/reloptions.c
src/backend/access/heap/heapam.c
src/backend/catalog/index.c
src/backend/utils/cache/relcache.c
src/bin/psql/tab-complete.c
src/include/access/reloptions.h
src/include/utils/rel.h
src/include/utils/relcache.h
src/test/regress/expected/func_index.out [new file with mode: 0644]
src/test/regress/parallel_schedule
src/test/regress/serial_schedule
src/test/regress/sql/func_index.sql [new file with mode: 0644]