-
Notifications
You must be signed in to change notification settings - Fork 21
Optimize DAG executor building logic with column pruning #203
Conversation
TPCH: DAG: |
Refer to pingcap/tispark#143 |
is this PR fixes #163 |
Thanks. I am trying to figure out which issue this PR can fix. Could you reference that issue in this PR? |
@@ -187,7 +188,11 @@ private DAGRequest buildTableScan() { | |||
TableScan.Builder tblScanBuilder = TableScan.newBuilder(); | |||
|
|||
// Step1. Add columns to first executor | |||
tableInfo.getColumns().forEach(tiColumnInfo -> tblScanBuilder.addColumns(tiColumnInfo.toProto(tableInfo))); | |||
getFields().forEach(tiColumnInfo -> |
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.
remove empty line
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.
Done
@@ -264,13 +278,38 @@ private DAGRequest buildTableScan() { | |||
return request; | |||
} | |||
|
|||
private void setColumnOffsets(TiExpr expr) { |
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.
by seting column offset, tikv can take advantage of it. But my concern is where is the logic in tidb side, I just want to make sure this logic can do the trick.
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.
This may lie in TiDB's schema
(may hard to find in source code...) or TiKV-Client developers' document.
@zhexuany Updated according to comment. |
TPCH: DAG: |
This optimization should fix #195 and may hugely impact TiKV performance. |
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.
LGTM
Modify executors' build logic, now can push down much less column and get the same result.
This change is