"Igor Tandetnik" <itandet...@mvps.org> writes: > Nikolaus Rath wrote: >> When running apswtrace on my Python program, I got the following >> output: >> >> LONGEST RUNNING - AGGREGATE >> >> 16638 11.041 UPDATE inodes SET size=MAX(size,?), ctime=?, mtime=? >> WHERE id=? 16638 0.938 SELECT s3key FROM inode_s3key WHERE inode=? >> AND offset=? >> >> i.e. both statements were executed 16638 times, but execution of the >> first took 11 seconds in total and execution of the second only 0.9 >> seconds. > > Select likely gets data from in-memory cache. Update has to physically > write to disk. Memory is much faster than disk.
Why does it have write to the disk? With PRAGMA synchronous = off, SQLite should return as soon as the data is in the kernel cache, shouldn't it? > If at all possible, group write operations together into a transaction. Not possible here, unfortunately. The queries do not run sequentially but are triggered by external events. Best, -Nikolaus -- »Time flies like an arrow, fruit flies like a Banana.« PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users