neo4j-query-tuning-skill

仓库创建 2026年1月20日最近提交 7 天前SkillHot 收录 20 天前
▸ 精选理由

能解读 EXPLAIN/PROFILE 输出并提出具体优化措施,适合数据库运维与开发。

▸ 风险提示

需要对数据库执行 PROFILE/EXPLAIN 的访问权限,可能暴露运行时信息。

这个 Skill 做什么

诊断并修复慢的 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.

数据与抓取Neo4j查询调优执行计划索引通用
98
Stars
35
Forks
29
仓库内 Skill
+7
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/neo4j-contrib/neo4j-skills/main/neo4j-query-tuning-skill/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/neo4j-contrib/neo4j-skills/main/neo4j-query-tuning-skill/SKILL.md"
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
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有