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

Olly Betts olly at survex.com
Wed Dec 15 14:03:24 GMT 2004


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