Skip to content

Stable13. Fix joins counting. #151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion expected/aqo_fdw.out
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ SELECT str FROM expln('
AQO not used
Using aqo: true
AQO mode: LEARN
JOINS: 0
JOINS: 1
(14 rows)

-- Should learn on postgres_fdw nodes
Expand Down
4 changes: 2 additions & 2 deletions expected/feature_subspace.out
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ WHERE str NOT LIKE '%Memory%';
AQO not used
Using aqo: true
AQO mode: LEARN
JOINS: 0
JOINS: 1
(14 rows)

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

-- Look into the reason: two JOINs from different classes have the same FSS.
Expand Down
20 changes: 10 additions & 10 deletions expected/look_a_like.out
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ WHERE str NOT LIKE 'Query Identifier%' and str NOT LIKE '%Memory%' and str NOT L
Rows Removed by Filter: 900
Using aqo: true
AQO mode: LEARN
JOINS: 0
JOINS: 1
(16 rows)

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

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

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

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

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

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

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

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

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

RESET aqo.wide_search;
Expand Down
2 changes: 1 addition & 1 deletion expected/unsupported.out
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ SELECT * FROM
Filter: (x > 20)
Using aqo: true
AQO mode: LEARN
JOINS: 0
JOINS: 1
(13 rows)

-- AQO needs to predict total fetched tuples in a table.
Expand Down
2 changes: 1 addition & 1 deletion postprocessing.c
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ StorePlanInternals(QueryDesc *queryDesc)
MemoryContext oldctx = MemoryContextSwitchTo(AQOCacheMemCtx);

njoins = 0;
planstate_tree_walker(queryDesc->planstate, calculateJoinNum, &njoins);
calculateJoinNum(queryDesc->planstate, &njoins);

if (queryDesc->queryEnv == NULL)
queryDesc->queryEnv = create_queryEnv();
Expand Down