On 09/20/2018 01:49 AM, Roger Cuypers wrote:
I'm trying to optimize a C++ application that uses sqlite 3 for database
access. As far as I know it uses journaling with WAL and has a lot of
files/tables (about 400). Profiling this application with Linux perf, I found
that it spends about 30% of its time inside the rbuFindMaindb function of
SQlite3. This function mostly consists of a loop that goes through all of the
journaling WAL files in the virtual file system, so it seems that in order to
bring down the cost of said loop I would have to reduce the number of WAL
files. Seeing that apparently sqlite creates a WAL for every database file, I'm
not aware how to fix this.
Now my question: How can I optimize this? Can I reduce the number of WAL files
without reducing the number of database files? Is there a different journaling
mode that does not call rbuFindMaindb so often? Can I optimize my program so
that this function is called less often?
Are you actually using the RBU extension?
https://www.sqlite.org/rbu.html
Has your application called any sqlite3rbu_*() APIs?
Dan.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users