couchbase-sqlpp-tuning

Diagnoses slow Couchbase SQL++/N1QL queries and recommends index strategies.

4|1|Updated May 28, 2026
One-click install
npx skills add https://github.com/celticht32/Couchbase-Skills-for-Claude.ai --skill couchbase-sqlpp-tuning
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: couchbase-sqlpp-tuning
Source: https://github.com/celticht32/Couchbase-Skills-for-Claude.ai/tree/main/skills/couchbase/couchbase-sqlpp-tuning
Command: npx skills add https://github.com/celticht32/Couchbase-Skills-for-Claude.ai --skill couchbase-sqlpp-tuning

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps diagnose and fix slow Couchbase SQL++ and N1QL queries by identifying bad plans, missing or ineffective indexes, and query shapes that force scans or unnecessary fetches.

Core Features & Use Cases

  • Plan Reading: Interpret EXPLAIN output to spot PrimaryScan, IntersectScan, Fetch, and poor span pushdown.
  • Index Design: Recommend covering, partial, composite, array, functional, and vector indexes that match the query.
  • Query Tuning: Improve slow queries, deep pagination, join performance, and repeated prepared statements.
  • Operational Workflow: Use diagnostics like completed requests, index advisor output, and query profiles to validate improvements.
  • Use Case: A user shares a slow query or EXPLAIN plan, and this Skill guides the next index or rewrite needed to reduce latency.

Quick Start

Paste the slow Couchbase query or its EXPLAIN plan and ask for the best index or rewrite to improve performance.

Frequently Asked Questions about couchbase-sqlpp-tuning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I tune slow Couchbase SQL++ queries using the EXPLAIN plan?

To tune slow Couchbase SQL++ queries, read the EXPLAIN plan to identify bottlenecks like PrimaryScan or Fetch operations. This skill diagnoses these execution plan issues and recommends matching covering or partial indexes to eliminate unnecessary data scans.

What is the best index design for Couchbase N1QL pagination problems?

The best index design for Couchbase N1QL pagination problems uses covering or composite indexes that match query predicates and sort keys. This eliminates expensive Fetch operations and offset processing, drastically reducing latency for deep pagination requests.

Why does my Couchbase query execution plan show a PrimaryScan and how do I fix it?

A Couchbase query execution plan shows a PrimaryScan when missing or ineffective indexes force a full bucket scan. Fix it by creating targeted composite, partial, or functional indexes that match your query predicates to enable proper index span pushdown.

Can I optimize Couchbase join performance and repeated prepared statements?

Yes, you can optimize Couchbase join performance and repeated prepared statements by analyzing query profiles and completed request diagnostics. This skill identifies inefficient join shapes and verifies runtime improvements through profile-driven validation of index strategies.

When should I use array or functional indexes in Couchbase SQL++?

You should use array or functional indexes in Couchbase SQL++ when queries filter on array elements or computed expressions. This skill recommends these specialized index patterns to match complex query predicates and avoid costly post-fetch filtering.