From 036c16fb09d82e35fad9d1e9a96cac8308ca0161 Mon Sep 17 00:00:00 2001 From: pasqu4le Date: Fri, 18 Oct 2019 15:59:33 +0200 Subject: [PATCH] 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. --- apps/explorer/lib/explorer/chain/pending_block_operation.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/explorer/lib/explorer/chain/pending_block_operation.ex b/apps/explorer/lib/explorer/chain/pending_block_operation.ex index d85cc589b0..df849ebe37 100644 --- a/apps/explorer/lib/explorer/chain/pending_block_operation.ex +++ b/apps/explorer/lib/explorer/chain/pending_block_operation.ex @@ -16,7 +16,7 @@ defmodule Explorer.Chain.PendingBlockOperation do @type t :: %__MODULE__{ block_hash: Hash.Full.t(), fetch_internal_transactions: boolean() - } + } @primary_key false schema "pending_block_operations" do