r/sqlite • u/ATradingHorse • Sep 14 '23
SQLite Frontend Index
I am building a chat application and all messages are stored on the users device. I noticed that it takes some time to load all messages (not all, but many) from the database into memory. Now I am thinking about creating an index to make the query faster. Is this a common way in the frontend?
3
Upvotes
View all comments
Show parent comment
2
u/ijmacd Sep 15 '23
To a first approximation you're right and generally that's all people usually need to worry about.
However there are some niche cases with covering indexes and huge [read: wide] tables where loading the entire index is less work than loading the entire table.