Index Data Pruning
Subgraphs, by default, store a full version history for entities, allowing consumers to query the subgraph as of any historical block. Index Data Pruning is an operation that deletes entity versions from a subgraph older than a certain block, so it is no longer possible to query the subgraph as of prior blocks. In GraphQL, those are only queries with a constraint block { number: <n> } }
or a similar constraint by block hash where n
is before the block to which the subgraph is pruned. Queries that are run at a block height greater than that are not affected by pruning, and there is no difference between running these queries against an unpruned and a pruned subgraph.
History Blocks setting which is used to periodically check whether the subgraph has accumulated more history than that. Whenever the subgraph does contain more history than that, the subgraph is automatically repruned. Repruning is performed whenever the subgraph has more than History Blocks * 1.8
blocks of history.
Manage Index Data Pruning On Subgraph
Step 1: Purchase Index Data Pruning addons by navigating to Graph Nodes Purchase.
Refer Purchase Subscription page for more details.
Step 2: To enable the Index Data Pruning addon service, navigate to the specific node where it needs to be enabled.
Refer Manage Addon Services page for more details.
Step 3: Select a subgraph to navigate to its details page, then click on the Index Data Pruning tab. This section display Index Data Pruning configuration for the respective subgraph.
Configure Pruning
Before configuring index pruning, ensure the subgraph is deployed.
To configure index data pruning for a subgraph, follow these steps:
Click the Configure Pruning button, a modal window will appear.
Set desired History Blocks. ( The minimum value must be set at 500, while the maximum value should align with the current block of the subgraph. )
To prune once, select the Prune Once checkbox (Repruning will not occur); otherwise, leave it unselected.
Click the Confirm button to configure index data pruning, or click Close button to dismiss the modal without making changes.
This will initiate the process to configure index data pruning on the subgraph.
Once the index data pruning is configured you will be notified via in-app notification and see this on the dashboard.
Deconfigure Pruning
To deconfigure index data pruning for a subgraph, follow these steps:
Click the Deconfigure button, a modal window will appear.
Click the Yes button to deconfigure index data pruning, or click No button to dismiss the modal.
Last updated