Skip to content

Optimise indexes and autoanalyze#2157

Open
CodiePP wants to merge 2 commits into
IntersectMBO:masterfrom
Blockchain-Data-Analytics:optimise_indexes
Open

Optimise indexes and autoanalyze#2157
CodiePP wants to merge 2 commits into
IntersectMBO:masterfrom
Blockchain-Data-Analytics:optimise_indexes

Conversation

@CodiePP

@CodiePP CodiePP commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Description

  • the unique index "unique_reward" needs proper order of columns with the epoch first so the hash tree has less depth. The size of the index drops from 30 GB to 20 GB on disk. This could also be checked for other compound indexes.
  • added a few more indexes
  • changed the threshold when "autoanalyze" kicks in on heavy tables. This leads to faster queries as the query planning is improved.

We have been benchmarking this on our ha db-sync setup on BCA.

Checklist

  • Commit sequence broadly makes sense
  • Commits have useful messages
  • New tests are added if needed and existing tests are updated
  • Any changes are noted in the changelog
  • Code is formatted with fourmolu on version 0.17.0.0 (which can be run with scripts/fourmolize.sh)
  • Self-reviewed the diff

Migrations

  • The pr causes a breaking change of type a,b or c
  • If there is a breaking change, the pr includes a database migration and/or a fix process for old values, so that upgrade is possible
  • Resyncing and running the migrations provided will result in the same database semantically

If there is a breaking change, especially a big one, please add a justification here. Please elaborate
more what the migration achieves, what it cannot achieve or why a migration is not possible.

CodiePP added 2 commits July 6, 2026 10:56
Signed-off-by: Alexander Diemand <codieplusplus@apax.net>
Signed-off-by: Alexander Diemand <codieplusplus@apax.net>
@CodiePP CodiePP requested a review from a team as a code owner July 6, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant