graphprotocol / graphprotocol/graph-node
[Feature] graphman should automatically run ANALYZE after creating indexes
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.2k
- Forks
- 1.1k
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 1
Description
Description
When creating multicolumn indexes, a subsequent ANALYZE is needed so that Postgres collects the necessary statistics and makes the freshly created index available for the query planner. Therefore, it's a good idea to teach graphman to automatically run ANALYZE after such index creations.
What's more, it also seems to be a good idea to always run ANALYZE after any index creation - after all, we create indexes to address performance issues, and fresh statistics (obtained by ANALYZE) also often help with such problems. This will make the implementation easier as a side effect, I believe.
An optional sub-feature might be the ability to turn it off when creating multiple indexes one after another on the same table. We have to consider here that index creation usually takes several minutes, whereas a typical ANALYZE finishes somewhere between 4 and 15 seconds.
Are you aware of any blockers that must be resolved before implementing this feature? If so, which? Link to any relevant GitHub issues.
No response
Some information to help us out
- Tick this box if you plan on implementing this feature yourself.
- I have searched the issue tracker to make sure this issue is not a duplicate.
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 by tracing graphman's index-creation flow and how it executes PostgreSQL operations. Determine where ANALYZE should run after index creation, including behavior when multiple indexes target the same table; done means fresh statistics are collected consistently without disrupting index creation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgres, rust
- Domain
- cli, databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100