[Xapian-discuss] "Rolling" Database

Olly Betts olly at survex.com
Wed Dec 2 11:54:19 GMT 2009


On Wed, Dec 02, 2009 at 01:11:21PM +1100, Richard Heycock wrote:
> I'm using the ruby bindings and I've got a couple of questions.
> 
> 1) is it possible to close a database? I can flush the database and set
>    the database object to nil but I can't force the database destructor
>    to be called even if I run the garbage collector.

Not explicitly in 1.0.x.  1.1.x adds a close() method, mostly because of
the issues with delayed destruction in scripting languages.

> 2) Is there a good way of calculating an optimal size for a Xapian
>    database? For example I will be getting about ~ 3 million documents
>    a month should I be rolling every month, two months etc.

Optimal by what metric?

I think you'll probably need to decide what your criteria are, and then try
it with different set ups on realistic test data to get a useful answer to
this.

> 3) Is there a better way to this?

If your search load is high, it might be worth trying two databases - one
for the older data and one being updated, but keep the monthly databases
around so you can create a new "older data" database covering the desired
period when you roll over.

Cheers,
    Olly



More information about the Xapian-discuss mailing list