-
Notifications
You must be signed in to change notification settings - Fork 3
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 transaction information to summary #71
Conversation
… file Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
fc3fe49
to
63d3714
Compare
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The refactor looks so good!
|
||
for i, tx := range transactions { | ||
var tables []string | ||
for _, query := range tx.Queries { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be inefficient for large number of queries. The usual pattern of using a map to check existence might be faster.
"github.com/vitessio/vt/go/markdown" | ||
) | ||
|
||
func renderHotQueries(md *markdown.MarkDown, queries []keys.QueryAnalysisResult, metricReader getMetric) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should think about using a template library like text/html
to generate the markdown. That approach has worked well for me in the past.
Overview
Enhances the Markdown report generated by
vt summarize
by incorporating transaction pattern analysis fromvt transactions
JSON output.This enhancement analyzes transaction patterns with a focus on identifying meaningful relationships for sharding key decisions. The analysis specifically targets patterns where queries share predicate values, filtering out patterns that don't contribute to sharding strategy insights.
Here follows an example of this section in the report:
Transaction Patterns
Pattern 1 (Observed 46 times)
Tables Involved: craftable_timesheets, pos_dailies, pos_tickets
Query Patterns
DELETE on
craftable_timesheets
Predicates: craftable_timesheets.store_id = 0 AND craftable_timesheets.rpt_date = 1 AND craftable_timesheets.intraday = 2
DELETE on
pos_tickets
Predicates: pos_tickets.store_id = 0 AND pos_tickets.rpt_date = 1 AND pos_tickets.intraday = 2
DELETE on
pos_dailies
Predicates: pos_dailies.store_id = 0 AND pos_dailies.rpt_date = 1 AND pos_dailies.intraday = 2
Shared Predicate Values