Skip to content

Commit

Permalink
perf: avoid extra allocs by restricting normalization for certain SQL…
Browse files Browse the repository at this point in the history
…Node

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
  • Loading branch information
harshit-gangal committed Feb 27, 2025
1 parent 6c1dfe2 commit 7949d15
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion go/vt/sqlparser/normalizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ func (nz *normalizer) determineQueryRewriteStrategy(in Statement) {
// It handles normalization logic based on node types.
func (nz *normalizer) walkDown(node, _ SQLNode) bool {
switch node := node.(type) {
case *PrepareStmt, *ExecuteStmt:
case *Begin, *Commit, *Rollback, *Savepoint, *SRollback, *Release, *OtherAdmin, *Analyze,
*PrepareStmt, *ExecuteStmt, *FramePoint, *ColName, TableName, *ConvertType:
// These statement do not need normalizing
return false
case *AssignmentExpr:
nz.err = vterrors.VT12001("Assignment expression")
Expand Down

0 comments on commit 7949d15

Please sign in to comment.