[Xapian-discuss] Read accesses through WritableDatabase are slow

Jean-Francois Dockes jean-francois.dockes at wanadoo.fr
Mon Oct 23 08:45:14 BST 2006


Except if I'm mistaken, read accesses (like postlist_begin(),
get_document()) through a Xapian::WritableDatabase seem to trigger writes
on the database files, which makes them slow (because of the fsync()
calls).

Actually, it is apparently enough for the Xapian::WritableDatabase to
exist, for the write calls to be triggered even if actual accesses go
through a Xapian::Database.

A program that does a variable mix of read and write accesses has no good
solution between using a WritableDatabase for all accesses (slow for
read), or on-demand creation of the WritableDatabase (slow for write).

The indexing program in Recoll uses the xapian index to store the
modification time for each indexed file (on a later pass, only modified
files are actually indexed). This means that on a normal run the program
mostly does read queries (to check the mtimes), with occasional indexing
for modified files. The many write-on-read operations on the index make
this more slow and disk-intensive than would appear necessary.

I could use an auxiliary database to store the update times.

Would someone have a better idea of how to handle this issue ?

Regards,
J.F. Dockes








More information about the Xapian-discuss mailing list