neo4j-query-tuning-skill

Diagnoses slow Neo4j Cypher queries by interpreting execution plans and prescribing index, hint, and rewrite fixes.

Updated Jul 24, 2026
One-click install
npx skills add https://github.com/eklyukin/my-ai-config --skill neo4j-query-tuning-skill-eklyukin
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: neo4j-query-tuning-skill
Source: https://github.com/eklyukin/my-ai-config/tree/main/skills/neo4j-query-tuning-skill
Command: npx skills add https://github.com/eklyukin/my-ai-config --skill neo4j-query-tuning-skill-eklyukin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Slow Neo4j Cypher queries are hard to fix without understanding execution plans, operator behavior, and cardinality estimation. This Skill turns raw EXPLAIN/PROFILE output into concrete remediation steps so you can find missing indexes, bad operators, and stale statistics without guesswork. ## Core Features & Use Cases - Plan Interpretation: Explains EXPLAIN vs PROFILE, key metrics (dbHits, rows, estimatedRows, pageCacheHitRatio), and a full operator reference marking good and bad signals like AllNodesScan, CartesianProduct, and Eager. - Guided Diagnostic Runbook: A five-step workflow from baseline plan through index checks, index creation, post-fix profiling, and statistics replanning with db.prepareForReplanning and db.resampleIndex. - Fixes and Monitoring: Covers USING INDEX / USING SCAN / USING JOIN hints, slotted/pipelined/parallel runtime selection, and live query monitoring with SHOW QUERIES, SHOW TRANSACTIONS, and TERMINATE TRANSACTION. - Use Case: A MATCH query on Person nodes takes seconds instead of milliseconds. Run EXPLAIN, spot a NodeByLabelScan, create a RANGE index on the lookup property, then PROFILE twice to confirm dbHits dropped and NodeIndexSeek replaced the scan. ## Quick Start Ask the agent to diagnose why your slow Cypher query is underperforming by running EXPLAIN and interpreting the execution plan.

Frequently Asked Questions about neo4j-query-tuning-skill

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

FAQPage Schema
How do I diagnose a slow Cypher query in Neo4j?▼

Run EXPLAIN first to inspect the plan without executing the query, scanning for AllNodesScan, NodeByLabelScan, CartesianProduct, and Eager operators. Then run PROFILE twice, using the second run's dbHits and rows metrics to confirm the bottleneck.

What is the difference between EXPLAIN and PROFILE in Neo4j?▼

EXPLAIN shows the planned operators and estimatedRows without executing the query, costing nothing. PROFILE actually executes the query and returns real rows and dbHits, so it costs the full query runtime but gives representative metrics.

How do I fix a CartesianProduct in a Cypher execution plan?▼

A CartesianProduct means two MATCH clauses have no join predicate, producing O(m×n) rows. Connect them with a relationship pattern or WHERE condition, or insert a WITH between the MATCH clauses to reset the planning context.

Why does my Neo4j query ignore the index I created?▼

The planner may skip an index when statistics are stale or selectivity is misjudged. Force it with a USING INDEX hint, or run CALL db.prepareForReplanning() or db.resampleIndex() to refresh statistics, and confirm the index state is ONLINE via SHOW INDEXES.

Does this skill support monitoring and killing running Neo4j queries?▼

Yes, it covers SHOW QUERIES and SHOW TRANSACTIONS to inspect elapsed time, allocated bytes, and lock counts, plus TERMINATE QUERY and TERMINATE TRANSACTION to kill offenders. Viewing other users' queries requires Neo4j Enterprise edition.

When should I use the parallel runtime in Neo4j?▼

Use CYPHER 25 runtime=parallel for large analytical scans and aggregations, not for OLTP, writes, or short queries. It requires Enterprise or Aura Pro 2025+ and the dbms.cypher.parallel.worker_limit setting configured.