Add Indexing Suggestions or Documentation for Slow Neo4j Queries
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 180
- Forks
- 137
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 21
Description
Problem
While working on the AI mapping pipeline, I noticed that some Neo4j queries (especially involving relationships like (:Standard)-[:MAPPED_TO]->(:CRE)) become significantly slower on larger datasets.
Currently, the repository does not document:
- Which properties should be indexed in the Neo4j database.
- Any query patterns that should be avoided for performance reasons.
- Indexing strategies used in production (if any).
This can lead to performance bottlenecks, especially when using CALL db.indexes() shows minimal or no usage of compound indexes.
Proposal
We can:
-
Add a basic
docs/neo4j-indexing.mdfile listing:- Recommended indexes (e.g., on
Standard.external_id,CRE.id,CRE.name) - Optional compound indexes for common query paths
- Tips on avoiding slow patterns (e.g., avoid expanding entire graph via
MATCH (n)-[*]->(m))
- Recommended indexes (e.g., on
-
Log and benchmark existing slow queries using
PROFILE/EXPLAINand annotate them in the AI mapping script as comments or docstrings.
Benefits
- Helps contributors understand how to structure performant queries.
- Ensures production setups follow best indexing practices.
- Makes AI mapping and CRE-Standard linking significantly faster.
Optional: Related Queries
For example:
MATCH (s:Standard)-[:MAPPED_TO]->(c:CRE) WHERE s.external_id = $id RETURN c
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the proposed docs/neo4j-indexing.md file and inspect the AI mapping queries that use Standard, CRE, and MAPPED_TO. Use PROFILE or EXPLAIN on the related query patterns to identify what can be documented. Done means the recommended indexes, compound-index guidance, and slow query patterns are recorded with enough context for contributors to apply them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- neo4j
- Domain
- databases, documentation, performance
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100