[Xapian-devel] btree function question ?? ( prev charset error , send again )

kay jean kayjean at gmail.com
Thu Dec 16 02:41:06 GMT 2004


1. I will join the mail-list as soon as possible.

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.

3. Why btree hold 2 copies of the tree. If the space are not enough ,
you split the block , doesn;t it ?
       a.  Does the operation wok for transaction rollback or some other reason?
       b.  Does the operation work in alter() ? 

Thanks a lot

Hao Kuang , Ku



On Wed, 15 Dec 2004 14:03:24 +0000, Olly Betts <olly at survex.com> wrote:
> On Wed, Dec 15, 2004 at 03:28:13PM +0800, kay jean wrote:
> > after that I run the program again and again
> >
> > step 1 , db file size is 54099968 , get_entry_count is 1000000
> >
> > step 2 , db file size is 108208128 , get_entry_count is 1000255
> >
> > step 3 , db file size is 108240896 , get_entry_count is 1000868
> >
> > file size and get_entry_count grows slowly , Is that ok ??
> 
> I don't get the same results at all.  If I comment out the two
> calls to printf in the loop, I get:
> 
> olly at ixion:~/cvs/xapian/xapian-core/tests $ ./btreet;ls -l testDB
> revision is 0
> entry count 0
> -rw-r--r--    1 olly     olly     54099968 Dec 15 11:55 testDB
> olly at ixion:~/cvs/xapian/xapian-core/tests $ ./btreet;ls -l testDB
> revision is 1
> entry count 1000000
> -rw-r--r--    1 olly     olly     108199936 Dec 15 11:55 testDB
> olly at ixion:~/cvs/xapian/xapian-core/tests $ ./btreet;ls -l testDB
> revision is 2
> entry count 1000000
> -rw-r--r--    1 olly     olly     108199936 Dec 15 11:55 testDB
> 
> Which is what I'd expect.  The file size increases after the first
> revision because the Btree manager needs enough blocks to hold 2
> copies of the tree (the old and the new) so it can switch from one
> to the other atomically.  After that it has enough blocks spare to
> update.  So the file size stabilises after 2 updates and the number
> of entries is always 1000000.
> 
> I'm using CVS HEAD, but nothing significant has changed in the Btree
> code since 0.8.4.
> 
> Cheers,
> Olly
>




More information about the Xapian-devel mailing list