neo4j-query-tuning-skill
能解读 EXPLAIN/PROFILE 输出并提出具体优化措施,适合数据库运维与开发。
需要对数据库执行 PROFILE/EXPLAIN 的访问权限,可能暴露运行时信息。
诊断并修复慢的 Neo4j Cypher 查询,给出索引、提示和改写建议。
查询跑慢或 EXPLAIN/PROFILE 看不懂时用,帮你读 Neo4j 的执行计划,定位像 AllNodesScan、CartesianProduct、Eager、NodeByLabelScan 这些低效操作符的根因。会给出建索引、USING HINT、改写 Cypher 或切换运行时的建议,并解释 dbHits、pageCacheHitRatio 与基数估计偏差等指标,适合性能诊断与修复。
▸ 展开 SKILL.md 英文原文
Diagnoses and fixes slow Neo4j Cypher queries by reading execution plans, identifying bad operators (AllNodesScan, CartesianProduct, Eager, NodeByLabelScan), and prescribing fixes (indexes, hints, query rewrites, runtime selection). Use when a query is slow, when EXPLAIN or PROFILE output needs interpretation, when dbHits or pageCacheHitRatio are poor, when cardinality estimation diverges from actuals, or when deciding between slotted/pipelined/parallel runtimes. Covers USING INDEX / USING SCAN / USING JOIN hints, db.stats.retrieve, SHOW QUERIES, SHOW TRANSACTIONS, TERMINATE TRANSACTION. Does NOT write new Cypher from scratch — use neo4j-cypher-skill. Does NOT cover GDS algorithm tuning — use neo4j-gds-skill. Does NOT cover index/constraint creation syntax details — use neo4j-cypher-skill references/indexes.md.
帮我安装这个 skill:https://raw.githubusercontent.com/neo4j-contrib/neo4j-skills/main/neo4j-query-tuning-skill/SKILL.mdcurl -fsSL "https://raw.githubusercontent.com/neo4j-contrib/neo4j-skills/main/neo4j-query-tuning-skill/SKILL.md"## When to Use - Query takes unexpectedly long; need root-cause analysis - EXPLAIN/PROFILE output in hand — needs interpretation - Identifying which index is missing or unused - Deciding between slotted / pipelined / parallel runtimes - Monitoring live queries: SHOW QUERIES, SHOW TRANSACTIONS - Cardinality estimates wrong (plan replanning needed) ## When NOT to Use - **Writing Cypher from scratch** → `neo4j-cypher-skill` - **GDS algorithm performance** → `neo4j-gds-skill` - **Schema design / data modelling** → `neo4j-modeling-skill` --- ## EXPLAIN vs PROFILE | | EXPLAIN | PROFILE | |---|---|---| | Executes query? | No | Yes | | Returns data? | No | Yes | | Shows `rows` (actual) | No | Ye