pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Remove unnecessary checks for indexes for REPLICA IDENTITY FULL
2+ messages / 1 participants
[nested] [flat]

* pgsql: Remove unnecessary checks for indexes for REPLICA IDENTITY FULL
@ 2023-07-25 06:13 Masahiko Sawada <msawada@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Masahiko Sawada @ 2023-07-25 06:13 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/35c85c3c9b90eb70937c8f409d2e7615b2bdb538

Modified Files
--------------
src/backend/executor/execReplication.c     |   9 --
src/backend/replication/logical/relation.c | 128 ++++++++++++-----------------
src/backend/replication/logical/worker.c   |  24 ++++--
src/include/replication/logicalrelation.h  |   2 +-
4 files changed, 73 insertions(+), 90 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Remove unnecessary checks for indexes for REPLICA IDENTITY FULL
@ 2023-07-25 06:13 Masahiko Sawada <msawada@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Masahiko Sawada @ 2023-07-25 06:13 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d0ce9d0bc7f6aab6e45158bfa4f19cffdd7079a6

Modified Files
--------------
src/backend/executor/execReplication.c     |   9 ---
src/backend/replication/logical/relation.c | 118 +++++++++++------------------
src/backend/replication/logical/worker.c   |  24 ++++--
src/include/replication/logicalrelation.h  |   2 +-
4 files changed, 64 insertions(+), 89 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2023-07-25 06:13 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-07-25 06:13 pgsql: Remove unnecessary checks for indexes for REPLICA IDENTITY FULL Masahiko Sawada <msawada@postgresql.org>
2023-07-25 06:13 pgsql: Remove unnecessary checks for indexes for REPLICA IDENTITY FULL Masahiko Sawada <msawada@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox