graph/db+sqldb: use batch validation for node migration
Restructue the `migrateNodes` function so that it does the validation of migrated nodes in batches. So instead of fetching each node individually after migrating it, we wait for a minimum batch size to be reached and then validate a batch of nodes together. This lets us make way fewer DB round trips.
This commit is contained in:
5 files changed
+176
-47
No files matched your search
@@ -68,6 +68,7 @@ type Querier interface {
|
||||
GetNodeFeaturesBatch(ctx context.Context, ids []int64) ([]GraphNodeFeature, error)
|
||||
GetNodeFeaturesByPubKey(ctx context.Context, arg GetNodeFeaturesByPubKeyParams) ([]int32, error)
|
||||
GetNodeIDByPubKey(ctx context.Context, arg GetNodeIDByPubKeyParams) (int64, error)
|
||||
GetNodesByIDs(ctx context.Context, ids []int64) ([]GraphNode, error)
|
||||
GetNodesByLastUpdateRange(ctx context.Context, arg GetNodesByLastUpdateRangeParams) ([]GraphNode, error)
|
||||
GetPruneHashByHeight(ctx context.Context, blockHeight int64) ([]byte, error)
|
||||
GetPruneTip(ctx context.Context) (GraphPruneLog, error)
|
||||
|
||||
Reference in new issue
Block a user