If there is not sufficient place for the new information in the target page when you change data, or if the filling level of a page is less than the predefined maximum level, then the database system has to change the structure of the B* tree.
This can cause some branches of the B* tree to have considerably more pages than other branches. Such an uneven distribution of the pages reduces the performance of the database system, because more accesses are required to search for data in branches than in branches with only a few pages.
The database system recognizes such uneven distributions and evens them out automatically (automatic reorganization). In doing so, the database system moves some entries to new positions and updates the pointers to the pages. Due to this, rebalancing the size of a table is not limited by the page size, but only by the total storage space that is available.
The following figure shows how the database system changes the B* tree structure due to an INSERT statement.
Example of distribution of a page on leaf level
In the address table, the city column is defined as the primary key. A user uses an INSERT statement to insert a new data record with the value Albas for the city column. The data record is too large for the corresponding leaf page in the B* tree, however. As a result, the database system performs the following actions:
...
1. The database system creates a new leaf page and inserts the new data record in the new leaf page. The entries on the new leaf page are sorted beginning with the new data record.
2. The database system updates the sort sequence of the leaf pages. If necessary, it copies all data records that belong to the sort area of the new leaf page from the leaf page with the next smallest sort area to the new leaf page, and then deletes it from the previous leaf page. This procedure is known as a page split.
3. If necessary, the database system updates the pointers to the following pages.
4. The database system inserts the addresses and separator information for the new leaf page in the corresponding root or B* tree index page at the next highest level.
¡ If the B* tree index page is too small, then the database system inserts a new B* tree index page at this index level.
¡ If the root page at the top level is too small, then the database system creates a new B* tree index level.