You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've split account data into account_object and account_statistics_object for better performance when modifying, to reduce amount of data being copied to undo db. Due to this, we need to perform two queries when need data from both objects. By the way, this principle is abandoned in Steem.
Every time when looking for an account's statistics object after we already find the account object, we search from the root of the index, which is expensive especially when the index is large.
Since the address of the objects won't change after the block that they're created become irreversible, can we cache address of each other in the objects? For example, add an optional<account_statistics_object*> field in account_object class, when the account become irreversible, update the field to the address of responding account_statistics_object. And vise versa.
Same thing can be done for asset_object and dynamic_asset_data_object.
Thoughts?
The text was updated successfully, but these errors were encountered:
Just typing out loud here.. Can the objects be "down-cast" for undo db, and restored if the data in undo db needs to be used? That would save storage space in undo db, and keep the account_object whole for the (hopefully) normal case.
At this time I think for the sake of stability we should avoid fiddling with pointers.
@jmjatlanta there isn't really a "normal case" for undo_db - incoming transactions are applied with an undo session that is rolled back before the next incoming block is applied. I. e. it is rolled back about as often as not. During replay undo_db is disabled anyway.
We've split account data into
account_object
andaccount_statistics_object
for better performance when modifying, to reduce amount of data being copied to undo db. Due to this, we need to perform two queries when need data from both objects. By the way, this principle is abandoned in Steem.Every time when looking for an account's statistics object after we already find the account object, we search from the root of the index, which is expensive especially when the index is large.
Since the address of the objects won't change after the block that they're created become irreversible, can we cache address of each other in the objects? For example, add an
optional<account_statistics_object*>
field inaccount_object
class, when the account become irreversible, update the field to the address of respondingaccount_statistics_object
. And vise versa.Same thing can be done for
asset_object
anddynamic_asset_data_object
.Thoughts?
The text was updated successfully, but these errors were encountered: