💭 sql - SQLite: COUNT slow on big tables - Stack Overflow ========================================================= !https://stackoverflow.com/questions/8988915/sqlite-count-slow-on-big-tables Date: April 1, 2024 COUNT slow on big tables I'm having a performance problem in SQLite with SELECT COUNT(*) on large tables. CREATE TABLE Table1 ( Key INTEGER NOT NULL, ... several other fields ..., Status CHAR(1) NOT NULL, Selection VARCHAR... Stack Overflow · stackoverflow.com [1] Another interesting option for slow count queries in sqlite. > If you haven't DELETEd any records, doing: ``` sql SELECT MAX(ROWID) FROM "table" LIMIT 1; ``` !!! note This post is a thought [2]. It's a short note that I make about someone else's content online #thoughts [3] References: [1]: https://stackoverflow.com/questions/8988915/sqlite-count-slow-on-big-tables [2]: /thoughts/ [3]: /tags/thoughts/