glunty

SQL Query Explainer

AI-assisted SQL explanation. 5 free per day.

AI-assisted explanations are usually right but not guaranteed. Verify against EXPLAIN output and your actual schema before relying on the explanation for production decisions.

What this tool does

Reads a SQL query and produces a clause-by-clause explanation in plain English. Covers SELECT, FROM, JOINs, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, subqueries, CTEs, and window functions. Flags uncommon or vendor-specific constructs and common bugs (Cartesian products, comparing to NULL with = instead of IS NULL, missing GROUP BY columns). The query is sent for processing and is not stored after the response.

How to use it

Paste a query into the input. Optionally pick a dialect; this helps the model handle vendor-specific syntax correctly. Press Explain. The free tier allows 5 explanations per IP per day.

Common use cases

  • Reading a query from another team's codebase you are about to refactor.
  • Understanding a long generated query from an ORM or a query builder.
  • Spotting an obvious bug (Cartesian, missing GROUP BY) before running an expensive query.
  • Documenting a complex report query in a runbook.
  • Translating an inherited Oracle query to a PostgreSQL equivalent by reading what it actually does.

Common pitfalls

  • The explainer reads structure, not your data. A query that joins on a column with a million-to-one relationship may look fine; whether it is a problem depends on row counts the tool cannot see.
  • Dialect matters. Vendor extensions (PostgreSQL JSON operators, MySQL group_concat, SQL Server CROSS APPLY, BigQuery STRUCT and ARRAY) parse differently across engines. Provide the dialect hint when in doubt.
  • Performance is not the goal here. The explainer covers what the query does. For why it is slow, run EXPLAIN against your actual database and look at index usage and estimated row counts.

Frequently asked questions

Where does my query go?
The query is sent to glunty which forwards it to Anthropic Claude. glunty does not store the query; Anthropic processes it for the duration of the request under Anthropic data-usage policy (no training on API inputs by default). Important: do not paste queries that contain literal data values from sensitive tables (PII, credentials in WHERE clauses, account numbers). Replace literals with placeholders before pasting.
Why does it ask for a dialect?
SQL has many dialects. PostgreSQL JSON operators, MySQL group_concat, SQL Server CROSS APPLY, Oracle hierarchical queries, BigQuery STRUCT and ARRAY, Snowflake QUALIFY all parse differently. Without a hint, the model assumes a generic SQL flavor and may misread vendor extensions as syntax errors. Pick the dialect; the explanation gets more accurate.
Will this explain why a query is slow?
Not directly. The explainer covers what the query does, not its performance. For "why is this slow," run EXPLAIN (PostgreSQL) or the equivalent on your actual database against your actual data. The explainer can flag patterns that often hurt performance (large IN clauses, N+1 patterns in correlated subqueries, missing GROUP BY columns), but only EXPLAIN against real statistics tells you the truth.
Can it spot Cartesian products and accidental cross joins?
Often yes. A FROM a, b without a WHERE linking them, or a JOIN with a missing or wrong predicate, are common patterns the model recognizes. It calls them out in the notes section. Trust the warning when present, but verify against actual row counts: a JOIN on a low-cardinality column produces large result sets that look like a Cartesian even when intentional.
What about CTEs and window functions?
Both are handled. CTEs (WITH name AS ...) are explained in order of definition, then how they compose into the main query. Window functions (ROW_NUMBER OVER PARTITION BY ORDER BY) are explained with the partitioning and ordering called out so you can see what each row frame is.
Why 5 per day?
Same reason as the code explainer: longer inputs cost more per call. The cap keeps the tool free for normal human use. For higher-volume workflows, run the Claude API directly; the per-call cost is small (typically a few cents).

Embed this tool

Free for any use; attribution appreciated. Paste this on your site:

The embed runs the same tool that lives at this URL. No tracking; no ads inside the embed. Resize height as needed for your layout.

Cite this tool

For academic, journalistic, or technical references. Pick a format:

Citations use 2026 as the publication year. Access date is left as a fillable placeholder where the citation style expects one.

Embedded tool from glunty.com