You are here: Configuration > Common Configuration > B-Tree Node Size

B-Tree Node Size

db4o uses B-tree indexes for increased query performance and reduced memory consumption. B-trees are used for field-index, class-index and for the id-system. B-trees are optimized for scenarios where a part of the data is on secondary storage such as a hard disk, since disk accesses is extremely expensive. B-trees minimize the number of disk accesses required. You find more information about B-trees on the internet.

You can tune the B-trees by configuring the size of a node. Larger node sizes require less disk access, since a node is read on one read-operation. However it consumes more memory to keep the larger nodes available. Also larger nodes take longer to write back to disk. You need to tune the B-tree node size according to your application requirements. When benchmarking the settings, use large data sets. The influence of B-trees is more significant for larger dabases with 100'000 and more objects.

IEmbeddedConfiguration configuration = Db4oEmbedded.NewConfiguration();
configuration.Common.BTreeNodeSize = 256;
CommonConfigurationExamples.cs: Change B-tree node size
Dim configuration As IEmbeddedConfiguration = Db4oEmbedded.NewConfiguration()
configuration.Common.BTreeNodeSize = 256
CommonConfigurationExamples.vb: Change B-tree node size