Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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

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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: