dolthub / dolthub/dolt

Filters referencing outerscope columns shouldn't always be pushed down in SubqueryAliases

Open
#10,490 0 comments 0 reactions 0 assignees View on GitHub
analyzer performance
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 5h
Merged PRs (30d)
108

Description

We started pushing filters from outerscope/correlated columns into SubqueryAliases so we can use the outerscope column value as a key for an IndexedTableAccess.

But in some cases, this actually makes the query execution slower because the filter doesn't match any keys and a cacheable SQA now becomes uncacheable.

We should probably move pushing outerscope filters into the join planning phase so we can use cost estimates to see if doing so actually makes a query faster.

We should also be wary of pushing outerscope columns into SQAs built from a CTE or RecursiveCTE. This might cause correctness issues.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.