-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve account_balance indexing #529
Milestone
Comments
We need to have
so that the ordering is increasing asset ID, decreasing balance within an asset ID, and increasing account ID. So effectively the "rich list" for each asset, with ID as tiebreaker (a lower ID is ranked above a higher ID with equal balance). |
theoreticalbts
added a commit
that referenced
this issue
Jan 21, 2016
theoreticalbts
added a commit
that referenced
this issue
Jan 21, 2016
theoreticalbts
added a commit
that referenced
this issue
Jan 21, 2016
That was easier than I expected. Apparently |
pmconrad
pushed a commit
to pmconrad/graphene
that referenced
this issue
Aug 12, 2018
bump db version
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
account_balance
indexing is currently defined as:The
by_account
index is redundant, as theby_balance
index (which could be better namedby_account_asset
) can answer any query theby_account
index can.In addition, an index by
(asset_type, balance)
is required to supporttop_n
authority. Again, theby_asset
functionality can be assumed by this new index.So the solution is:
by_balance
toby_account_asset
by_account
and rewrite logic to useby_account_asset
insteadby_asset
to composite key on(asset_type, balance)
The
equal_range()
ofboost::multi_index_container
will be useful for the new logic.The text was updated successfully, but these errors were encountered: