aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/generic_xlog.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2023-10-11 12:51:38 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2023-10-11 12:51:38 -0400
commit5d8aa8bcedae7376bd97e79052d606db4e4f8dd4 (patch)
tree853b7fb8df518a0ee077599384696889a9c82f10 /src/backend/access/transam/generic_xlog.c
parent16671ba6e717ea307a3f61e8ab4f866cd6834772 (diff)
downloadpostgresql-5d8aa8bcedae7376bd97e79052d606db4e4f8dd4.tar.gz
postgresql-5d8aa8bcedae7376bd97e79052d606db4e4f8dd4.zip
Fix missed optimization in relation_excluded_by_constraints().
In commit 3fc6e2d7f, I (tgl) argued that we only need to check for a constant-FALSE restriction clause when there's exactly one restriction clause, on the grounds that const-folding would have thrown away anything ANDed with a Const FALSE. That's true just after const-folding has been applied, but subsequent processing such as equivalence class expansion could result in cases where a Const FALSE is ANDed with some other stuff. (Compare for instance joinrels.c's restriction_is_constant_false.) Hence, tweak this logic to check all the elements of the baserestrictinfo list, not just one; that's cheap enough to not be worth worrying about. There is one existing test case where this visibly improves the plan. There would not be any savings in runtime, but the planner effort and executor startup effort will be reduced, and anyway it's odd that we can detect related cases but not this one. Richard Guo (independently discovered by David Rowley) Discussion: https://postgr.es/m/CAMbWs4_x3-CnVVrCboS1LkEhB5V+W7sLSCabsRiG+n7+5_kqbg@mail.gmail.com
Diffstat (limited to 'src/backend/access/transam/generic_xlog.c')
0 files changed, 0 insertions, 0 deletions