Skip to content

Commit dcc5ec2

Browse files
Daniil AnisimovAlena0704
authored andcommitted
Bugfix. Correctly use of a routine for joins counting.
1 parent 8920615 commit dcc5ec2

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

expected/aqo_fdw.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ SELECT str FROM expln('
120120
AQO not used
121121
Using aqo: true
122122
AQO mode: LEARN
123-
JOINS: 0
123+
JOINS: 1
124124
(14 rows)
125125

126126
-- Should learn on postgres_fdw nodes

expected/feature_subspace.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ WHERE str NOT LIKE '%Memory%';
4343
AQO not used
4444
Using aqo: true
4545
AQO mode: LEARN
46-
JOINS: 0
46+
JOINS: 1
4747
(14 rows)
4848

4949
-- TODO: Using method of other classes neighbours we get a bad estimation.
@@ -66,7 +66,7 @@ WHERE str NOT LIKE '%Memory%';
6666
AQO not used
6767
Using aqo: true
6868
AQO mode: LEARN
69-
JOINS: 0
69+
JOINS: 1
7070
(14 rows)
7171

7272
-- Look into the reason: two JOINs from different classes have the same FSS.

expected/look_a_like.out

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ WHERE str NOT LIKE 'Query Identifier%' and str NOT LIKE '%Memory%' and str NOT L
5656
Rows Removed by Filter: 900
5757
Using aqo: true
5858
AQO mode: LEARN
59-
JOINS: 0
59+
JOINS: 1
6060
(16 rows)
6161

6262
SELECT str AS result
@@ -83,7 +83,7 @@ WHERE str NOT LIKE 'Query Identifier%' and str NOT LIKE '%Memory%' and str NOT L
8383
Rows Removed by Filter: 900
8484
Using aqo: true
8585
AQO mode: LEARN
86-
JOINS: 0
86+
JOINS: 1
8787
(19 rows)
8888

8989
SELECT str AS result
@@ -108,7 +108,7 @@ WHERE str NOT LIKE 'Query Identifier%' and str NOT LIKE '%Memory%' and str NOT L
108108
Rows Removed by Filter: 500
109109
Using aqo: true
110110
AQO mode: LEARN
111-
JOINS: 0
111+
JOINS: 1
112112
(17 rows)
113113

114114
--query contains nodes that have already been predicted
@@ -134,7 +134,7 @@ WHERE str NOT LIKE 'Query Identifier%' and str NOT LIKE '%Memory%' and str NOT L
134134
Rows Removed by Filter: 500
135135
Using aqo: true
136136
AQO mode: LEARN
137-
JOINS: 0
137+
JOINS: 1
138138
(17 rows)
139139

140140
SELECT str AS result
@@ -159,7 +159,7 @@ WHERE str NOT LIKE 'Query Identifier%' and str NOT LIKE '%Memory%' and str NOT L
159159
Rows Removed by Filter: 300
160160
Using aqo: true
161161
AQO mode: LEARN
162-
JOINS: 0
162+
JOINS: 1
163163
(17 rows)
164164

165165
SELECT str AS result
@@ -184,7 +184,7 @@ WHERE str NOT LIKE 'Query Identifier%' and str NOT LIKE '%Memory%' and str NOT L
184184
Rows Removed by Filter: 600
185185
Using aqo: true
186186
AQO mode: LEARN
187-
JOINS: 0
187+
JOINS: 1
188188
(17 rows)
189189

190190
SELECT str AS result
@@ -209,7 +209,7 @@ WHERE str NOT LIKE 'Query Identifier%' and str NOT LIKE '%Memory%' and str NOT L
209209
Rows Removed by Filter: 500
210210
Using aqo: true
211211
AQO mode: LEARN
212-
JOINS: 0
212+
JOINS: 1
213213
(17 rows)
214214

215215
--query contains nodes that have already been predicted
@@ -235,7 +235,7 @@ WHERE str NOT LIKE 'Query Identifier%' and str NOT LIKE '%Memory%' and str NOT L
235235
Rows Removed by Filter: 600
236236
Using aqo: true
237237
AQO mode: LEARN
238-
JOINS: 0
238+
JOINS: 1
239239
(17 rows)
240240

241241
SELECT str AS result
@@ -516,7 +516,7 @@ WHERE str NOT LIKE 'Query Identifier%' and str NOT LIKE '%Memory%' and str NOT L
516516
Output: b.y1, b.y2, b.y3
517517
Using aqo: true
518518
AQO mode: LEARN
519-
JOINS: 1
519+
JOINS: 2
520520
(24 rows)
521521

522522
SELECT str AS result
@@ -548,7 +548,7 @@ WHERE str NOT LIKE 'Query Identifier%' and str NOT LIKE '%Memory%' and str NOT L
548548
Output: c.z1, c.z2, c.z3
549549
Using aqo: true
550550
AQO mode: LEARN
551-
JOINS: 1
551+
JOINS: 2
552552
(24 rows)
553553

554554
RESET aqo.wide_search;

expected/unsupported.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ SELECT * FROM
487487
Filter: (x > 20)
488488
Using aqo: true
489489
AQO mode: LEARN
490-
JOINS: 0
490+
JOINS: 1
491491
(13 rows)
492492

493493
-- AQO needs to predict total fetched tuples in a table.

postprocessing.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ StorePlanInternals(QueryDesc *queryDesc)
916916
MemoryContext oldctx = MemoryContextSwitchTo(AQOCacheMemCtx);
917917

918918
njoins = 0;
919-
planstate_tree_walker(queryDesc->planstate, calculateJoinNum, &njoins);
919+
calculateJoinNum(queryDesc->planstate, &njoins);
920920

921921
if (queryDesc->queryEnv == NULL)
922922
queryDesc->queryEnv = create_queryEnv();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy