Add pending block operations

Problem: a lot of problems are created by tracking the importing progress on multiple tables.
Querying and updating involves as such heavy operations and this is also the cause for inconsistencies.

Solution: use a new table to track the progress of block's data indexing.
By using a specific table, whose rows are deleted when there are no more pending operations on the relative block, we make joins quick and keep them to a minimum.
This is also meant to simplify all inserts and updates and only perform deletes when strictly necessary.
pull/2888/head
pasqu4le 5 years ago committed by Ayrat Badykov
parent 2bd6f66e99
commit 036c16fb09
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 2
      apps/explorer/lib/explorer/chain/pending_block_operation.ex

@ -16,7 +16,7 @@ defmodule Explorer.Chain.PendingBlockOperation do
@type t :: %__MODULE__{ @type t :: %__MODULE__{
block_hash: Hash.Full.t(), block_hash: Hash.Full.t(),
fetch_internal_transactions: boolean() fetch_internal_transactions: boolean()
} }
@primary_key false @primary_key false
schema "pending_block_operations" do schema "pending_block_operations" do

Loading…
Cancel
Save