GitHub repository

Couchbase Query Analyzer

New 4.0.0-Beta Open-source tool to debug and analyze slow N1QL/SQL++ queries with AI-powered analysis.

3.x
Version 3.x Dashboard
+
Custom
AI API
=
4.x
Version 4.0 AI Report

Why Are My Queries Slow?

Slow queries often result from unoptimized N1QL/SQL++, missing indexes, or inefficient scans. This tool helps:

Get Started

4.x vs 3.x Features
4.x 3.x
Analyzer JavaScript / AI API JavaScript
Runs Locally Yes Yes
Stores Data Yes, In Local Couchbase Lite No
Masks / Obfuscate Your Data Yes, Data Sent to AI API No, Never Leaves Browser
1. Extract Data

Run the following query in your Couchbase Query Workbench, Capella Query tab or cbq, then export the results as JSON.

SELECT *, meta().plan FROM system:completed_requests ORDER BY requestId LIMIT 2000;

Need targeted filters? SQL++ Query Examples

2. Analyze & Optimize

Open Analyzer — in the upper-left corner, paste or upload your JSON to get instant analysis and suggestions.

Private & Secure: Runs entirely in your browser with no server uploads.

First time? User Guide

3. Apply & Test

Implement index or query changes, then re-run to confirm performance gains.

Need help? Analysis Hub

1. Download

Pick your favorite platform to run the analyzer.

Windows macOS Docker
2. Connect To Your Cluster

Save AI analysis results in your Couchbase cluster.

Capella Couchbase Self-Hosted
3. Get An API Key

Optional Use your own custom AI API endpoint.

xAI OpenAI

Click Here to Download and Get Started

FAQs

How do I get query data to use for the tool/analyzer?

Run the SQL++ query from 1. Extract Data in Couchbase Query Workbench or Capella Query tab, then export queries as JSON by copying and pasting or saving to a file. For advanced, targeted SQL++ queries to filter JSON results, see SQL++ Query Examples.

Also see: Sample (dummy) completed_requests JSON

How do I use this tool and/or debug queries?

Start with the User Guide for step-by-step instructions on parsing JSON, using filters, and navigating the analyzer tabs.

For interpreting metrics, optimization strategies, and debugging slow queries, visit the Analysis Hub.

Also see: SQL++ Query Examples • Sample JSON

Where does the slow query data come from?

The Couchbase cluster stores a small history of queries that take longer than 1 second. You can query/get this history via system:completed_requests catalog. Run the query from 1. Extract Data in Query Workbench or cbq to collect recent query executions, timing metrics, and the execution plan.

SELECT *, meta().plan FROM system:completed_requests ORDER BY requestId LIMIT 2000;

NOTE: The above query will not get all of the slow query history but rather a small 2000 sample in random order.

Can I use this with Couchbase Capella?

Yes, it is fully compatible with both Couchbase Server and Capella. Just run the same query from 1. Extract Data in the Query tab in your Capella cluster.

Also see: Couchbase Capella documentation

What AI providers are supported?

Version 4.0 supports xAI Grok and OpenAI models. You can use your own API key to get AI-powered analysis and optimization recommendations for your queries.

Your data stays private — queries are sent directly to your chosen AI provider from the desktop app.

What are the terms of use and license?

Apache 2.0 license. Contribute or report issues on GitHub.

Also see: LICENSE

Couchbase Query Analyzer v4.0.0-Beta