[Xapian-devel] btree function question ?? ( prev charset error , send again )
Olly Betts
olly at survex.com
Thu Dec 16 17:34:37 GMT 2004
On Thu, Dec 16, 2004 at 10:41:06AM +0800, kay jean wrote:
> 2. I have two computers using redhat 9 , after tring several times , I
> found that the file size grows slowly in one computer A and stable in
> another B . Even in computer A , the file size don't grows every time,
> and disk tool told me that computer A disk is ok. ....Anyway , thank
> you very much.
I can't really see why this should be. Are they using the same Xapian
version?
And what compiler version?
> 3. Why btree hold 2 copies of the tree.
You're updating the whole tree without calling commit(). While this is
happening, the old tree needs to still work, and the new tree is being
constructed on disk. That's 2 copies. When you call commit, the root
is switched to point to the new tree, and the blocks from the old tree
are marked as unused.
Usually you only change part of the tree, so you only need extra blocks
for the part you're changing.
See the "Btree implementation" section of this document for more details:
http://xapian.org/docs/quartzdesign.html
It's also in the docs subdirectory of the xapian-core sources.
> If the space are not enough ,
> you split the block , doesn;t it ?
Yes, but that's not connected to this.
> a. Does the operation wok for transaction rollback or some
> other reason?
It's so we can apply a set of changes atomically - you can think of that
as transaction rollback if you like.
> b. Does the operation work in alter() ?
Yes.
Cheers,
Olly
More information about the Xapian-devel
mailing list