Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[draft] sync store perf experiments #1400

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

typedarray
Copy link
Collaborator

@typedarray typedarray commented Jan 5, 2025

Changes

  • new factory design uses a dedicated table for factory addresses, leading to much better getEvents query plans for apps with huge factories
  • all joins use execution indexes (block_number, transaction_index, log_index, etc) rather than block & transaction hashes, leading to smaller indexes and nested loop or merge joins (faster than hash joins)
  • add useful indexes & remove unused indexes on the logs table

TODOs

  • fix multi-chain issues (getEvents currently ignores chain ID)
  • fix realtime for the new factory design (the new block event coming from the realtime service does not currently include which factory a specific log matched, which we now need when inserting child addresses into the store. it has this information, though, so shouldn't be difficult)
  • improve indexes on transaction and trace tables

Additional work

  • move non-essential/chain-specific columns into a JSON column
  • optimize essential column types (text -> bytea or numeric)
  • revisit checkpoint column (order key) now that tables are single-chain
  • partition on block timestamp / number

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