aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/src/sgml/ref/create_index.sgml37
-rw-r--r--doc/src/sgml/release-11.sgml13
-rw-r--r--src/backend/utils/cache/relcache.c3
-rw-r--r--src/test/regress/expected/func_index.out64
-rw-r--r--src/test/regress/parallel_schedule2
-rw-r--r--src/test/regress/serial_schedule1
-rw-r--r--src/test/regress/sql/func_index.sql31
7 files changed, 6 insertions, 145 deletions
diff --git a/doc/src/sgml/ref/create_index.sgml b/doc/src/sgml/ref/create_index.sgml
index 4df3d756de7..ad619cdcfe4 100644
--- a/doc/src/sgml/ref/create_index.sgml
+++ b/doc/src/sgml/ref/create_index.sgml
@@ -356,41 +356,8 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
<para>
The optional <literal>WITH</literal> clause specifies <firstterm>storage
parameters</firstterm> for the index. Each index method has its own set of allowed
- storage parameters. All indexes accept the following parameter:
- </para>
-
- <variablelist>
- <varlistentry>
- <term><literal>recheck_on_update</literal></term>
- <listitem>
- <para>
- Specifies whether to recheck a functional index value to see whether
- we can use a HOT update or not. The default value is on for functional
- indexes with an total expression cost less than 1000, otherwise off.
- You might decide to turn this off if you knew that a function used in
- an index is unlikely to return the same value when one of the input
- columns is updated and so the recheck is not worth the additional cost
- of executing the function.
- </para>
-
- <para>
- Functional indexes are used frequently for the case where the function
- returns a subset of the argument. Examples of this would be accessing
- part of a string with <literal>SUBSTR()</literal> or accessing a single
- field in a JSON document using an expression such as
- <literal>(bookinfo-&gt;&gt;'isbn')</literal>. In this example, the JSON
- document might be updated frequently, yet it is uncommon for the ISBN
- field for a book to change so we would keep the parameter set to on
- for that index. A more frequently changing field might have an index
- with this parameter turned off, while very frequently changing fields
- might be better to avoid indexing at all under high load.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
-
- <para>
- The B-tree, hash, GiST and SP-GiST index methods all accept this parameter:
+ storage parameters. The B-tree, hash, GiST and SP-GiST index methods all
+ accept this parameter:
</para>
<variablelist>
diff --git a/doc/src/sgml/release-11.sgml b/doc/src/sgml/release-11.sgml
index f7ddcec1208..36e69654e24 100644
--- a/doc/src/sgml/release-11.sgml
+++ b/doc/src/sgml/release-11.sgml
@@ -1437,19 +1437,6 @@ same commits as above
</para>
</listitem>
- <listitem>
-<!--
-2018-03-27 [c203d6cf8] Allow HOT updates for some expression indexes
--->
-
- <para>
- Allow heap-only-tuple (<acronym>HOT</acronym>) updates for
- expression indexes when the values of the expressions are unchanged
- (Konstantin Knizhnik)
- </para>
-
- </listitem>
-
</itemizedlist>
<sect5>
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index fd3d010b778..aecbd4a9437 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -4755,6 +4755,7 @@ IsProjectionFunctionalIndex(Relation index, IndexInfo *ii)
{
bool is_projection = false;
+#ifdef NOT_USED
if (ii->ii_Expressions)
{
HeapTuple tuple;
@@ -4800,6 +4801,8 @@ IsProjectionFunctionalIndex(Relation index, IndexInfo *ii)
}
ReleaseSysCache(tuple);
}
+#endif
+
return is_projection;
}
diff --git a/src/test/regress/expected/func_index.out b/src/test/regress/expected/func_index.out
deleted file mode 100644
index 307ac97b4bc..00000000000
--- a/src/test/regress/expected/func_index.out
+++ /dev/null
@@ -1,64 +0,0 @@
-begin;
-create table keyvalue(id integer primary key, info jsonb);
-create index nameindex on keyvalue((info->>'name')) with (recheck_on_update=false);
-insert into keyvalue values (1, '{"name": "john", "data": "some data"}');
-update keyvalue set info='{"name": "john", "data": "some other data"}' where id=1;
-select pg_stat_get_xact_tuples_hot_updated('keyvalue'::regclass);
- pg_stat_get_xact_tuples_hot_updated
--------------------------------------
- 0
-(1 row)
-
-rollback;
-begin;
-create table keyvalue(id integer primary key, info jsonb);
-create index nameindex on keyvalue((info->>'name')) with (recheck_on_update=true);
-insert into keyvalue values (1, '{"name": "john", "data": "some data"}');
-update keyvalue set info='{"name": "john", "data": "some other data"}' where id=1;
-select pg_stat_get_xact_tuples_hot_updated('keyvalue'::regclass);
- pg_stat_get_xact_tuples_hot_updated
--------------------------------------
- 1
-(1 row)
-
-update keyvalue set info='{"name": "smith", "data": "some other data"}' where id=1;
-select pg_stat_get_xact_tuples_hot_updated('keyvalue'::regclass);
- pg_stat_get_xact_tuples_hot_updated
--------------------------------------
- 1
-(1 row)
-
-update keyvalue set info='{"name": "smith", "data": "some more data"}' where id=1;
-select pg_stat_get_xact_tuples_hot_updated('keyvalue'::regclass);
- pg_stat_get_xact_tuples_hot_updated
--------------------------------------
- 2
-(1 row)
-
-rollback;
-begin;
-create table keyvalue(id integer primary key, info jsonb);
-create index nameindex on keyvalue((info->>'name'));
-insert into keyvalue values (1, '{"name": "john", "data": "some data"}');
-update keyvalue set info='{"name": "john", "data": "some other data"}' where id=1;
-select pg_stat_get_xact_tuples_hot_updated('keyvalue'::regclass);
- pg_stat_get_xact_tuples_hot_updated
--------------------------------------
- 1
-(1 row)
-
-update keyvalue set info='{"name": "smith", "data": "some other data"}' where id=1;
-select pg_stat_get_xact_tuples_hot_updated('keyvalue'::regclass);
- pg_stat_get_xact_tuples_hot_updated
--------------------------------------
- 1
-(1 row)
-
-update keyvalue set info='{"name": "smith", "data": "some more data"}' where id=1;
-select pg_stat_get_xact_tuples_hot_updated('keyvalue'::regclass);
- pg_stat_get_xact_tuples_hot_updated
--------------------------------------
- 2
-(1 row)
-
-rollback;
diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule
index b5e15501dd7..289c658483c 100644
--- a/src/test/regress/parallel_schedule
+++ b/src/test/regress/parallel_schedule
@@ -84,7 +84,7 @@ test: select_into select_distinct select_distinct_on select_implicit select_havi
# ----------
# Another group of parallel tests
# ----------
-test: brin gin gist spgist privileges init_privs security_label collate matview lock replica_identity rowsecurity object_address tablesample groupingsets drop_operator password func_index
+test: brin gin gist spgist privileges init_privs security_label collate matview lock replica_identity rowsecurity object_address tablesample groupingsets drop_operator password
# ----------
# Another group of parallel tests
diff --git a/src/test/regress/serial_schedule b/src/test/regress/serial_schedule
index 49329ffbb62..bc43b18c628 100644
--- a/src/test/regress/serial_schedule
+++ b/src/test/regress/serial_schedule
@@ -99,7 +99,6 @@ test: portals
test: arrays
test: btree_index
test: hash_index
-test: func_index
test: update
test: delete
test: namespace
diff --git a/src/test/regress/sql/func_index.sql b/src/test/regress/sql/func_index.sql
deleted file mode 100644
index c267c93eb08..00000000000
--- a/src/test/regress/sql/func_index.sql
+++ /dev/null
@@ -1,31 +0,0 @@
-begin;
-create table keyvalue(id integer primary key, info jsonb);
-create index nameindex on keyvalue((info->>'name')) with (recheck_on_update=false);
-insert into keyvalue values (1, '{"name": "john", "data": "some data"}');
-update keyvalue set info='{"name": "john", "data": "some other data"}' where id=1;
-select pg_stat_get_xact_tuples_hot_updated('keyvalue'::regclass);
-rollback;
-
-begin;
-create table keyvalue(id integer primary key, info jsonb);
-create index nameindex on keyvalue((info->>'name')) with (recheck_on_update=true);
-insert into keyvalue values (1, '{"name": "john", "data": "some data"}');
-update keyvalue set info='{"name": "john", "data": "some other data"}' where id=1;
-select pg_stat_get_xact_tuples_hot_updated('keyvalue'::regclass);
-update keyvalue set info='{"name": "smith", "data": "some other data"}' where id=1;
-select pg_stat_get_xact_tuples_hot_updated('keyvalue'::regclass);
-update keyvalue set info='{"name": "smith", "data": "some more data"}' where id=1;
-select pg_stat_get_xact_tuples_hot_updated('keyvalue'::regclass);
-rollback;
-
-begin;
-create table keyvalue(id integer primary key, info jsonb);
-create index nameindex on keyvalue((info->>'name'));
-insert into keyvalue values (1, '{"name": "john", "data": "some data"}');
-update keyvalue set info='{"name": "john", "data": "some other data"}' where id=1;
-select pg_stat_get_xact_tuples_hot_updated('keyvalue'::regclass);
-update keyvalue set info='{"name": "smith", "data": "some other data"}' where id=1;
-select pg_stat_get_xact_tuples_hot_updated('keyvalue'::regclass);
-update keyvalue set info='{"name": "smith", "data": "some more data"}' where id=1;
-select pg_stat_get_xact_tuples_hot_updated('keyvalue'::regclass);
-rollback;