Closed telezhnaya closed 3 years ago
Oh, sorry for the confusing name. This field is important for another reason. It ensures that when we run two or more indexers from different checkpoints, they don't blindly override data from one another. This is an anchor for concurrent:
UPDATE accounts SET created_by_receipt_id = 'zxc' WHERE last_update_block_height < :current_block_height
UPDATE accounts SET deleted_by_receipt_id = 'zxc' WHERE last_update_block_height < :current_block_height
Just checked on the data:
accounts.last_update_block_height
is equal toaccounts.deleted_by_receipt_id
if the account was deleted; otherwise, it is equal toaccounts.created_by_receipt_id
. Intuitively, I was waiting for the block height with the last update on this account. By the way, I am not sure we need this info since it will produce many updates in DB.I suggest to get rid of this column and add columns
created_at_block_height
anddeleted_at_block_height
. We have to make 4 joins to find this info right now 😢