Reducing Bonsai Tree size by committing transactions
The solidDB® server provides a consistent view of data within one transaction. If a user does not commit a transaction, the server keeps an image of the database as it existed at the moment the transaction was started — even if the transaction is a read-only transaction. This is implemented by the multiversioning Bonsai Tree functionality, which stores the newest data in central memory. The new data is merged to the main storage tree as soon as currently active transactions no longer need to see the old versions of the rows.
When other connections perform many write operations, the server must use a large amount of memory to provide a consistent image of the database. If an open transaction remains uncommitted for a long duration of time, the server requires more memory. If the amount of memory available is insufficient, the server performs excessive paging or swapping, which slows performance.
To determine whether slow performance is caused by excessive Bonsai Tree growth, you can monitor memory usage and Bonsai Tree size using operating system tools and tools provided with thesolidDB® server.