Skip to content

AI query analysis

Bring your own AI provider for plain-language query explanations and optimization advice.

Bring your own provider

AI analysis is optional and uses your own AI provider — nothing is sent anywhere unless an admin configures one. Supported providers: Anthropic (Claude), OpenAI, Google (Gemini), xAI (Grok), or any OpenAI-compatible endpoint (Custom — supply your own base URL and model). Configure them in Settings → AI, which is limited to Admins and Super Admins.

Configuration

For each provider you paste an API key (stored AES-256-GCM encrypted and never shown again), then click "Fetch" to auto-discover the models available for that key — no need to know model ids by hand. A "Test" button verifies the key and model round-trip, and you mark one provider as the default used for analysis. The Custom provider requires an explicit base URL and model.

Using it

The "Analyse with AI" button — in the Query Console for statements you are writing, or one click from a long-running query in the Query Monitor — sends the statement and, where the engine supports it, its EXPLAIN plan to your default provider. The answer streams back token-by-token: a plain-language explanation, the performance concerns it identifies, and concrete fixes. Any suggested DDL (e.g. CREATE INDEX) is pulled into a one-click Copy / Use list, and a Stop button cancels a long generation.

Privacy & governance

Only the SQL statement (and, where supported, its execution plan) is sent to your chosen provider — never result rows. Every analysis is written to the immutable audit log with the provider and model used, and results are advisory: verify before applying to production. If no provider is configured, the feature is simply unavailable.

Try it yourself

Open the console and put this into practice.

Open the console