postgresql/src
Melanie Plageman 0f4c170cf3 Make it cheap to check if a relation is modified by a query
Save the range table indexes of result relations and row mark relations
in separate bitmapsets in the PlannedStmt. Precomputing them allows
cheap membership checks during execution. Together, these two groups
approximate all relations that will be modified by a query. This
includes relations targeted by INSERT, UPDATE, DELETE, and MERGE as well
as relations with any row mark (like SELECT FOR UPDATE).

Future work will use information on whether or not a relation is
modified by a query in a heuristic.

PlannedStmt->resultRelations is only used in a membership check, so it
will be removed in a separate commit.

Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/F5CDD1B5-628C-44A1-9F85-3958C626F6A9%40gmail.com
2026-03-30 09:38:03 -04:00
..
backend Make it cheap to check if a relation is modified by a query 2026-03-30 09:38:03 -04:00
bin Fix accidentally casting away const 2026-03-30 09:24:10 +02:00
common Make implementation of SASLprep compliant for ASCII characters 2026-03-24 08:29:23 +09:00
fe_utils Fix multiple bugs in astreamer pipeline code. 2026-03-29 09:01:47 -04:00
include Make it cheap to check if a relation is modified by a query 2026-03-30 09:38:03 -04:00
interfaces Fix -Wstrict-prototypes warning in ecpg_init_sqlca() declaration. 2026-03-18 15:27:49 -04:00
makefiles meson: Add {perl|python}_includespec to generated Makefile.global 2026-03-18 11:09:14 +01:00
pl Bounds-check access to TupleDescAttr with an Assert. 2026-03-24 08:58:50 -04:00
port Refactor handling of x86 CPUID instructions 2026-03-25 12:32:36 +07:00
template Switch the semaphore API on Solaris to unnamed POSIX. 2026-03-14 14:10:32 -04:00
test Fix FK triggers losing DEFERRABLE/INITIALLY DEFERRED when marked ENFORCED again 2026-03-30 14:37:33 +09:00
timezone Use fallthrough attribute instead of comment 2026-02-19 08:51:12 +01:00
tools headerscheck: Avoid mutual inclusion of pg_config.h and c.h 2026-03-30 10:14:41 +02:00
tutorial Force standard_conforming_strings to always be ON. 2026-01-21 15:08:38 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Update Unicode data to Unicode 17.0.0 2026-03-20 08:42:50 +01:00
Makefile.shlib Restore AIX support. 2026-02-23 13:34:22 -05:00
meson.build Update copyright for 2026 2026-01-01 13:24:10 -05:00
nls-global.mk Fix update-po for the PGXS case 2025-10-16 20:21:05 +02:00