-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Fix: Improve VDiff internal query performance #18579
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
base: main
Are you sure you want to change the base?
Fix: Improve VDiff internal query performance #18579
Conversation
Signed-off-by: Arthur Schreiber <[email protected]>
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
|
Signed-off-by: Arthur Schreiber <[email protected]>
Signed-off-by: Arthur Schreiber <[email protected]>
Here's an explain plan for the example query from #18578 with the new schema, showing that we're no longer doing any full table scans: {
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "1.05"
},
"nested_loop": [
{
"table": {
"table_name": "vd",
"access_type": "index",
"possible_keys": [
"PRIMARY"
],
"key": "state",
"used_key_parts": [
"state"
],
"key_length": "67",
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "0.25",
"eval_cost": "0.10",
"prefix_cost": "0.35",
"data_read_per_join": "4K"
},
"used_columns": [
"id"
]
}
},
{
"table": {
"table_name": "vdt",
"access_type": "ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"vdiff_id"
],
"key_length": "8",
"ref": [
"_vt.vd.id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "0.25",
"eval_cost": "0.10",
"prefix_cost": "0.70",
"data_read_per_join": "2K"
},
"used_columns": [
"vdiff_id"
]
}
},
{
"table": {
"table_name": "vdl",
"access_type": "ref",
"possible_keys": [
"vdiff_id_idx"
],
"key": "vdiff_id_idx",
"used_key_parts": [
"vdiff_id"
],
"key_length": "8",
"ref": [
"_vt.vd.id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "0.25",
"eval_cost": "0.10",
"prefix_cost": "1.05",
"data_read_per_join": "32"
},
"used_columns": [
"vdiff_id"
]
}
}
]
}
} |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #18579 +/- ##
==========================================
- Coverage 67.52% 67.49% -0.03%
==========================================
Files 1607 1607
Lines 263324 263324
==========================================
- Hits 177803 177741 -62
- Misses 85521 85583 +62 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
This pull request intends to improve the performance of some of the queries executed by VDiff against the internal sidecar database.
These changes should be backported as the symptoms of the bad query performance can lead to grave issues (like crashing primary vttablets) when running VDiff.
Related Issue(s)
#18578
Checklist
Deployment Notes