Going through this answer for a stack-overflow question, I found a fact that
In The physical structure of InnoDB index pages I describe the Last Insert Position, Page Direction, and Number of Inserts in Page Direction fields of each index page. This is how the tracking for ascending vs. descending order is done (as left vs. right, though). With each insert, the last inserted record is compared to the currently inserted one, and if the insert is in the same "direction", the counter is incremented. This counter is then checked to determine the page split behavior; whether to split in half or create a new, empty page
It is understood that page split up is based on Number of Inserts in Page Direction
But , I wonder whether there will be threshold for "Number of Inserts in Page Direction" to initiate page split up? Any particular logic behind setting "Page Direction" flag?
I am curious in getting these concepts with a working example with asap details!!! All efforts welcome.
Best Answer
The author is talking about
PAGE_N_DIRECTION
. This has nothing to do with triggering splitting, which is performed bypage_dir_split_slot
. Splitting/merging is determined by aMIN
andMAX
on the directory slotYou don't split when you fall under
MIN
, you merge (viapage_dir_balance_slot
).PAGE_N_DIRECTION
is for an optimization,