summaryrefslogtreecommitdiffstats
path: root/src/test/regress/regressplans.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:44:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:44:03 +0000
commit293913568e6a7a86fd1479e1cff8e2ecb58d6568 (patch)
treefc3b469a3ec5ab71b36ea97cc7aaddb838423a0c /src/test/regress/regressplans.sh
parentInitial commit. (diff)
downloadpostgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.tar.xz
postgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.zip
Adding upstream version 16.2.upstream/16.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/regress/regressplans.sh')
-rwxr-xr-xsrc/test/regress/regressplans.sh101
1 files changed, 101 insertions, 0 deletions
diff --git a/src/test/regress/regressplans.sh b/src/test/regress/regressplans.sh
new file mode 100755
index 0000000..31e7876
--- /dev/null
+++ b/src/test/regress/regressplans.sh
@@ -0,0 +1,101 @@
+#! /bin/sh
+
+# This script runs the Postgres regression tests with all useful combinations
+# of the backend options that disable various query plan types. If the
+# results are not all the same, it may indicate a bug in a particular
+# plan type, or perhaps just a regression test whose results aren't fully
+# determinate (eg, due to lack of an ORDER BY keyword).
+#
+# Run this in the src/test/regress directory, after doing the usual setup
+# for a regular regression test, ie, "make clean all" (you should be ready
+# to do "make runtest").
+#
+# The backend option switches that we use here are:
+# -fs disable sequential scans
+# -fi disable index scans
+# -fn disable nestloop joins
+# -fm disable merge joins
+# -fh disable hash joins
+# Only mergejoin and hashjoin are really guaranteed to turn off; the others
+# just bias the optimizer's cost calculations heavily against that choice.
+# There's no point in trying to turn off both scan types or all three join
+# types simultaneously; ergo, we have 3*7 = 21 interesting combinations.
+#
+# Note that this will take *more than* 21 times longer than a regular
+# regression test, since we are preventing the system from using the most
+# efficient available query plans! Have patience.
+
+
+# Select make to use --- default 'make', can be overridden by env var
+MAKE="${MAKE:-make}"
+
+# If PGOPTIONS is already defined, we'll add the -f switches to it.
+PGOPTIONS="${PGOPTIONS:-}"
+
+mkdir planregress
+
+PGOPTIONS="$PGOPTIONS " $MAKE runtest
+mv -f regression.out planregress/out.normal
+mv -f regression.diffs planregress/diffs.normal
+PGOPTIONS="$PGOPTIONS -fh" $MAKE runtest
+mv -f regression.out planregress/out.h
+mv -f regression.diffs planregress/diffs.h
+PGOPTIONS="$PGOPTIONS -fm " $MAKE runtest
+mv -f regression.out planregress/out.m
+mv -f regression.diffs planregress/diffs.m
+PGOPTIONS="$PGOPTIONS -fm -fh" $MAKE runtest
+mv -f regression.out planregress/out.mh
+mv -f regression.diffs planregress/diffs.mh
+PGOPTIONS="$PGOPTIONS -fn " $MAKE runtest
+mv -f regression.out planregress/out.n
+mv -f regression.diffs planregress/diffs.n
+PGOPTIONS="$PGOPTIONS -fn -fh" $MAKE runtest
+mv -f regression.out planregress/out.nh
+mv -f regression.diffs planregress/diffs.nh
+PGOPTIONS="$PGOPTIONS -fn -fm " $MAKE runtest
+mv -f regression.out planregress/out.nm
+mv -f regression.diffs planregress/diffs.nm
+PGOPTIONS="$PGOPTIONS -fi " $MAKE runtest
+mv -f regression.out planregress/out.i
+mv -f regression.diffs planregress/diffs.i
+PGOPTIONS="$PGOPTIONS -fi -fh" $MAKE runtest
+mv -f regression.out planregress/out.ih
+mv -f regression.diffs planregress/diffs.ih
+PGOPTIONS="$PGOPTIONS -fi -fm " $MAKE runtest
+mv -f regression.out planregress/out.im
+mv -f regression.diffs planregress/diffs.im
+PGOPTIONS="$PGOPTIONS -fi -fm -fh" $MAKE runtest
+mv -f regression.out planregress/out.imh
+mv -f regression.diffs planregress/diffs.imh
+PGOPTIONS="$PGOPTIONS -fi -fn " $MAKE runtest
+mv -f regression.out planregress/out.in
+mv -f regression.diffs planregress/diffs.in
+PGOPTIONS="$PGOPTIONS -fi -fn -fh" $MAKE runtest
+mv -f regression.out planregress/out.inh
+mv -f regression.diffs planregress/diffs.inh
+PGOPTIONS="$PGOPTIONS -fi -fn -fm " $MAKE runtest
+mv -f regression.out planregress/out.inm
+mv -f regression.diffs planregress/diffs.inm
+PGOPTIONS="$PGOPTIONS -fs " $MAKE runtest
+mv -f regression.out planregress/out.s
+mv -f regression.diffs planregress/diffs.s
+PGOPTIONS="$PGOPTIONS -fs -fh" $MAKE runtest
+mv -f regression.out planregress/out.sh
+mv -f regression.diffs planregress/diffs.sh
+PGOPTIONS="$PGOPTIONS -fs -fm " $MAKE runtest
+mv -f regression.out planregress/out.sm
+mv -f regression.diffs planregress/diffs.sm
+PGOPTIONS="$PGOPTIONS -fs -fm -fh" $MAKE runtest
+mv -f regression.out planregress/out.smh
+mv -f regression.diffs planregress/diffs.smh
+PGOPTIONS="$PGOPTIONS -fs -fn " $MAKE runtest
+mv -f regression.out planregress/out.sn
+mv -f regression.diffs planregress/diffs.sn
+PGOPTIONS="$PGOPTIONS -fs -fn -fh" $MAKE runtest
+mv -f regression.out planregress/out.snh
+mv -f regression.diffs planregress/diffs.snh
+PGOPTIONS="$PGOPTIONS -fs -fn -fm " $MAKE runtest
+mv -f regression.out planregress/out.snm
+mv -f regression.diffs planregress/diffs.snm
+
+exit 0