On Fri, Feb 11, 2011 at 10:50 PM, Thomas Fjellstrom < tfjellst...@strangesoft.net> wrote:
> I've seen numbers on the internet stating that sqlite is super fast, should > be > able to handle tens of thousands of inserts or updates in a second or two, > even in sync mode. So I'm a bit stumped as to why its performance is so low > in > my case. One time, I saw it take 5 seconds to flush almost 3k rows back to > the > db. > > No hosts are actually ever removed from the database, which has about 120k > hosts in it by now, totaling up to a file size of around 7-8MB total. So > its > not a lot of data, and the queries are pretty simple. So I really am > stumped. > You mentioned your db is 8mb. If you are using the default page size of 1k, that means you have 8k pages in your db. The default cache size is 2000 pages, so your db doesn't fit into SQLite's default cache. I'd suggest using pragma page_size=4096. This will have the effect of increasing your cache size from 2mb to 8mb and prevent cache overflow. You might want to use pragma cache_size=3000 as a safety margin. This would be a 12MB cache with 4KB pages. Jim -- HashBackup: easy onsite and offsite Unix backup http://www.hashbackup.com _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users