Lines Matching refs:balance
75797 #define NB 3 /* (NN*2+1): Total pages involved in the balance */
76240 ** This version of balance() handles the common special case where
76245 ** Instead of trying to balance the 3 right-most leaf pages, just add
76481 ** balancing routine to fix this problem (see the balance() routine).
76552 /* Find the sibling pages to balance. Also locate the cells in pParent
76704 ** cells into a parent on a prior balance, and divider cells are always
76709 ** This must be done in advance. Once the balance starts, the cell
76861 ** get a better balance.
76864 ** be so out of balance as to be illegal. For example, the right-most
77017 ** cells stored on sibling pages following the balance operation. Pointer
77203 ** b-tree structure by one. This is described as the "balance-shallower"
77372 static int balance(BtCursor *pCur){
77396 ** next iteration of the do-loop will balance the child page.
77436 ** happens, the next iteration of the do-loop will balance pParent
77456 ** will balance the parent page to correct this.
77874 /* If no error has occurred and pPage has an overflow cell, call balance()
77875 ** to redistribute the cells within the tree. Since balance() may move
77880 ** back to the root page as balance() used to invalidate the contents
77898 rc = balance(pCur);
77900 /* Must make sure nOverflow is reset to zero even if the balance()
78199 ** call to balance() repairs the tree, and the if(...) condition is
78207 ** on the leaf node first. If the balance proceeds far enough up the
78210 ** walk the cursor up the tree to the internal node and balance it as
78216 ** then balance() will always be a no-op. No need to invoke it. */
78219 rc = balance(pCur);
78228 rc = balance(pCur);