3 ms·
Sometimes using mmap for SQL queries can speed them up (if you want to avoid adding too many indexes or cannot modify the db). Set this on the connection: PRA
by emadda 1y ago
Sometimes using mmap for SQL queries can speed them up (if you want to avoid adding too many indexes or cannot modify the db).
Set this on the connection:
PRAGMA mmap_size=…
https://www.sqlite.org/mmap.html https://www.sqlite.org/mmap.html
I think this works as it removes data copying between the os and your process.
Your process reads data from the os to execute the query.
With mmap the data reads have less overhead, so a full table scan may be fast enough.