You are viewing a single comment's thread from:
RE: Why the Most Popular Accounts Query is Slow compared to Most Blocked Accounts Query?
A few things that come to my mind:
- You could switch to a different journal mode like 'WAL' as described in the official documentation (https://sqlite.org/wal.html), which allows that reading and writing can proceed concurrently.
- If that query really takes 20 minutes to finish, I guess there is something wrong with the columns/indices structure or it is related to a missing index for sorting/counting the rows.
- Do you return the rows all at once or are you using OFFSET and LIMIT?
- For such a large dataset I would highly recommend to use ids (integers) for the type (for example, 1 = 'mute', 2 = 'blog' etc.)
I'm pretty sure that this is not related to SQLite's performance :)
This might also help: https://www.sqlitetutorial.net/sqlite-having/
Great suggestions!
yes, the query has a
limit 100.the
typefield is indexed anyway .