diff options
author | Masahiko Sawada <msawada@postgresql.org> | 2023-07-25 15:09:34 +0900 |
---|---|---|
committer | Masahiko Sawada <msawada@postgresql.org> | 2023-07-25 15:09:34 +0900 |
commit | d0ce9d0bc7f6aab6e45158bfa4f19cffdd7079a6 (patch) | |
tree | 35071da2e5cc737abed1a88d33e3036317ecec1f /src/backend/executor/execReplication.c | |
parent | 71e4cc6b8ec6a08f81973bd387fe575134cd0bdf (diff) | |
download | postgresql-d0ce9d0bc7f6aab6e45158bfa4f19cffdd7079a6.tar.gz postgresql-d0ce9d0bc7f6aab6e45158bfa4f19cffdd7079a6.zip |
Remove unnecessary checks for indexes for REPLICA IDENTITY FULL tables.
Previously, when selecting an usable index for update/delete for the
REPLICA IDENTITY FULL table, in IsIndexOnlyExpression(), we used to
check if all index fields are not expressions. However, it was not
necessary, because it is enough to check if only the leftmost index
field is not an expression (and references the remote table column)
and this check has already been done by
RemoteRelContainsLeftMostColumnOnIdx().
This commit removes IsIndexOnlyExpression() and
RemoteRelContainsLeftMostColumnOnIdx() and all checks for usable
indexes for REPLICA IDENTITY FULL tables are now performed by
IsIndexUsableForReplicaIdentityFull().
Backpatch this to remain the code consistent.
Reported-by: Peter Smith
Reviewed-by: Amit Kapila, Önder Kalacı
Discussion: https://postgr.es/m/CAHut%2BPsGRE5WSsY0jcLHJEoA17MrbP9yy8FxdjC_ZOAACxbt%2BQ%40mail.gmail.com
Backpatch-through: 16
Diffstat (limited to 'src/backend/executor/execReplication.c')
-rw-r--r-- | src/backend/executor/execReplication.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/backend/executor/execReplication.c b/src/backend/executor/execReplication.c index e7765242270..81f27042bc4 100644 --- a/src/backend/executor/execReplication.c +++ b/src/backend/executor/execReplication.c @@ -222,16 +222,7 @@ retry: if (!isIdxSafeToSkipDuplicates) { if (eq == NULL) - { -#ifdef USE_ASSERT_CHECKING - /* apply assertions only once for the input idxoid */ - IndexInfo *indexInfo = BuildIndexInfo(idxrel); - - Assert(IsIndexUsableForReplicaIdentityFull(indexInfo)); -#endif - eq = palloc0(sizeof(*eq) * outslot->tts_tupleDescriptor->natts); - } if (!tuples_equal(outslot, searchslot, eq)) continue; |