graph-node
graph-node copied to clipboard
Feat: Automate account-like optimization
Resolves https://github.com/graphprotocol/graph-node/issues/4579
What this PR does:
- Adds a new materialized view
info.table_statsthat aggregates statistics from pg_stats for subgraph entity tables, calculating estimated unique entities, total versions, and uniqueness ratio. - Adds a optional experimental background job querying the view to find eligible tables and setting the
is_account_likeflag. 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
- Updates the ENV vars documentation with the new variables and their usage.