Administration
Everything an administrator does, and where to look when something is wrong.
Users and groups
Groups carry permission. A user in the admin group can do everything; the default group is what everyone else starts in. Data sources are attached to groups, so adding somebody to a group is how they get access to data.
Users can be disabled rather than deleted, which keeps their queries and dashboards intact and attributed. Disable user, at the top of their page or on the users list, is the kill switch for an account, and asks first. At once: they are signed out everywhere and cannot sign in, by password or single sign-on; their API key stops working; the AI apps they connected are disconnected; dashboard emails they set up stop; and queries and notebook cells they have running or waiting are stopped. Scheduled refreshes go on, since they keep other people’s dashboards current. Disabling and enabling are in the audit log. Nobody can disable themselves: the button is greyed out on your own page, and another admin can.
Email addresses are for admins. An admin sees everyone’s; everybody else sees only their own. Anywhere another person appears — their profile, the users list, a group’s members, a dashboard’s owner, an alert’s subscribers — a member sees their name.
The Admin pages
Admin in the top row, for anyone with super_admin. Each page says what it is
for in a line or two under its tabs, so you are not guessing which of seven holds the number you want.
- Overview
- Where the headroom is going: Postgres connections, Redis memory, how many workers are busy, how deep the queues are. Also who has run the most queries in the last hour and how much of that came from cache. The place to start when the instance feels slow and you do not yet know why.
- System Status
- The server's report on itself — version, uptime, when the query manager last made a pass, queue depths, table sizes. The figures to quote when something has to be escalated.
- RQ Status
- The job queues themselves, worker by worker. A queue growing while workers sit idle means the jobs are going somewhere nobody is listening.
- Storage Status
- What is being held and what happens to it when: cached query results, uploaded files, and how much of its quota each organisation has left. Both clean-ups can be started from here rather than waiting for their slot. See What happens to uploaded files.
- Running Queries
- Everything the workers have in flight, who asked for it, against which data source and for how long. A scheduled refresh shows as the scheduler rather than a person, because nobody is waiting for it. Any of them can be stopped from here, and stopping one is recorded.
- Streaming Queries
- Every Kafka topic being consumed, the rate events are arriving at, and — the column it exists for — why a quiet one is quiet. Paused, broken and genuinely empty look identical on a chart and are three different problems. The row budget and the events-per-second ceiling are set here. Shown when streams are on.
- Outdated Queries
- Scheduled queries whose next run is already overdue. A handful is ordinary; a long list means the workers are not keeping up with the schedules people have set.
- MCP
- Who has connected over MCP, what they asked for, and every refused attempt — never the question somebody put to their client and never the SQL that came back. A write records what it changed, before and after, because "update_table ok" does not answer the question anybody brings to an audit of an agent's writes. Shown when MCP is on. See MCP.
Reviewing what an agent wrote
An agent pointed at the catalog can describe a warehouse in an afternoon — that is the point of letting it — and that is also why a badge here and there among three thousand tables is not a review. Catalog has a Written by an agent filter that answers exactly that question, and each description carries the name on the API key that wrote it, not merely the fact that a machine did.
Two things an agent cannot do, deliberately:
- Hide a table. It decides what everybody is offered, there is no review step, and nothing on a page would show it had happened. It is done here, with the table in front of you.
- Agree a measure. A proposal lands under Measures with Agree and Deny; until somebody agrees it, no other agent is told it exists. A definition of revenue that is merely plausible is worse than none.
Every write is capped at fifty a day per person (SQLDESK_MCP_WRITES_PER_DAY). An agent
told to describe a warehouse will describe the whole warehouse, and a loop getting it wrong will do it
just as fast; fifty keeps a mistake to a morning's review rather than a restore.
Settings is its own menu in the top row rather than a gear on the right, and it holds different things for different people: an administrator sees data sources, users, groups, alert destinations and the organisation's settings; everybody else sees their snippets and their own account.
Permissions an administrator hands out
Some things are neither for everybody nor only for administrators. The person who knows what a table is for is rarely the person who runs the cluster, so these are granted to a group, under Settings → Groups, and anyone in that group has them.
| Permission | What it allows | Offered when |
|---|---|---|
manage_catalog | Describe tables and columns, agree or deny proposed measures, export the semantic layer. Puts Catalog in the top row. | MCP is on |
use_streams | Start a stream and watch it. Starting one takes a slot; watching somebody else's running stream needs no permission at all. | Streams are on |
manage_streams | Choose which of a cluster's topics may be queried, and how much of each is kept. Puts Streaming Data Sources beside Data Sources in Settings. | Streams are on |
use_notebooks | Chain SQL and Python cells together, where a saved query ends in one SELECT. Puts Notebooks in the top row. Python cells additionally need an interpreter, which is a deployment decision rather than a permission. | Always |
manage_live_dashboards | Make a dashboard live, so the server refreshes it for everyone looking. | Always |
keep_uploads | Stop an uploaded file expiring, so it stays until somebody deletes it. | Files expire at all |
use_mcp | Connect a client over MCP, and see what yours has been doing under My MCP. | MCP is on |
send_dashboards | Subscribe people to a dashboard on a schedule, and send one to Slack. | Rendering is on |
A permission this install cannot honour is not offered at all, rather than granted and inert. With streams switched off in the chart there is no streams permission to give anybody, and with MCP off there is no catalog permission — because a permission that does nothing is worse than no permission.
What happens to uploaded files
An uploaded file is the only copy there is. A query result can be fetched from the warehouse again; a CSV somebody dragged in six months ago and has since deleted from their laptop cannot be re-created by anybody. So the policy is deliberately cautious, and nothing is ever deleted without a warning somebody could have acted on.
- Three days unqueried: unloaded. The file stops being registered with DuckDB, so queries on that data source no longer pay to infer its schema. The file is untouched and the next query that names it brings it back. Nobody is told, because nothing was lost.
- Six days: its uploader is emailed — one message, however many of their files are due, each with its size, whether it has ever been queried, and a button that keeps it.
- Seven days: deleted, but only files that were warned about. If mail was not working, nothing is deleted; the warning is retried instead. A file whose uploader has no address is never deleted on a timer at all — an administrator removes it from the Storage page, having looked at it.
Keeping a file is a permission (Keep uploaded files) an administrator grants to a group, from the email, the Storage page, or the data source's own page. A kept file stays until somebody deletes it.
The quota is a ceiling on everything uploaded, 5 GB by default. An upload past it is refused with the figures in the message, including how many files nothing has queried in a month — removing those is almost always the answer.
Turn any of it off with SQLDESK_UPLOAD_LIFETIME_DAYS=0,
SQLDESK_UPLOAD_UNLOAD_AFTER_DAYS=0 or SQLDESK_UPLOAD_QUOTA_MB=0. The reason the
default is not "keep everything" is that keeping everything is what SQLDesk did until 0.7, and on a
development machine it filled the disk and took Postgres with it.
Keeping it healthy
- Query results are the biggest thing in the database. A cleanup job removes results nothing points at; if the database is growing, check that it is running.
- Dashboards stale? Look at Outdated Queries, then at worker count. Slow queries queueing behind each other is the usual cause.
- Pages slow but data fresh? That is the web tier, not the workers.
- Give a slow data source its own queue so one warehouse cannot starve the rest. On the
data source’s page, under the extra fields: a Queue for the queries people are waiting
for and a Scheduled queue for its refreshes — keeping those apart is what stops a
refresh storm delaying somebody at a dashboard. Then run a worker whose
QUEUESnames them; a queue nothing serves is a data source whose queries wait forever, with nothing in any log to say why.
Settings worth knowing
| Setting | Why |
|---|---|
SQLDESK_SECRET_KEY | Encrypts data source credentials. Rotating it makes them unreadable. |
SQLDESK_HOST | The address in emails and alerts. Wrong, and every link points at localhost. |
SQLDESK_FEATURE_AI | Turns MCP on. Off by default. |
| Mail settings | Without them, alerts and invitations silently do nothing. |
| Public URLs | Can be disabled instance-wide if shared links are not acceptable. |
SQLDESK_UPLOAD_QUOTA_MB | A ceiling on uploaded files, 5 GB by default. 0 removes it, and removing it is how a disk fills. |
SQLDESK_UPLOAD_LIFETIME_DAYS | How long an uploaded file is kept, 7 by default. 0 keeps everything forever. |
SQLDESK_STREAM_ROW_BUDGET | Rows of raw events kept per stream, 5 million by default. The window follows from this and the rate. |
SQLDESK_STREAM_EVENTS_PER_SECOND | Events a second stored from one stream, 5,000 by default. Past it they are sampled and every chart says so. 0 removes the ceiling, which is how a worker becomes the slowest part of a cluster. |
SQLDESK_STREAM_ACTIVE_MINUTES | How long after somebody last looked a stream keeps consuming, 15 by default. 0 turns streams off entirely. |
SQLDESK_METRICS_TOKEN | A bearer token a Prometheus scraper shows at /metrics. Empty — the default — means the endpoint is not mounted at all. See below. |
SQLDESK_NOTEBOOK_EXECUTOR_URL | Where the interpreter for Python cells is. Empty means Python cells say so rather than running. |
SQLDESK_NOTEBOOK_EXECUTOR_TOKEN | What SQLDesk shows that interpreter. Both sides must match. |
SQLDESK_NOTEBOOK_SCALA_ROWS | The most rows an earlier cell sends to a Scala cell, and a Scala cell brings back, 10,000 by default. SQLDESK_NOTEBOOK_LIVY_ROWS, its old name, is still read. |
SQLDESK_QUERY_ESTIMATE_WAIT_SECONDS | How long the editor waits for an estimate before saying there is none, 20 by default. |
SQLDESK_DUCKDB_STORAGE_COMPATIBILITY | The storage format DuckDB writes, v1.5.0 by default so a stream window or uploaded database stays readable by 0.7.x. latest takes the newer format and makes going back a one-way door. See below. |
Scraping SQLDesk
Set SQLDESK_METRICS_TOKEN and /metrics answers a scraper that shows it as a
bearer token. Unset — the default — the endpoint is not mounted, and a wrong
token gets the same 404 as no token: which half was wrong is not a scanner’s business.
What it reports is what SQLDesk is about to run out of, read at the moment of the scrape rather than accumulated:
sqldesk_queue_depthandsqldesk_queue_started, per queue — the first thing to look at when SQLDesk feels slow and the warehouse is fine.sqldesk_workers,sqldesk_workers_in_stateand the job counters — saturation. Queue depth alone cannot tell a cluster keeping up from one with no workers at all.sqldesk_query_pool_in_useagainstsqldesk_query_pool_limit, per pool.sqldesk_stream_slots_in_useagainst its limit, where a slot is a topic rather than a viewer.sqldesk_db_connections_in_useagainstsqldesk_db_pool_limit— the thing most likely to fall over, and the thing nothing could see before.
Two things worth knowing when you build a dashboard on it. The database numbers describe the
process that answered, because a SQLAlchemy pool is per process — with several web workers
the useful view is the maximum across them. And a pool with no limit has no
_limit series rather than a zero, because a zero there would read as “no room at
all”, which is its opposite.
A scrape that cannot read one source still returns the others: during an incident, half the truth is worth more than an error page.
Upgrading to 0.8: the DuckDB file format
0.8 ships DuckDB 2.0, and DuckDB 2.0 writes a database file that DuckDB 1.5.6 — what 0.7.x shipped — refuses to open. That matters in exactly one place: the files SQLDesk writes for itself, which are stream windows and any uploaded database.
By default it does not matter at all, because
SQLDESK_DUCKDB_STORAGE_COMPATIBILITY is set to v1.5.0 and those files keep
the older format. Upgrade, decide you preferred 0.7.10, and go back: everything still opens.
Two things are worth knowing either way:
- A file you already had is not rewritten. Opening one read-write does not
change its format — only writing to it does. So your own uploaded
.duckdbdatabase is left exactly as it was unless SQLDesk writes to it. - A stream window is disposable by design. Kafka is the source of truth, so the worst case was never lost data — it was “delete these files before you roll back”, which is a sentence no release should need.
Set it to latest if this install is never going back, and you get whatever 2.0
improved about the format. It is a one-way door from the moment you do.
One change you may see in a query
DuckDB 2.0 made a new SQL parser the default, and that parser refuses the single-arrow lambda every earlier version accepted:
-- refused by DuckDB 2.0 on its own
SELECT list_transform(items, x -> x * 2) FROM events;
-- the current spelling
SELECT list_transform(items, lambda x: x * 2) FROM events;
SQLDesk re-enables the old spelling on every DuckDB connection it opens, so a query that ran in 0.7.10 still runs. That is a reprieve, not a fix — DuckDB removes both the syntax and the flag that re-enables it in 2.1, so a query using the single arrow should be changed now rather than when it breaks.
One other difference shows up in stream windows: a timestamp field now lands as
TIMESTAMP WITH TIME ZONE where it used to land as a naive TIMESTAMP.
That is the more correct reading — the offset was previously being dropped — and windows
created before the upgrade keep the column they already have.
Query pools: capping what a warehouse is given
How many queries run at once has always been an accident of deployment: the number of worker processes times the number of replicas. The only way to change what a warehouse is subjected to was to change the deployment — and an autoscaler moving replicas while a query runs changed it again without anybody asking.
A pool is a ceiling that does not move when the workers do. It is held in Redis, which every worker already shares, and is checked at the moment a query begins.
The budget belongs to the pool rather than to SQLDesk, because the warehouse is what falls over, not us — a single number for the whole install would be the same figure for a Postgres toy and a Snowflake bill.
A pool is counted in slots: a query takes one while it runs. With 8 slots, at most 8 queries run on that warehouse at once; a ninth waits a few seconds for one to finish, then is refused with a sentence naming the pool and the numbers, rather than piling onto the warehouse.
Every data source draws from a pool of its own. Two data sources on one machine should share a
pool — prod-readonly and prod-analytics are two rows here and one
warehouse, and capping each at eight hands that warehouse sixteen. A pool need not be a database: a
rate-limited HTTP connector is the same kind of scarce.
Nothing about a pool needs a redeploy. Everything below is set in the app.
Turning pools on, and the default size
- On each data source, Limit how many queries run at once switches its pool on or off. Off, its queries run as fast as the workers take them. A source nobody has switched keeps the cap it had before the switch existed.
- Settings → General → Default pool size (8 unless you change it) is the size of every pool that is on and has no size of its own. Change it, and they all change.
- Turn the query pool on for new data sources, on the same page, decides whether a new source starts with its pool on, following the default.
- Turn on for all data sources… switches on every source that has no pool on. A source with slots of its own keeps them; the rest follow the default. Stream-only sources are left out: a Kafka cluster is consumed, not queried.
Shared pools
Made on Admin → Query Pools with New shared pool, at the top of the pools: a name and a size. Then choose it under Query pool on each data source’s page; the sources in it share its slots. A pool is a row as soon as it is made, before any data source joins it. Select its row to resize it or delete it: the confirmation names the data sources in it, which go back to pools of their own. A data source can only choose a pool that has been made, so a typo cannot quietly become a pool of its own. A data source’s own pool is not deleted but switched off: Turn the limit off, beside its size.
A size of 0 stops a pool, which is the kill switch for a warehouse in trouble: the data sources keep their queries, dashboards, schema and permissions, and simply stop being given anything to do. Queries already running finish; anything new, notebook cells included, is refused at once with a sentence saying so, and the pool’s page shows it as stopped. The same goes for a data source’s own Slots set to 0.
How a pool is shared
Each kind of work is guaranteed a share of every pool, and any free slot can be used by whoever asks, in priority order: people first, then scheduled refreshes, notebooks and AI clients. The one rule: a query never takes a slot still guaranteed to a kind above it. People can use what schedules are guaranteed while schedules are quiet; an AI client never uses what people are guaranteed. Nothing already running is stopped — which is why that rule is what keeps a guarantee.
Each pool has its own: select a pool on Admin → Query Pools and its sharing is the section under the pools, together at most 100%, with what each kind always gets and can reach in slots; the rest goes to whoever asks first. A pool nobody has changed is shared the default way, below, and Use the default puts one back. In a pool of 8, the defaults give:
| Priority | Guaranteed | In a pool of 8 |
|---|---|---|
| 1. People | 50% | always 4, up to all 8 when free |
| 2. Scheduled refreshes | 25% | always 2, up to 4 when free |
| 3. Notebooks | 10% | nothing held back (10% of 8 rounds down), up to 2 |
| 4. AI clients | 0% | nothing held back, up to 2 |
So a burst of refreshes cannot crowd out a dashboard, and an agent only uses capacity nobody above it needs. Give a pool meant for agents a guarantee for AI clients, and they always have it there.
Set by the deployment
For installs configured as code, the same things can be set in the environment. Pools set this way show on Admin → Query Pools as set by the deployment and cannot be changed in the app.
| Setting | What it does |
|---|---|
SQLDESK_QUERY_POOLS | Shared pools and their sizes, as name=slots
pairs, for example warehouse=8,vendor-api=2. 0 stops that pool. |
SQLDESK_QUERY_SLOTS_DEFAULT | Only for data sources never switched on or off,
from before the switch: what their pool is worth. 0, unlimited, by default, so upgrading
caps nothing. |
SQLDESK_QUERY_POOL_SHARES | How every pool is shared, as
kind=always:up-to percentages, for example interactive=50:100,mcp=0:25. |
SQLDESK_QUERY_SLOT_WAIT_SECONDS | How long a query waits for room before giving up and saying so (10). Short on purpose: a worker waiting is a worker doing nothing. |
SQLDESK_QUERY_SLOT_TTL_SECONDS | How long a slot survives unrenewed. A running query renews its own; this is what frees the slot when a worker is killed. |
On the data source’s page
The page is in cards: the connection, who can query, the queues, the query pool, and cost and usage, with a list of them down the left. One Save changes, at the top beside Test connection and Pause, saves all of them. On the right, Right now shows what the source’s pool holds and its last hour, for a pool that is on; a pool that is off records nothing, so there is nothing to show.
The pool and cost settings, each with an ⓘ that says what it means:
- Pool — this source’s own, or a shared pool from the list.
- Slots — for its own pool. Empty follows the default size;
0stops new work, like Pause. A shared pool’s size is shown, and set on Admin → Query Pools.
Cost and usage is on every data source: your prices first, then what to do with them. What the engine cannot do is shown switched off, with the reason, rather than hidden (which engines report what).
- Your prices: a price per CPU hour, a price per TB read and a currency, whatever your contract says, in those units. A TB is 1024⁴ bytes, as BigQuery and Athena bill. Both prices add up where both apply, and a price applies from the next run.
- After a run — Show what each run used, and what it cost, on by default where the engine reports it: under each result, and to AI clients, the engine’s own figures, priced. It costs nothing extra: the engine sends them with the result. Engines that keep no such account have nothing to show.
- Before a run:
- Offer “Estimate cost” in the query editor, off by default. It runs an
EXPLAINagainst the warehouse before the query — one extra round trip — only when the person ticks the box, so nobody waits who didn’t ask. Trino and BigQuery estimate the data a query will read, which is priced; Postgres, Redshift and Vertica estimate a plan cost and rows, shown but not priced. Other engines give no estimate SQLDesk can read. - Ask before an AI client runs a query costing more than an amount, at the price per
TB read, on engines that estimate the data a query reads. It runs an
EXPLAINbefore each AI client’s query on that source, a round trip an agent doesn’t notice; see MCP.
- Offer “Estimate cost” in the query editor, off by default. It runs an
Under the pool’s settings, how its slots are shared, as set for every pool.
Admin → Query Pools
Every pool with a limit, as a row: what is in use now against its size, split by kind of work, how many queries it refused in the last hour, and whether it is OK, busy, full or stopped. Pools with no limit record nothing, so they are listed by name on one line. New shared pool, at the top, makes a shared pool.
Select a row and how that pool is shared opens under the pools. The right side shows its Size, changed in place for a source’s own pool or a shared pool made here, with Delete pool or Turn the limit off; its last 60 minutes, a line for each kind of work against the limit with the minutes that refused a query marked; and who holds a slot now: whose query, what kind and the job.
It refreshes every five seconds and reads Redis only. The hour costs no more than that: the scheduler takes one sample of each pool used this hour once a minute, and a refused query adds one to a counter that expires after the hour.
Admin → Overview
What runs out first, what needs doing, and the last hour.
- Needs attention: no worker running, mail not set up, a data source paused, a query pool set to 0. Each comes from what is configured, not a guess about load. With none of these and every gauge fine, it says healthy.
- Headroom: Postgres connections, both Redis servers’ memory, busy workers and jobs waiting, each against what it runs out at. Waiting jobs are measured against the workers that would take them.
- Storage: the database, stored query results and events, with the clean-up actions.
- The last 60 minutes: executions a minute, split into ran on the warehouse and served from cache, and who ran them. These come from recorded executions, which cover what people ran; the scheduler’s refreshes are not among them.
The gauges come from Redis every ten seconds. Postgres connections, table sizes and the hour, which are what cost Postgres anything, are read once a minute. What is running now is the Running queries tab.
Streams, operationally
What a stream costs is different in kind from everything else here: a query costs when somebody runs it, and a stream costs continuously. So the two numbers worth knowing are the row budget (how much disk a stream may take) and the events-per-second ceiling (how much work it may make a worker do). Past the ceiling events are sampled rather than queued — an unbounded queue in front of a slow writer is the crash, not the protection against it.
A stream holds a worker while it is consuming, so give streams a queue of their own
(SQLDESK_STREAM_QUEUE is not a setting yet — the jobs go on streams, and a
worker whose QUEUES names it is what keeps a consumer out of the way of the queries people are
waiting for). One worker per active stream, and only while somebody is watching: see
a stream is a window.
Raw events live in a DuckDB file per stream, under the same volume as uploaded files — so the uploads volume is what fills if a budget is set too high. The per-minute rollups live in Postgres, because they are small by construction and are the part that has to survive a restart.