-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
vttablet: benchmarks and two small optimizations #7560
Conversation
Signed-off-by: Vicent Marti <vmg@strn.cat>
Calling `cp.MysqlParams` once per event is really wasteful because it must prepare a Parameters struct including all the authentication credentials for the connection. We only need the active database name to process the event, so ask just for that. Signed-off-by: Vicent Marti <vmg@strn.cat>
There is a bad merge in this code that is causing `ReloadAt` to be called two times in a row. Previously, the schema was _always_ being reloaded when parsing a DDL statement. @sougou changed this so the schema only reloads when the statement must be sent upstream, but then Rohit brought back the functionality of _always_ reloading the DDL without removing the case where we were already reloading for sent statements. Signed-off-by: Vicent Marti <vmg@strn.cat>
// Reload schema only if the DDL change is relevant. | ||
// TODO(sougou): move this back to always load after | ||
// the schema reload bug is fixed. | ||
vs.se.ReloadAt(context.Background(), vs.pos) |
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.
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.
@vmg, yes this can be removed. I thought I had already removed the duplication, thanks for catching this.
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.
Nice catch! The call should be removed.
@@ -481,7 +472,7 @@ func (vs *vstreamer) parseEvent(ev mysql.BinlogEvent) ([]*binlogdatapb.VEvent, e | |||
} | |||
vs.se.ReloadAt(context.Background(), vs.pos) |
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.
Note that the call is duplicated here.
Description
This is a small benchmark suite for
vttablet
queries which I've started running to find hotspots.So far, I found two fixes that are trivial and give a measurable improvement in the flame graphs.
vstreamer
is hot!Related Issue(s)
Checklist
Deployment Notes
Impacted Areas in Vitess
Components that this PR will affect: