Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9567686

Browse files
committed
Use OFFSET 0 instead of ORDER BY to stop subquery pullup
b762fed recently changed this test to prevent subquery pullup to allowus to test Memoize with lateral_vars. As pointed out by Tom Lane, OFFSET0 is our standard way of preventing subquery pullups, so do it that wayinstead.Discussion:https://postgr.es/m/2144818.1674517061@sss.pgh.pa.usBackpatch-through: 14, same asb762fed
1 parentb762fed commit9567686

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎src/test/regress/expected/memoize.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ WHERE t2.unique1 < 1000;
6464
SELECT explain_memoize('
6565
SELECT COUNT(*),AVG(t2.unique1) FROM tenk1 t1,
6666
LATERAL (SELECT t2.unique1 FROM tenk1 t2
67-
WHERE t1.twenty = t2.unique1ORDER BY 1) t2
67+
WHERE t1.twenty = t2.unique1OFFSET 0) t2
6868
WHERE t1.unique1 < 1000;', false);
6969
explain_memoize
7070
-------------------------------------------------------------------------------------------
@@ -85,7 +85,7 @@ WHERE t1.unique1 < 1000;', false);
8585
-- And check we get the expected results.
8686
SELECT COUNT(*),AVG(t2.unique1) FROM tenk1 t1,
8787
LATERAL (SELECT t2.unique1 FROM tenk1 t2
88-
WHERE t1.twenty = t2.unique1ORDER BY 1) t2
88+
WHERE t1.twenty = t2.unique1OFFSET 0) t2
8989
WHERE t1.unique1 < 1000;
9090
count | avg
9191
-------+--------------------

‎src/test/regress/sql/memoize.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ WHERE t2.unique1 < 1000;
4848
SELECT explain_memoize('
4949
SELECT COUNT(*),AVG(t2.unique1) FROM tenk1 t1,
5050
LATERAL (SELECT t2.unique1 FROM tenk1 t2
51-
WHERE t1.twenty = t2.unique1ORDER BY 1) t2
51+
WHERE t1.twenty = t2.unique1OFFSET 0) t2
5252
WHERE t1.unique1 < 1000;', false);
5353

5454
-- And check we get the expected results.
5555
SELECTCOUNT(*),AVG(t2.unique1)FROM tenk1 t1,
5656
LATERAL (SELECTt2.unique1FROM tenk1 t2
57-
WHEREt1.twenty=t2.unique1ORDER BY1) t2
57+
WHEREt1.twenty=t2.unique1OFFSET0) t2
5858
WHEREt1.unique1<1000;
5959

6060
-- Reduce work_mem and hash_mem_multiplier so that we see some cache evictions

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp