[Xapian-discuss] Best Practices for Compaction?

Peter Karman peter at peknet.com
Fri Sep 18 15:43:50 BST 2009


Richard Boulton wrote on 09/18/2009 08:47 AM:
> 2009/9/18 Arjen van der Meijden <acmmailing at tweakers.net>
> 
>> Hi Ken,
>>
>> We're only updating the database in intervals, not continuously.
>> What we're doing is basically:
>> [symlink for the database is to compacted database]
>> update "working" database
>> change symlink for database to "working"
>> compact working to a new compact database
>> change symlink for database back to compact
>>
> 
> I recommend using a stub-database file instead of a symlink - that way, if a
> reader has opened some of the database files but not others when the symlink
> changes, you don't get an inconsistent set of database files being opened.
> 
> There's a variety of swapping schemes like this: I've used various different
> schemes, depending on what requirements for updating speed and search speed
> I'm trying to satisfy.
> 

A cookbook of recipes on the wiki would be really helpful for this kind 
of thing, Richard. Would you write one up?

-- 
Peter Karman  .  http://peknet.com/  .  peter at peknet.com



More information about the Xapian-discuss mailing list