-
Notifications
You must be signed in to change notification settings - Fork 502
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
services/horizon: fix long-running payment migration #5059
Comments
The reason why the migration takes so long is because it is adding an index on the history_operations table:
The reason why the index is never used is because query to select payments contains an After running The reason why the payments queries have been working for us is because the query scans through the rows of the Finally the most important reason for why this query is still efficient is because it turns out the distribution of operations happens to be dense with payments. The query scans through history_operations row by row until it finds enough payment rows to fill the page limit (at most 200). It is theoretically possible that we could have many ledgers without a single payment operation but in practice that seems to never be the case. However, there are queries on the payments for account endpoint endpoint which timeout because some accounts have many transactions containing only a few payments (see #1808 for more details). In conclusion we should remove the |
I'm closing this issue because we have removed the index which was causing the long running migration. I created a separate issue ( #5072 ) to track the concern about how the distribution of stellar operations affects the payments endpoint . |
Running this migration takes exceedingly long on a full history db (>5 hours) in the version we released for testnet (2.27.0). We need to resolve this before pubnet release of protocol 20.
The text was updated successfully, but these errors were encountered: