Finding a slow query on a Postgres branch, without leaving the terminal.
xata branch query-insights ranks that branch's statements by cost, flags the slow ones, and prints the command to inspect any of them. Logs and instance metrics are one command away.
@tudor_g on how Xata is actually built: copy-on-write branching at the ZFS volume level, pools of pre-provisioned Postgres clusters kept warm so an idle branch wakes in about a second, and why pgstream is Apache 2.0 and runs in your environment.
If you're giving every coding agent and every PR its own Postgres branch, you're not clicking those into existence, you're scripting them.
So the CLI output has to be readable by a script, or an agent.
Now it is. Piped output is clean plain text, and xata branch list --json is
2TB+ Postgres. Branch it in about a second. Query it. Delete it.
xata scratch is a new command in the existing Xata CLI.
It forks a disposable branch off your real database, drops you into psql or runs SQL inline, and tears the branch down on exit.
Check the demo