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

Add info about slow query tables #262

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dveeden
Copy link
Contributor

@dveeden dveeden commented Dec 6, 2024

What is changed:

This adds information on the workings of the SLOW_QUERY and CLUSTER_SLOW_QUERY tables.

Comment on lines +64 to +66
The protobuf messages are defined in [`diagnosticspb.proto`](https://github.com/pingcap/kvproto/blob/master/proto/diagnosticspb.proto) in the `pingcap/kvproto` repo. Key messages are `SearchLogRequest` and `SearchLogResponse`.

This table uses the [`clusterLogRetriever`](https://github.com/pingcap/tidb/blob/1521bf723dd023da655add0f883acaab5ee69683/pkg/executor/memtable_reader.go#L361) with the [`ClusterLogTableExtractor`](https://github.com/pingcap/tidb/blob/1521bf723dd023da655add0f883acaab5ee69683/pkg/planner/core/memtable_predicate_extractor.go#L756).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These descriptions are not quite right, CLUSTER_SLOW_QUERY is actually implemented through the coprocessor grpc interface, which is the same as a normal cop request, except that it sends the cop request to the TiDB node, which allows for the reuse of query conditions push down and column prune, to reduces transfer unnecessary data.

https://github.com/pingcap/tidb/blob/f347b9d334495c72d27c53532dfef522213dbaac/pkg/store/copr/coprocessor.go#L594

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants