OdyseeTeam / chainquery

Chainquery parses and syncs the LBRY blockchain data into structured SQL
https://lbry.tech
MIT License
2.25k stars 42 forks source link

Add index on "effective_amount" in claims table #163

Open marcdeb1 opened 3 years ago

marcdeb1 commented 3 years ago

If we want to fetch statistics on content on Chainquery, such as Top claims, we need to have an index on the effective_amount column. https://chainquery.lbry.io/api/sql?query=SELECT%20*%20from%20claim%20order%20by%20effective_amount%20desc%20LIMIT%2010

Otherwise, the query is too slow. It would open a world of possibilities for statistics based on Chainquery.