-
Notifications
You must be signed in to change notification settings - Fork 22
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
[API]: Slow query: epoch by block #10601
Comments
I don't think this is an API problem, when running the queries against the same node, the timing is roughly the same: On n00:
On n06:
|
@gordsport I have unassigned myself - I will clarify the ticket. @guoguojin agreed that 1.3s for a simple API call is very slow, which needs attention. 10s is unacceptable, but that only happens during (for example) a migration. |
The underlying issue is at the database layer and the query that is used to get the first block height and last block height of an epoch. The block table has lots of rows, but we have to join to it twice for the API query and this is causing the inefficiency. It would be better for us to update the epochs table to store the start/end height of an epoch and create the appropriate triggers to update those columns when it happens which is much nicer than asking for it every time the API is called. |
API Overview
In order to please clients
We will speed up the API to fetch an epoch by block, because 1 second is too slow
So that epoch data can be fetched efficiently
REST: 1.7 seconds
Notes
The text was updated successfully, but these errors were encountered: