Query Analysis
Use RDST commands to find SQL queries and understand how they run, and ask questions about your data.
RDST has three commands that help you work with SQL queries. They share a common foundation, the query registry, so a query found by one command can be analyzed, cached, or re-run by another.
Which command do I reach for?
| If you want to... | Use |
|---|---|
| See which queries are actively consuming the most database time | rdst top |
| Get a full analysis of one specific query | rdst analyze |
| Translate a plain-English question into SQL and run it | rdst ask |
A common workflow
The three commands are often used together:
# 1. Find the slowest queries on a target
rdst top --target prod-orders
# 2. Analyze one of them
rdst analyze --hash a1b2c3d4e5f6 --target prod-orders
# 3. Explore related data in plain English
rdst ask "Which customers trigger this query most often?" --target prod-ordersEvery command in this section saves the queries it touches to the registry. You
never need to copy a query from one command's output to another's input, use
--hash <id> instead.