The workbench
The workbench is a SQL editor with syntax highlighting and autocomplete fed by the connection schema — on the engines that expose one. Running it once shows the result, the duration and the row count, and it is what you should do before scheduling anything.
Parameters
A parameter is written in double braces and becomes a real driver parameter, not string concatenation. That is what stops a value containing a quote from becoming SQL injection.
SELECT region,
sum(total) AS revenue
FROM orders
WHERE day >= {{start}}
AND day < {{end}}
GROUP BY 1
ORDER BY 2 DESCThe schedule sets each parameter value. Values relative to the run date are resolved in that schedule’s timezone, not the server’s.
Versions
Every save keeps the previous version with its author and date. You can compare two versions and restore one. It is the answer to the question that always follows a strange number in a report: what did this query do last month.
When the result is large
- The row ceiling per query comes from the plan. On hitting it the run stops and the report is marked truncated, rather than delivering half a set without saying so.
- There is a time limit per run; a query that exceeds it is cancelled at the database, not abandoned.
- For engines that bill by data scanned, the workbench shows a cost estimate before you run.