git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b762fed)
Use OFFSET 0 instead of ORDER BY to stop subquery pullup
2023年1月24日 00:49:10 +0000 (13:49 +1300)
2023年1月24日 00:49:10 +0000 (13:49 +1300)
b762fed64 recently changed this test to prevent subquery pullup to allow
us to test Memoize with lateral_vars. As pointed out by Tom Lane, OFFSET
0 is our standard way of preventing subquery pullups, so do it that way
instead.

Discussion: https://postgr.es/m/2144818.1674517061@sss.pgh.pa.us
Backpatch-through: 14, same as b762fed64


diff --git a/src/test/regress/expected/memoize.out b/src/test/regress/expected/memoize.out
index 0871932037634ef4b589ad4f82453a0ca59f2a33..60cbdeec7a8dc87053839e1ea730d7263abc49b4 100644 (file)
--- a/src/test/regress/expected/memoize.out
+++ b/src/test/regress/expected/memoize.out
@@ -64,7 +64,7 @@ WHERE t2.unique1 < 1000;
SELECT explain_memoize('
SELECT COUNT(*),AVG(t2.unique1) FROM tenk1 t1,
LATERAL (SELECT t2.unique1 FROM tenk1 t2
- WHERE t1.twenty = t2.unique1 ORDER BY 1) t2
+ WHERE t1.twenty = t2.unique1 OFFSET 0) t2
WHERE t1.unique1 < 1000;', false);
explain_memoize
-------------------------------------------------------------------------------------------
@@ -85,7 +85,7 @@ WHERE t1.unique1 < 1000;', false);
-- And check we get the expected results.
SELECT COUNT(*),AVG(t2.unique1) FROM tenk1 t1,
LATERAL (SELECT t2.unique1 FROM tenk1 t2
- WHERE t1.twenty = t2.unique1 ORDER BY 1) t2
+ WHERE t1.twenty = t2.unique1 OFFSET 0) t2
WHERE t1.unique1 < 1000;
count | avg
-------+--------------------
diff --git a/src/test/regress/sql/memoize.sql b/src/test/regress/sql/memoize.sql
index 623a9d5114f4190617ec88643cfd092c0d76d9af..d66acaed85a406592f33f7edeb4265dce43ecf4d 100644 (file)
--- a/src/test/regress/sql/memoize.sql
+++ b/src/test/regress/sql/memoize.sql
@@ -48,13 +48,13 @@ WHERE t2.unique1 < 1000;
SELECT explain_memoize('
SELECT COUNT(*),AVG(t2.unique1) FROM tenk1 t1,
LATERAL (SELECT t2.unique1 FROM tenk1 t2
- WHERE t1.twenty = t2.unique1 ORDER BY 1) t2
+ WHERE t1.twenty = t2.unique1 OFFSET 0) t2
WHERE t1.unique1 < 1000;', false);
-- And check we get the expected results.
SELECT COUNT(*),AVG(t2.unique1) FROM tenk1 t1,
LATERAL (SELECT t2.unique1 FROM tenk1 t2
- WHERE t1.twenty = t2.unique1 ORDER BY 1) t2
+ WHERE t1.twenty = t2.unique1 OFFSET 0) t2
WHERE t1.unique1 < 1000;
-- Reduce work_mem and hash_mem_multiplier so that we see some cache evictions
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /