Allow HOT updates for some expression indexes
Simon Riggs <simon@2ndQuadrant.com>
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
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ref/create_index.sgml | modified | +35 −2 |
| src/backend/access/common/reloptions.c | modified | +44 −1 |
| src/backend/access/heap/heapam.c | modified | +98 −7 |
| src/backend/catalog/index.c | modified | +2 −1 |
| src/backend/utils/cache/relcache.c | modified | +106 −6 |
| src/bin/psql/tab-complete.c | modified | +2 −2 |
| src/include/access/reloptions.h | modified | +2 −0 |
| src/include/utils/relcache.h | modified | +2 −1 |
| src/include/utils/rel.h | modified | +11 −1 |
| src/test/regress/expected/func_index.out | added | +61 −0 |
| src/test/regress/parallel_schedule | modified | +1 −1 |
| src/test/regress/serial_schedule | modified | +1 −0 |
| src/test/regress/sql/func_index.sql | added | +30 −0 |