You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We split the table `subgraphs.subgraph_deployment` into two tables,
`subgraphs.head` and `subgraphs.deployment` where the `head` table only
contains the metadata that changes on every block.
This should help with situations where the `subgraph_deployment` table gets
very bloated since the `head` table that gets bloated through frequent
changes has much smaller rows than the current `subgraph_deployment`
table. Rows in `subgraph_deployment` can grow as big as 500k, whereas rows
in the `head` table will only take about 350 bytes at most.
Updates will also be marginally better on the `heads` table since it only
has one index rather than the two that `subgraph_deployment` has.
Copy file name to clipboardExpand all lines: docs/implementation/metadata.md
+43-35Lines changed: 43 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
List of all known subgraph names. Maintained in the primary, but there is a background job that periodically copies the table from the primary to all other shards. Those copies are used for queries when the primary is down.
|`current_version`|`text`|`subgraph_version.id` for current version |
@@ -18,29 +18,27 @@ List of all known subgraph names. Maintained in the primary, but there is a back
18
18
19
19
The `id` is used by the hosted explorer to reference the subgraph.
20
20
21
-
22
21
### `subgraphs.subgraph_version`
23
22
24
23
Mapping of subgraph names from `subgraph` to IPFS hashes. Maintained in the primary, but there is a background job that periodically copies the table from the primary to all other shards. Those copies are used for queries when the primary is down.
Directory of all deployments. Maintained in the primary, but there is a background job that periodically copies the table from the primary to all other shards. Those copies are used for queries when the primary is down.
@@ -52,36 +50,46 @@ Directory of all deployments. Maintained in the primary, but there is a backgrou
52
50
53
51
There can be multiple copies of the same deployment, but at most one per shard. The `active` flag indicates which of these copies will be used for queries; `graph-node` makes sure that there is always exactly one for each IPFS hash.
54
52
55
-
### `subgraphs.subgraph_deployment`
53
+
### `subgraphs.head`
54
+
55
+
Details about a deployment that change on every block. Maintained in the
56
+
shard alongside the deployment's data in `sgdNNN`.
0 commit comments