-
Notifications
You must be signed in to change notification settings - Fork 500
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
Remove unused indexes from horizon schema #5061
Comments
Update: history_effects
history_transaction_claimable_balances
history_operation_claimable_balances
history_claimable_balances
history_ledgers
history_assets
offers
claimable_balances
trust_lines
accounts
liquidity_pools
history_operations
history_trades
history_trades_60000
|
@urvisavla you're right that Regarding Regarding |
Result of running this query on the production RW database:
|
Ran the following queries on the staging and verified that the index count is increasing proportionally for both
|
I see you were sending the requests to localhost. If you ran those curl commands on an ingesting node then the queries got executed by the RW database. But if you were to run those curl commands on non-ingesting nodes it should only query the RO database. |
After investigation the following indexes are found to be unused.
**used by reap routine |
While investigating #5059 , I discovered that the
history_operations_on_type
was not used by Horizon despite being present in the db schema for several years. I used the following query from https://pgdash.io/blog/finding-unused-indexes-in-postgresql.html to find all the indexes in the horizon schema and the number of times each index has been scanned:The output from that query indicates that there are other indexes which are also unused:
If we ignore all the primary key indexes, the indexes with 0 scans are likely to be unused. We should investigate all the indexes below and determine if they can be removed:
The text was updated successfully, but these errors were encountered: