-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
plan,executor: support IndexJoin over UnionScan #7877
Changes from 5 commits
b05ba97
e71c27b
2762869
f1be653
6259fed
7b4b517
1450d4a
108e03d
70eda5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,6 +77,11 @@ func (p *LogicalTableDual) findBestTask(prop *property.PhysicalProperty) (task, | |
|
||
// findBestTask implements LogicalPlan interface. | ||
func (p *baseLogicalPlan) findBestTask(prop *property.PhysicalProperty) (bestTask task, err error) { | ||
// If p is an inner plan in an IndexJoin, the IndexJoin will generate an inner plan by itself, | ||
// and set inner child prop nil, so here we do nothing. | ||
if prop == nil { | ||
return nil, nil | ||
} | ||
// Look up the task with this prop in the task map. | ||
// It's used to reduce double counting. | ||
bestTask = p.getTask(prop) | ||
|
@@ -199,10 +204,8 @@ func (ds *DataSource) tryToGetDualTask() (task, error) { | |
// findBestTask implements the PhysicalPlan interface. | ||
// It will enumerate all the available indices and choose a plan with least cost. | ||
func (ds *DataSource) findBestTask(prop *property.PhysicalProperty) (t task, err error) { | ||
// If ds is an inner plan in an IndexJoin, the IndexJoin will generate an inner plan by itself. | ||
// So here we do nothing. | ||
// TODO: Add a special prop to handle IndexJoin's inner plan. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have thought about adding this special prop in this patch, and then realized that current solution using nil for quick return is clear enough, so I removed this TODO. |
||
// Then we can remove forceToTableScan and forceToIndexScan. | ||
// If ds is an inner plan in an IndexJoin, the IndexJoin will generate an inner plan by itself, | ||
// and set inner child prop nil, so here we do nothing. | ||
if prop == nil { | ||
return nil, nil | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
465-473 and 516-524 maybe can extract a method, except this LGTM