graph-node icon indicating copy to clipboard operation
graph-node copied to clipboard

Feat: Automate account-like optimization

Open dimitrovmaksim opened this issue 2 months ago • 0 comments

Resolves https://github.com/graphprotocol/graph-node/issues/4579

What this PR does:

  1. Adds a new materialized view info.table_stats that aggregates statistics from pg_stats for subgraph entity tables, calculating estimated unique entities, total versions, and uniqueness ratio.
  2. Adds a optional experimental background job querying the view to find eligible tables and setting the is_account_like flag. The job can be enabled by setting the following env vars
  • GRAPH_STORE_ACCOUNT_LIKE_SCAN_INTERVAL_HOURS
  • GRAPH_STORE_ACCOUNT_LIKE_MIN_VERSION_COUNT
  • GRAPH_STORE_ACCOUNT_LIKE_MAX_UNIQUE_RATIO
  1. Updates the ENV vars documentation with the new variables and their usage.

dimitrovmaksim avatar Nov 06 '25 11:11 dimitrovmaksim