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

Commita3a836f

Browse files
committed
Attempt to fix newly added Memoize regression test
Both drongo and fairywren seem not to like a new regression test addedby2cca95e. These machines show a different number of actual rows inthe EXPLAIN ANALYZE output. Since the number of actual rows is divided bythe number of loops, I suspect this might be due to some platformdependant rounding behavior as the total row count is 5 and the number ofloops is 2. drongo and fairywren seem to be calculating that 5.0 / 2.0 is3, whereas most other machines think the answer is 2.Here we tweak the test query's WHERE clause so it's 4.0 / 2.0 instead.There shouldn't be too much wiggle room for platform dependant-behavior tobe a factor with those numbers.Reported-by: Tom LaneDiscussion:https://postgr.es/m/1035225.1706301718%40sss.pgh.pa.us
1 parent5e444a2 commita3a836f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ WHERE t1.unique1 < 1000;
9696
SELECT explain_memoize('
9797
SELECT COUNT(*),AVG(t2.t1two) FROM tenk1 t1 LEFT JOIN
9898
LATERAL (
99-
SELECT t1.two as t1two, * FROM tenk1 t2 WHERE t2.unique1 <5 OFFSET 0
99+
SELECT t1.two as t1two, * FROM tenk1 t2 WHERE t2.unique1 <4 OFFSET 0
100100
) t2
101101
ON t1.two = t2.two
102102
WHERE t1.unique1 < 10;', false);
103103
explain_memoize
104104
----------------------------------------------------------------------------------------------
105105
Aggregate (actual rows=1 loops=N)
106-
-> Nested Loop Left Join (actual rows=25 loops=N)
106+
-> Nested Loop Left Join (actual rows=20 loops=N)
107107
-> Index Scan using tenk1_unique1 on tenk1 t1 (actual rows=10 loops=N)
108108
Index Cond: (unique1 < 10)
109109
-> Memoize (actual rows=2 loops=N)
@@ -113,20 +113,20 @@ WHERE t1.unique1 < 10;', false);
113113
-> Subquery Scan on t2 (actual rows=2 loops=N)
114114
Filter: (t1.two = t2.two)
115115
Rows Removed by Filter: 2
116-
-> Index Scan using tenk1_unique1 on tenk1 t2_1 (actual rows=5 loops=N)
117-
Index Cond: (unique1 <5)
116+
-> Index Scan using tenk1_unique1 on tenk1 t2_1 (actual rows=4 loops=N)
117+
Index Cond: (unique1 <4)
118118
(13 rows)
119119

120120
-- And check we get the expected results.
121121
SELECT COUNT(*),AVG(t2.t1two) FROM tenk1 t1 LEFT JOIN
122122
LATERAL (
123-
SELECT t1.two as t1two, * FROM tenk1 t2 WHERE t2.unique1 <5 OFFSET 0
123+
SELECT t1.two as t1two, * FROM tenk1 t2 WHERE t2.unique1 <4 OFFSET 0
124124
) t2
125125
ON t1.two = t2.two
126126
WHERE t1.unique1 < 10;
127127
count | avg
128128
-------+------------------------
129-
25 | 0.40000000000000000000
129+
20 | 0.50000000000000000000
130130
(1 row)
131131

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ WHERE t1.unique1 < 1000;
6161
SELECT explain_memoize('
6262
SELECT COUNT(*),AVG(t2.t1two) FROM tenk1 t1 LEFT JOIN
6363
LATERAL (
64-
SELECT t1.two as t1two, * FROM tenk1 t2 WHERE t2.unique1 <5 OFFSET 0
64+
SELECT t1.two as t1two, * FROM tenk1 t2 WHERE t2.unique1 <4 OFFSET 0
6565
) t2
6666
ON t1.two = t2.two
6767
WHERE t1.unique1 < 10;', false);
6868

6969
-- And check we get the expected results.
7070
SELECTCOUNT(*),AVG(t2.t1two)FROM tenk1 t1LEFT JOIN
7171
LATERAL (
72-
SELECTt1.twoas t1two,*FROM tenk1 t2WHEREt2.unique1<5 OFFSET0
72+
SELECTt1.twoas t1two,*FROM tenk1 t2WHEREt2.unique1<4 OFFSET0
7373
) t2
7474
ONt1.two=t2.two
7575
WHEREt1.unique1<10;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp