Can SQLite do decent full text search on a few hundred thousand

Back to list2025-12-09
You

Can SQLite do decent full text search on a few hundred thousand rows?

ChatGPT

Yes, FTS5 handles that size comfortably:

CREATE VIRTUAL TABLE notes_fts USING fts5(title, body, content=notes);
INSERT INTO notes_fts(notes_fts) VALUES('rebuild');
SELECT title, snippet(notes_fts, 1, '<b>', '</b>', '...', 12)
FROM notes_fts WHERE notes_fts MATCH 'archive NEAR/5 export';

The snippet function is the part people miss: it returns the matching fragment, which is what makes results readable rather than a list of titles.

You
latency-before-after.png
You

How do I know when it stops being worth it?

ChatGPT

When you stop noticing it. If it has not surfaced a problem in six months, it is either solved or it was never the bottleneck you thought.