Add more tests for relation statistics with rewrites
authorMichael Paquier <[email protected]>
Mon, 10 Nov 2025 05:30:10 +0000 (14:30 +0900)
committerMichael Paquier <[email protected]>
Mon, 10 Nov 2025 05:30:10 +0000 (14:30 +0900)
commitb23fe993e13612424faaee7ed35c4b830a2c0dfc
tree878987faf766e7c8aa2ebd81883513432be34bf6
parent812367f3d48768b662e64bf2693703bbca8575d2
Add more tests for relation statistics with rewrites

While there are many tests related to relation rewrites, nothing existed
to check how the cumulative statistics behave in such cases for
relations.

A different patch is under discussion to move the relation statistics to
be tracked on a per-relfilenode basis, so as these could be rebuilt
during crash recovery.  This commit gives us a way to check (and perhaps
change) the existing behaviors for several rewrite scenarios, mixing
transactions, sub-transactions, two-phase commit and VACUUM.

Author: Bertrand Drouvot <[email protected]>
Reviewed-by: Michael Paquier <[email protected]>
Discussion: https://postgr.es/m/[email protected]
src/test/regress/expected/stats_rewrite.out [new file with mode: 0644]
src/test/regress/expected/stats_rewrite_1.out [new file with mode: 0644]
src/test/regress/parallel_schedule
src/test/regress/sql/stats_rewrite.sql [new file with mode: 0644]