Skip to main content

Compare / vitess-sqlparser

vitess-sqlparser alternative: GoSQLX compared

The Vitess sqlparser (vitess.io/vitess/go/vt/sqlparser) is the MySQL parser used by Vitess, written in Go.

Approach
yacc-generated MySQL grammar inside the Vitess module
Dialect
MySQL
CGo required
No

Pick vitess-sqlparser when

  • You target MySQL and want the parser that powers Vitess, including its MySQL-specific AST and rewriting tools.
  • You already depend on the Vitess module for sharding or routing.
  • Your queries are MySQL only and you want the parser the MySQL ecosystem in Go builds on.

Pick GoSQLX when

  • You need more than MySQL: PostgreSQL, SQL Server, Oracle, SQLite, Snowflake and ClickHouse dialects as well.
  • You want a standalone parser module instead of importing a subpackage of a large project.
  • You want formatter, linter, security scanner and IDE tooling alongside the parser.

Parse speed, measured

End-to-end stage (SQL text to AST) · AMD EPYC 9V74 80-Core Processor (linux/amd64) · go1.26.9 · median of 10 runs · measured 2026-11-28 · Vitess sqlparser v0.24.5. Lower is faster.

QueryGoSQLXVitess sqlparser
Simple SELECT992 ns1,603 ns
SELECT with WHERE, ORDER BY, LIMIT2,644 ns3,678 ns
Two-table JOIN3,556 ns4,759 ns
GROUP BY with HAVING2,659 ns3,182 ns
IN subquery2,289 ns3,935 ns
Common table expression3,290 ns4,509 ns
Window function2,128 ns3,798 ns
Multi-JOIN analytical query9,279 ns12,214 ns
INSERT VALUES1,739 ns2,192 ns
UPDATE with WHERE1,535 ns2,068 ns
DELETE with WHERE963 ns1,320 ns

Read with care. The libraries implement different SQL dialects and build different ASTs (pg_query_go wraps the real PostgreSQL parser through CGo and converts its tree to Go structs; Vitess, TiDB and xwb1989 implement MySQL grammars). Each figure is the end-to-end cost of turning the same SQL text into that library's AST on the stated hardware, not identical work. Results vary by query, so check the rows that resemble your workload.

Full table, methodology and reproduce steps: competitor benchmarks. Source: benchmarks/compare/results/latest.json, commit 1990a11.

What GoSQLX offers

Pure Go with no CGo, 8 dialects, 30 built-in lint rules, a formatter, a SQL injection scanner, an LSP server and an MCP server. Requires Go 1.26+.

Full feature matrix