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

Commit3409b4d

Browse files
committed
Remove one memoize test case added by commit069d0ff.
This test case turns out to depend on the assumption that a non-Varsubquery output that's underneath an outer join will always getwrapped in a PlaceHolderVar. But that behavior causes performanceregressions in some cases compared to what happened before v16.The next commit will avoid inserting a PHV in the same cases wherepre-v16 did, and that causes get_memoized_path to not detect thata memoize plan could be used.Commit this separately, in hopes that we can restore the test aftermaking get_memoized_path smarter. (It's failing to find memoizeplans in adjacent cases where no PHV was ever inserted, so thereis definitely room for improvement there.)Discussion:https://postgr.es/m/CAG1ps1xvnTZceKK24OUfMKLPvDP2vjT-d+F2AOCWbw_v3KeEgg@mail.gmail.com
1 parentc39afc3 commit3409b4d

File tree

2 files changed

+0
-41
lines changed

2 files changed

+0
-41
lines changed

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

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -160,36 +160,6 @@ WHERE s.c1 = s.c2 AND t1.unique1 < 1000;
160160
1000 | 9.5000000000000000
161161
(1 row)
162162

163-
-- Try with LATERAL references within PlaceHolderVars
164-
SELECT explain_memoize('
165-
SELECT COUNT(*), AVG(t1.twenty) FROM tenk1 t1 LEFT JOIN
166-
LATERAL (SELECT t1.two+t2.two AS c1, t2.unique1 AS c2 FROM tenk1 t2) s ON TRUE
167-
WHERE s.c1 = s.c2 AND t1.unique1 < 1000;', false);
168-
explain_memoize
169-
--------------------------------------------------------------------------------------
170-
Aggregate (actual rows=1 loops=N)
171-
-> Nested Loop (actual rows=1000 loops=N)
172-
-> Seq Scan on tenk1 t1 (actual rows=1000 loops=N)
173-
Filter: (unique1 < 1000)
174-
Rows Removed by Filter: 9000
175-
-> Memoize (actual rows=1 loops=N)
176-
Cache Key: t1.two
177-
Cache Mode: binary
178-
Hits: 998 Misses: 2 Evictions: Zero Overflows: 0 Memory Usage: NkB
179-
-> Seq Scan on tenk1 t2 (actual rows=1 loops=N)
180-
Filter: ((t1.two + two) = unique1)
181-
Rows Removed by Filter: 9999
182-
(12 rows)
183-
184-
-- And check we get the expected results.
185-
SELECT COUNT(*), AVG(t1.twenty) FROM tenk1 t1 LEFT JOIN
186-
LATERAL (SELECT t1.two+t2.two AS c1, t2.unique1 AS c2 FROM tenk1 t2) s ON TRUE
187-
WHERE s.c1 = s.c2 AND t1.unique1 < 1000;
188-
count | avg
189-
-------+--------------------
190-
1000 | 9.0000000000000000
191-
(1 row)
192-
193163
-- Ensure we do not omit the cache keys from PlaceHolderVars
194164
SELECT explain_memoize('
195165
SELECT COUNT(*), AVG(t1.twenty) FROM tenk1 t1 LEFT JOIN

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,6 @@ SELECT COUNT(*), AVG(t1.twenty) FROM tenk1 t1 LEFT JOIN
8585
LATERAL (SELECTt1.two+1AS c1,t2.unique1AS c2FROM tenk1 t2) sON TRUE
8686
WHEREs.c1=s.c2ANDt1.unique1<1000;
8787

88-
-- Try with LATERAL references within PlaceHolderVars
89-
SELECT explain_memoize('
90-
SELECT COUNT(*), AVG(t1.twenty) FROM tenk1 t1 LEFT JOIN
91-
LATERAL (SELECT t1.two+t2.two AS c1, t2.unique1 AS c2 FROM tenk1 t2) s ON TRUE
92-
WHERE s.c1 = s.c2 AND t1.unique1 < 1000;', false);
93-
94-
-- And check we get the expected results.
95-
SELECTCOUNT(*),AVG(t1.twenty)FROM tenk1 t1LEFT JOIN
96-
LATERAL (SELECTt1.two+t2.twoAS c1,t2.unique1AS c2FROM tenk1 t2) sON TRUE
97-
WHEREs.c1=s.c2ANDt1.unique1<1000;
98-
9988
-- Ensure we do not omit the cache keys from PlaceHolderVars
10089
SELECT explain_memoize('
10190
SELECT COUNT(*), AVG(t1.twenty) FROM tenk1 t1 LEFT JOIN

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp