Shiyas pfp
Shiyas
@shiyasmohd
Are you building subgraphs on @graphprotocol? Here are 2 simple tips to boost your subgraph's indexing and querying performance πŸ”₯ A small thread 🧡
1 reply
0 recast
0 reaction

Shiyas pfp
Shiyas
@shiyasmohd
1. Mark entities as immutable whenever possible If you will not edit the entity in the future. In schema.graphql, you can mark entities as immutable as given below.
1 reply
0 recast
0 reaction

Shiyas pfp
Shiyas
@shiyasmohd
How does it make a difference? When entity types are marked as immutable, graph-node uses database indexes that are much cheaper to build and maintain than mutable entities.
1 reply
0 recast
0 reaction

Shiyas pfp
Shiyas
@shiyasmohd
2. Use type Bytes for id in entities rather than type ID How does it make a difference? In simple words, type ID takes twice the space of Bytes and comparison of strings in Bytes is much cheaper than in type ID.
1 reply
0 recast
0 reaction