postgres/contrib/test_decoding/sql
Masahiko Sawada 072ee847ad Skip logical decoding of already-aborted transactions.
Previously, transaction aborts were detected concurrently only during
system catalog scans while replaying a transaction in streaming mode.

This commit adds an additional CLOG lookup to check the transaction
status, allowing the logical decoding to skip changes also when it
doesn't touch system catalogs, if the transaction is already
aborted. This optimization enhances logical decoding performance,
especially for large transactions that have already been rolled back,
as it avoids unnecessary disk or network I/O.

To avoid potential slowdowns caused by frequent CLOG lookups for small
transactions (most of which commit), the CLOG lookup is performed only
for large transactions before eviction. The performance benchmark
results showed there is not noticeable performance regression due to
CLOG lookups.

Reviewed-by: Amit Kapila, Peter Smith, Vignesh C, Ajin Cherian
Reviewed-by: Dilip Kumar, Andres Freund
Discussion: https://postgr.es/m/CAD21AoDht9Pz_DFv_R2LqBTBbO4eGrpa9Vojmt5z5sEx3XwD7A@mail.gmail.com
2025-02-12 16:31:34 -08:00
..
binary.sql
ddl.sql Make test_decoding ddl.out shorter 2023-07-24 17:48:06 +02:00
decoding_in_xact.sql Make RelationFlushRelation() work without ResourceOwner during abort 2024-06-06 18:56:28 +03:00
decoding_into_rel.sql Revert "Logical decoding of sequences" 2022-04-07 20:06:36 +02:00
messages.sql Add flush option to pg_logical_emit_message() 2023-10-18 11:24:59 +09:00
permissions.sql Add a slot synchronization function. 2024-02-14 09:45:36 +05:30
prepared.sql
replorigin.sql Fix the misuse of origin filter across multiple pg_logical_slot_get_changes() calls. 2023-09-27 14:32:51 +05:30
rewrite.sql Revert "Logical decoding of sequences" 2022-04-07 20:06:36 +02:00
slot.sql Add a slot synchronization function. 2024-02-14 09:45:36 +05:30
spill.sql Make contrib/test_decoding regression tests safe for CZ locale. 2016-11-21 20:39:28 -05:00
stats.sql Skip logical decoding of already-aborted transactions. 2025-02-12 16:31:34 -08:00
stream.sql Skip logical decoding of already-aborted transactions. 2025-02-12 16:31:34 -08:00
time.sql
toast.sql Revert "Logical decoding of sequences" 2022-04-07 20:06:36 +02:00
truncate.sql Revert "Logical decoding of sequences" 2022-04-07 20:06:36 +02:00
twophase_stream.sql Add option to enable two_phase commits via pg_create_logical_replication_slot. 2021-03-03 07:34:11 +05:30
twophase.sql Stabilize the test added by commit 022564f60c. 2024-10-08 12:25:52 +05:30
xact.sql Don't propagate a null subtransaction snapshot up to parent transaction. 2016-08-07 13:15:55 -04:00