Skip to content

Use selectivity in LookupJoin cost estimate #3099

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

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e5e03b2
made lookup join cost estimate function more similar to previous func…
angelamayxie Jul 15, 2025
12ad271
updated join planning test
angelamayxie Jul 15, 2025
a5d46f4
addressed jason's comments
angelamayxie Jul 16, 2025
0068f9e
[ga-format-pr] Run ./format_repo.sh to fix formatting
angelamayxie Jul 16, 2025
7a77707
use selfJoinCard for expectedRightRows estimate
angelamayxie Jul 16, 2025
a742710
Merge branch 'angela/pk_join' of https://github.com/dolthub/go-mysql-…
angelamayxie Jul 16, 2025
ed95289
Update query plans: MergeJoin → SemiLookupJoin with cost improvements
angelamayxie Jul 17, 2025
593de42
Update LeftOuterMergeJoin to LeftOuterLookupJoin (partial)
angelamayxie Jul 17, 2025
cb03dc6
Progress on query plan test fixes: 838 → 804 failures
angelamayxie Jul 17, 2025
6867d1d
last claude commit before i manually update these tests :(
angelamayxie Jul 17, 2025
ff7f595
[ga-format-pr] Run ./format_repo.sh to fix formatting
angelamayxie Jul 17, 2025
0aa88ab
delete files that claude made
angelamayxie Jul 17, 2025
226f5d4
Merge branch 'main' of https://github.com/dolthub/go-mysql-server int…
angelamayxie Jul 17, 2025
a399c93
clean up
angelamayxie Jul 17, 2025
09a4aaa
Merge branch 'angela/pk_join' of https://github.com/dolthub/go-mysql-…
angelamayxie Jul 17, 2025
34dc43d
asdf
angelamayxie Jul 17, 2025
f208c11
updated query plan test using script
angelamayxie Jul 17, 2025
20d5e94
Merge branch 'main' of https://github.com/dolthub/go-mysql-server int…
angelamayxie Jul 23, 2025
5c2e4da
use fanout in lookup join estimates
angelamayxie Jul 24, 2025
57cb8d2
use selfJoinCard to calculate expectedRightRows
angelamayxie Jul 24, 2025
86cbaca
adjust fanout factor
angelamayxie Jul 24, 2025
c7748f7
incorporate index coverage adjustment into lookup join estimate
angelamayxie Jul 25, 2025
cfb9c68
adjust coster to use seqIOCostFactor
angelamayxie Jul 25, 2025
2456c48
merge with main
angelamayxie Jul 25, 2025
0e81b75
adjust cost factors, move parentheses to correct place
angelamayxie Jul 29, 2025
cdba178
merged with main
angelamayxie Aug 4, 2025
d1a637d
adjust index covereage adjustment
angelamayxie Aug 4, 2025
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
6 changes: 3 additions & 3 deletions enginetest/join_planning_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ var JoinPlanningTests = []joinPlanScript{
{
// When primary table is much larger, doing many lookups is expensive: prefer merge
q: "select /*+ JOIN_ORDER(rs, xy) */ * from rs join xy on x = r order by 1,3",
types: []plan.JoinType{plan.JoinTypeLookup},
types: []plan.JoinType{plan.JoinTypeMerge},
exp: []sql.Row{{0, 0, 0, 8}, {2, 3, 2, 1}, {3, 0, 3, 7}, {4, 8, 4, 0}, {5, 4, 5, 4}},
},
{
Expand Down Expand Up @@ -411,7 +411,7 @@ var JoinPlanningTests = []joinPlanScript{
},
{
q: "select * from xy where y+1 not in (select u from uv);",
types: []plan.JoinType{plan.JoinTypeLeftOuterHashExcludeNulls},
types: []plan.JoinType{plan.JoinTypeLeftOuterLookup},
exp: []sql.Row{{3, 3}},
},
{
Expand Down Expand Up @@ -822,7 +822,7 @@ where u in (select * from rec);`,
tests: []JoinPlanTest{
{
q: "select * from xy where x in (select u from uv join ab on u = a and a = 2) order by 1;",
types: []plan.JoinType{plan.JoinTypeInner, plan.JoinTypeLookup},
types: []plan.JoinType{plan.JoinTypeLookup, plan.JoinTypeLookup},
exp: []sql.Row{{2, 1}},
},
{
Expand Down
46,103 changes: 23,180 additions & 22,923 deletions enginetest/queries/imdb_plans.go

Large diffs are not rendered by default.

6,052 changes: 2,654 additions & 3,398 deletions enginetest/queries/integration_plans.go

Large diffs are not rendered by default.

8,013 changes: 3,482 additions & 4,531 deletions enginetest/queries/query_plans.go

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions enginetest/queries/tpcc_plans.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading