signum-network / signum-explorer

Signum Blockchain Explorer
GNU General Public License v3.0
9 stars 11 forks source link

Top accounts page has timeouts frequently #182

Open MrSon1Q opened 2 months ago

MrSon1Q commented 2 months ago

When I try to see top accounts in explorer I get time outs frequently.

image

I guess that it can be fixed by some approaches:

  1. Add a new index for the balance column in the account balance table. (The column is updated frequently, maybe that's why you haven't added it yet)

  2. The current logic retrieves the top 1000 records from the database, and then filters them to the page value (25) only to prevent the possibility of generating queries for the top 1000+. I think that we can consider other ways to prevent the user from accessing the Nth page that generates such queries and always get the top 25 records, instead of 1000.

pir8radio commented 1 month ago

are you seeing this on both explorers? https://explorer.notallmine.net timeouts that is, can probably add it to the cache routines since top accounts wouldnt change often.. can run that every 12 hours and prob be ok.