store: Reduce number of queries to update subgraph_deployment#3290
store: Reduce number of queries to update subgraph_deployment#3290
Conversation
| full_count_query = full_count_query, | ||
| count = count | ||
| ) | ||
| }; |
There was a problem hiding this comment.
This duplication with fn update_entity_count is unfortunate, would it be possible to not duplicate this code?
There was a problem hiding this comment.
I factored that scary comment and string generation into a separate function.
|
@leoyvens @lutter It's all good to write the cursor if it's The thing is will change however is that it will effectively delete the firehose cursor it it existed. But that's good since upcoming PR #3174 was doing it already. Either this PR or #3174 will need to be updated to remove the https://github.com/graphprotocol/graph-node/pull/3174/files#diff-ec9db820ff81f5904c7de003a414c9756dd8eb81b539122f0a70811752f2f313R125 |
0f75178 to
df2eda7
Compare
|
I also changed the logic of |
When updating the metadata in subgraph_deployment, we currently do two to three roundtrips to the database to - update the block pointer - update the entity count - update the firehose cursor (sometimes) With this change, all three roundtrips are folded into one update statement.
…ndexing Now that PR #3290 has been merged, which is always writing back the firehose cursor to the database, meaning it will clear any existing Firehose cursor for a subgraph that started from RPC but than switched to Firehose, it means it's not required to clear any existing cursor when starting a RPC subgraph.
…ndexing (#3331) Now that PR #3290 has been merged, which is always writing back the firehose cursor to the database, meaning it will clear any existing Firehose cursor for a subgraph that started from RPC but than switched to Firehose, it means it's not required to clear any existing cursor when starting a RPC subgraph. Co-authored-by: Matthieu Vachon <matt@streamingfast.io>
When updating the metadata in subgraph_deployment, we currently do two to
three roundtrips to the database to
With this change, all three roundtrips are folded into one update
statement.