Explorer and SQL Lab
Browse the schema, write queries, and turn a good one into an alert.
Explorer
Data Warehouse → Explorer browses the schema: databases, tables, columns, types, row counts and sample values.
Sample values are the useful part. A column called status tells you nothing; a
column called status whose values are pending, settled and chargeback
tells you what to write.
SQL Lab
Data Warehouse → SQL Lab is the query editor.
| Editor | Syntax highlighting, schema-aware completion |
| Run | Against any connection |
| Results | Tabular, sortable, exportable |
| History | Your recent queries |
| Saved | Named queries, shared within the organisation |
From a query to something useful
A query in SQL Lab can become:
| A SQL alert | Alert on what it returns |
| A dashboard tile | Chart it |
| A scheduled query | Run it on a schedule and export or notify |
| A KPI report metric | Put it in the daily digest |
The Create alert button carries the query across — you do not retype it, and it cannot drift from the one you tested.
Writing for alerting
If the query is destined to be an alert, shape it for that from the start. See Writing the query, and in particular:
- return a row with
0rather than no rows when healthy - name columns after what they mean
- include a freshness column to use as a guard
Limits
Two-minute timeout, row cap, read-only statements. Every execution is recorded in Query audit.
Use LIMIT while exploring. An unbounded SELECT * on a large ClickHouse
table will find the timeout, and will make the warehouse do a lot of work to
tell you nothing.
Where this behaviour lives: frontend/src/app/dwh/explore/, frontend/src/app/dwh/sql/. If the code and this page disagree, the code is right — please fix the page.
Part of Data warehouse — Querying the warehouse, and alerting on what the query returns.