-
Notifications
You must be signed in to change notification settings - Fork 454
Bigger blockchain gets, topAccounts endpoint become less efficient #233
Comments
Why do you assume it is gettting worse as the blockchain grows? |
I have been checking this endpoint while blockchain was rebuilding, as height was bigger endpoint become slower and slower, on current height it's impossible to fetch any data. Infinite loading. Check yourself with enabled top accounts functionality. It's not useable. |
ok i'll check it! |
This is why https://explorer.lisk.io/topAccounts does not work currently. |
@karmacoma any idea why? it seems the original dev knows it because there is the TOP switch. But looking at the code i cannot tell. |
Not sure why the TOP switch is there, probably because in the beginning we only used this feature for the explorer, so we disabled for other use cases. The performance issue was never a factor before, as we did not have the number of accounts. It's likely due to a performance issue related to sorting account balances i.e. column indexing. |
Here is the query used to
It appears to be missing a |
Here is the query plan without a limit:
Here is the query plan with a limit of 100.
Reducing number of output rows from |
Adding an index to
Reduces total cost significantly from |
https://127.0.0.1:8000/api/accounts/top?&offset=0&limit=100
Currently with current main-net height this function is not usable.
It's getting worse and worse as blockchain grows. This issue has been already reported in lisk-explorer repo but its strictly related to this repository.
The text was updated successfully, but these errors were encountered: