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
Do not load table stats when booting vttablet
.
#15715
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Unit Tests are failing, those need to be fixed as the test expectation about the query have changed. |
Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
…/do-not-load-stats-at-boot Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #15715 +/- ##
==========================================
+ Coverage 68.40% 68.45% +0.05%
==========================================
Files 1556 1559 +3
Lines 195121 196515 +1394
==========================================
+ Hits 133479 134532 +1053
- Misses 61642 61983 +341 ☔ View full report in Codecov by Sentry. |
Description
As part of the bootup process,
vttablet
reloads the schema engine, with table statistics information like table size, via theBaseShowTablesWithSizes
query. This query is relatively expensive, but calling it once onvttablet
bootup doesn't really seem much like an issue in production environments.But in
vtcombo
, where a lot ofvttablet
instances are booted up on startup, all theseBaseShowTablesWithSizes
calls can add up, especially when there's a lot of tables / tablespaces.In our CI system, where we use
vtcombo
, just the process of startingvtcombo
on MySQL 8.0 takes 70 (!) seconds. On MySQL 5.7, it takes 26 seconds.I already prepared a PR to halve the cost of running
BaseShowTablesWithSizes
on MySQL 8.0. But you know what's even better than halving the cost of this query? Not even running it in the first place!This pull request proposes to skip the table size collection when booting up
vttablet
. This will improve the startup time, with virtually no negative side effect. The table statistics will be collected during the next regular schema engine reload interval.This brings
vtcombo
bootup time in our CI system down to roughly 15 seconds, both on MySQL 5.7 and MySQL 8.0.I'd really love to see this backported, because it's a massive performance improvement for everyone using
vtcombo
without any noticeable negative side effects, and it'd reduce the amount of patches I need to juggle until we get to a more recent version of Vitess. 😬Related Issue(s)
Checklist
Deployment Notes