I am relatively new to developing subgraphs on The Graph and have been facing performance issues lately.
Particularly, I am looking for tips on optimizing my subgraph’s query efficiency and reducing indexing time.
Any insights or best practices would be greatly appreciated!
there are 3 things we highly recommend to do. This will improve your indexing and querying performance.
Change type of id in entities to Bytes . As, type ID takes twice the space of Bytes and comparison of strings in Bytes is much cheaper than in type ID .
Mark immutable for entities whenever possible. When entity types are marked as immutable,
graph-node uses database indexes that are much cheaper to build and maintain than mutable entities.
Please check out this detailed blog: Two Simple Subgraph Performance Improvements | Blog | The Graph