docs(operations): add Performance & Query Optimization guide#459
docs(operations): add Performance & Query Optimization guide#459
Conversation
Create operations/performance.md covering: - Understanding query execution stages - Using GRAPH.EXPLAIN to inspect execution plans - Using GRAPH.PROFILE to measure per-operation metrics - Index selection (range, full-text, vector) with best practices - Parameterized queries for security and cache performance - CACHE_SIZE tuning guidance - Query optimization patterns (LIMIT, early filtering, RO_QUERY, bounded variable-length paths, WITH staging) - Monitoring with GRAPH.SLOWLOG - Quick reference checklist Also adds the Performance guide to the Operations index page. Addresses audit item P2.8. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 50 minutes and 53 seconds.Comment |
There was a problem hiding this comment.
Pull request overview
Adds a new Operations guide focused on diagnosing and improving FalkorDB query performance, and links it from the Operations index to make it discoverable within the production/deployment docs section.
Changes:
- Added
operations/performance.mdcovering EXPLAIN/PROFILE interpretation, index selection, parameterization, cache tuning, and monitoring/optimization patterns. - Updated
operations/index.mdto include the new Performance & Query Optimization page.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| operations/performance.md | New performance/optimization guide with examples and tuning guidance. |
| operations/index.md | Adds a navigational entry pointing to the new guide. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Best for similarity search on embedding vectors. | ||
|
|
||
| ```cypher | ||
| CALL db.idx.vector.createNodeIndex('Document', 'embedding', 768, 'cosine') |
| Always use parameterized queries instead of string interpolation. This improves both **security** (prevents injection) and **performance** (enables query cache reuse). | ||
|
|
||
| **❌ Bad — string interpolation (new plan compiled every time):** | ||
|
|
||
| ```python | ||
| name = "Alice" | ||
| graph.query(f"MATCH (p:Person {{name: '{name}'}}) RETURN p") | ||
| ``` | ||
|
|
||
| **✅ Good — parameterized (plan is cached and reused):** | ||
|
|
||
| ```python | ||
| graph.query("MATCH (p:Person {name: $name}) RETURN p", params={"name": "Alice"}) | ||
| ``` |
| ``` | ||
| 1) "Results" | ||
| 2) " Project" | ||
| 3) " Conditional Traverse | (p)->(friend:Person)" |
|
|
||
| **Tuning guidance:** | ||
| - Increase `CACHE_SIZE` if your application uses many distinct query patterns | ||
| - Monitor cache effectiveness using `GRAPH.SLOWLOG` — if the same queries appear repeatedly, the cache may be too small |
|
|
||
| ### Use read-only queries when possible | ||
|
|
||
| Use `GRAPH.RO_QUERY` instead of `GRAPH.QUERY` for read-only operations. Read-only queries can be distributed to replicas, reducing load on the primary. |
Summary
Create a comprehensive Performance & Query Optimization guide that teaches users how to diagnose and improve query performance.
Changes
operations/performance.mdcovering:operations/index.md: Added Performance guide link (section 13)Testing
/commands/graph.explain,/commands/graph.profile, etc.)Memory / Performance Impact
N/A — documentation only
Related Issues
Addresses audit item P2.8 (Audit-Report.md)