Skip to content
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

Support exec summary for normal table / index scan executor. #4598

Merged
merged 15 commits into from May 5, 2019

Conversation

Projects
None yet
5 participants
@breeswish
Copy link
Member

commented Apr 29, 2019

What have you changed? (mandatory)

Based on #4597, this PR supports execution summary in table scan and index scan (normal executor).

What are the type of the changes? (mandatory)

  • New feature (change which adds functionality)

How has this PR been tested? (mandatory)

Manually.

We only support it in table scan, so there is data for table scan (but not stream agg):

mysql> explain analyze select count(*) from authors;
+------------------------+----------+------+------------------------------------------------------------------+----------------------------------+
| id                     | count    | task | operator info                                                    | execution info                   |
+------------------------+----------+------+------------------------------------------------------------------+----------------------------------+
| StreamAgg_16           | 1.00     | root | funcs:count(col_0)                                               | time:4.20312ms, loops:2, rows:1  |
| └─TableReader_17       | 1.00     | root | data:StreamAgg_8                                                 | time:4.195687ms, loops:2, rows:1 |
|   └─StreamAgg_8        | 1.00     | cop  | funcs:count(1)                                                   | time:0ns, loops:0, rows:0        |
|     └─TableScan_15     | 10000.00 | cop  | table:authors, range:[-inf,+inf], keep order:false, stats:pseudo | time:3ms, loops:101, rows:100    |
+------------------------+----------+------+------------------------------------------------------------------+----------------------------------+
4 rows in set (0.01 sec)

Existing exec summary from batch executors of course still work:

mysql> explain analyze select * from authors limit 5;
+------------------------+-------+------+------------------------------------------------------------------+----------------------------------+
| id                     | count | task | operator info                                                    | execution info                   |
+------------------------+-------+------+------------------------------------------------------------------+----------------------------------+
| Limit_7                | 5.00  | root | offset:0, count:5                                                | time:4.301935ms, loops:2, rows:5 |
| └─TableReader_12       | 5.00  | root | data:Limit_11                                                    | time:4.299936ms, loops:1, rows:5 |
|   └─Limit_11           | 5.00  | cop  | offset:0, count:5                                                | time:1ms, loops:1, rows:5        |
|     └─TableScan_10     | 5.00  | cop  | table:authors, range:[-inf,+inf], keep order:false, stats:pseudo | time:1ms, loops:1, rows:32       |
+------------------------+-------+------+------------------------------------------------------------------+----------------------------------+

breeswish added some commits Apr 29, 2019

Rename and move ExecSummary to support non-batch executors
Signed-off-by: Breezewish <breezewish@pingcap.com>
Simplify exec summary to improve performance
Signed-off-by: Breezewish <breezewish@pingcap.com>
Collect execution summary in normal table scan and index scan
Signed-off-by: Breezewish <breezewish@pingcap.com>
Merge remote-tracking branch 'origin/master' into exec_summary_normal/2
Signed-off-by: Breezewish <breezewish@pingcap.com>

@breeswish breeswish referenced this pull request Apr 29, 2019

Merged

Support exec summary for limit executor #4599

1 of 1 task complete

breeswish added some commits Apr 30, 2019

Rename according to comments
Signed-off-by: Breezewish <breezewish@pingcap.com>
@@ -170,6 +186,10 @@ impl<S: Store, T: InnerExecutor> Executor for ScanExecutor<S, T> {
}
}

fn collect_execution_summaries(&mut self, target: &mut [ExecSummary]) {

This comment has been minimized.

Copy link
@rleungx

rleungx May 5, 2019

Member

How about using one function like collect_statistics in batch?

This comment has been minimized.

Copy link
@breeswish

breeswish May 5, 2019

Author Member

It may involve some refinement for existing statistics, which may be not related to this PR. We can do it in future PRs.

@zz-jason
Copy link
Member

left a comment

LGTM

Add execution summary framework for non-batch executors
Signed-off-by: Breezewish <breezewish@pingcap.com>

breeswish added some commits May 5, 2019

Address comments:
- Rename to collect_exec_summary
- Remove unnecessary empty line

Signed-off-by: Breezewish <breezewish@pingcap.com>
Merge branch 'exec_summary_normal/2.5' into exec_summary_normal/3
Signed-off-by: Breezewish <breezewish@pingcap.com>
Merge remote-tracking branch 'origin/master' into exec_summary_normal/3
Signed-off-by: Breezewish <breezewish@pingcap.com>

@breeswish breeswish added the S: LGT1 label May 5, 2019

@mahjonp

This comment has been minimized.

Copy link

commented May 5, 2019

/run-build-image

@rleungx

rleungx approved these changes May 5, 2019

@breeswish

This comment has been minimized.

Copy link
Member Author

commented May 5, 2019

/run-integration-tests

@lonng

lonng approved these changes May 5, 2019

Copy link
Contributor

left a comment

LGTM

@breeswish breeswish merged commit 51fa53f into tikv:master May 5, 2019

5 checks passed

DCO All commits are signed off!
Details
idc-jenkins-ci-tikv/integration-common-test Jenkins job succeeded.
Details
idc-jenkins-ci-tikv/integration-compatibility-test Jenkins job succeeded.
Details
idc-jenkins-ci-tikv/integration-ddl-test Jenkins job succeeded.
Details
idc-jenkins-ci/test Jenkins job succeeded.
Details

@breeswish breeswish deleted the breeswish:exec_summary_normal/3 branch May 5, 2019

jswh added a commit to jswh/tikv that referenced this pull request May 27, 2019

Support exec summary for normal table / index scan executor. (tikv#4598)
Signed-off-by: Breezewish <breezewish@pingcap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.