Use OFFSET 0 instead of ORDER BY to stop subquery pullup
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
This commit is contained in:
parent
b762fed648
commit
9567686ec8
@ -64,7 +64,7 @@ WHERE t2.unique1 < 1000;
|
|||||||
SELECT explain_memoize('
|
SELECT explain_memoize('
|
||||||
SELECT COUNT(*),AVG(t2.unique1) FROM tenk1 t1,
|
SELECT COUNT(*),AVG(t2.unique1) FROM tenk1 t1,
|
||||||
LATERAL (SELECT t2.unique1 FROM tenk1 t2
|
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);
|
WHERE t1.unique1 < 1000;', false);
|
||||||
explain_memoize
|
explain_memoize
|
||||||
-------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------
|
||||||
@ -85,7 +85,7 @@ WHERE t1.unique1 < 1000;', false);
|
|||||||
-- And check we get the expected results.
|
-- And check we get the expected results.
|
||||||
SELECT COUNT(*),AVG(t2.unique1) FROM tenk1 t1,
|
SELECT COUNT(*),AVG(t2.unique1) FROM tenk1 t1,
|
||||||
LATERAL (SELECT t2.unique1 FROM tenk1 t2
|
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;
|
WHERE t1.unique1 < 1000;
|
||||||
count | avg
|
count | avg
|
||||||
-------+--------------------
|
-------+--------------------
|
||||||
|
@ -48,13 +48,13 @@ WHERE t2.unique1 < 1000;
|
|||||||
SELECT explain_memoize('
|
SELECT explain_memoize('
|
||||||
SELECT COUNT(*),AVG(t2.unique1) FROM tenk1 t1,
|
SELECT COUNT(*),AVG(t2.unique1) FROM tenk1 t1,
|
||||||
LATERAL (SELECT t2.unique1 FROM tenk1 t2
|
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);
|
WHERE t1.unique1 < 1000;', false);
|
||||||
|
|
||||||
-- And check we get the expected results.
|
-- And check we get the expected results.
|
||||||
SELECT COUNT(*),AVG(t2.unique1) FROM tenk1 t1,
|
SELECT COUNT(*),AVG(t2.unique1) FROM tenk1 t1,
|
||||||
LATERAL (SELECT t2.unique1 FROM tenk1 t2
|
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;
|
WHERE t1.unique1 < 1000;
|
||||||
|
|
||||||
-- Reduce work_mem and hash_mem_multiplier so that we see some cache evictions
|
-- Reduce work_mem and hash_mem_multiplier so that we see some cache evictions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user