On Wed, Nov 9, 2011 at 1:53 PM, Fabian <fabianpi...@gmail.com> wrote: > 2011/11/9 Nico Williams <n...@cryptonector.com> >> What's wrong with reading the whole file into memory at boot time as a >> way to prime the cache? Rebooting always takes some time, mostly the >> time to read all sorts of files. >> > It's a desktop application, I cannot pre-cache anything before the user > launches the app. After the launch a couple of inserts need to be done, but > having to read the whole database file into memory, just to be able to > perform those inserts, doesn't seem a scalable solution.
I don't get it. You're reading practically the whole file in a random manner, which is painfully slow, so why can't you read the file in one fell swoop (i.e., sequential reads)?? You've picked a technology that scales only vertically with the hardware. If you've reached the limit of that hardware (no, you've not) then it's time to upgrade the hardware or switch to a technology that scales horizontally. But you're not there yet. And this is for a desktop app, so horizontal scaling would seem out of the question (or else you'd have built a client/server app in the first place). This leaves you with pre-fetching the file. You could defer the pre-fetching as much as possible (e.g., wait until the Nth operation, for N<<10,000), but that's about as much as you can do. Or, if FTS really works better, then use that. nico -- _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users