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

docs/design: add design doc for index usage information #20316

Closed
wants to merge 4 commits into from

Conversation

rebelice
Copy link
Contributor

What problem does this PR solve?

Proposed a design doc for index usage information

Issue Number: related to #19209

Release note

  • Supported index usage information collection.

@rebelice
Copy link
Contributor Author

/cc @zz-jason, @qw4990

);
```

Because the max length of schema name, table name and index name is 64, so we use `varchar(64)`. The documentation is [here](https://dev.mysql.com/doc/refman/5.7/en/identifier-length.html).
Copy link
Member

Choose a reason for hiding this comment

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

could you change the link to TiDB user doc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did not find relevant information in TiDB user doc.

Co-authored-by: Zhang Jian <zjsariel@gmail.com>
@ti-srebot
Copy link
Contributor

@rebelice,Thanks for your review. The bot only counts LGTMs from Reviewers and higher roles, but you're still welcome to leave your comments.You are not a reviewer or committer or co-leader or leader.

| TABLE_NAME | varchar | Name of the table or view on which the index is defined.|
| INDEX_NAME | varchar | Name of the index.|
| QUERY_COUNT | longlong | Number of the SQL using this index.|
| ROWS_SELECTED| longlong | Number of rows read from the index. We can check the selectivity of the index through `ROWS_READ` / `QUERY_COUNT`.|
Copy link
Contributor

Choose a reason for hiding this comment

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

I doubt that ROWS_READ / QUERY_COUNT means the selectivity of the index.
A QUERY_COUNT may lead many of ROWS_READ, ROWS_READ / QUERY_COUNT just means the average fetched rows count of each query.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, I will change its description.

@ti-srebot
Copy link
Contributor

@rebelice,Thanks for your review. The bot only counts LGTMs from Reviewers and higher roles, but you're still welcome to leave your comments.You are not a reviewer or committer or co-leader or leader.


### SCHEMA_UNUSED_INDEXES

Due to MySQL compatibility, add the system table `SCHEMA_UNUSED_INDEXES`.
Copy link
Contributor

Choose a reason for hiding this comment

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

MySQL's SCHEMA_UNUSED_INDEXES is under SYS database, should we also be compatible with that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds reasonable. But I think create a SYS database is a big issue and may need to be discussed as a new, separate matter. What do you think?

@ti-srebot
Copy link
Contributor

@rebelice,Thanks for your review. The bot only counts LGTMs from Reviewers and higher roles, but you're still welcome to leave your comments.You are not a reviewer or committer or co-leader or leader.

@zz-jason
Copy link
Member

zz-jason commented Feb 9, 2021

I'm going to close this PR since it hasn't been updated for a long time. feel free to reopen if you want to continue with it. thank you for your contribution.

@zz-jason zz-jason closed this Feb 9, 2021
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.

4 participants