mysql page structure

mysql specific data is stored in the row, the row is stored in the page. That page is above the top row.

mysq a page size of 16K, of course, the size can be changed by modifying the configuration file.

mysql substantially schematic configuration page:

 

 

 When we create a new table when a user table recording section (user records) part is empty, after we insert a record to be recorded therein until full insertion into the brush will record information to the next page, the circulation back and forth. . .

 

Information recording head generally schematic:

 

 

 1.delete_mask: indicate whether the record is deleted diverted is actually deleted records and flag occupies one bit, which 0-- undeleted deleted 1--

 2.heap_no: indicates the current record position in the page, in addition, there are still two virtual heap_no rows for recording records this page maximum and minimum recording primary key

 3.next_record: represents the real data of the current record to the address offset of the next record real data, in fact, this is a single list, you can find a record next record. But it is worth noting that the next record is not the next record we insert in accordance with the order of the next record but the primary key values in ascending order. And a predetermined minimum recording a record of the primary key value is the smallest record stored in the page, and recording the next record in the maximum key value is the main page in the page maximum recording

 as the picture shows:

 

 

 Shown in FIG sequentially recorded on the recording order is the order of insertion (1.2.3.4), but we often non-sequential insertion will appear in the actual development. As shown below:

 

 

 When the non-sequential insertion occurs, although the intervening sequence (1.2.3.4) becomes the (1.2.4.3) but it will not change the order of the list is still maintained (1.2.3.4) It should be noted that in FIG heap_no non-sequential order of insertion and insertion heap_no is not the same.

 When we table record deletion occurs in the actual development process of the record information corresponding to the figure above example will change: change in the maximum and minimum rows of the rows (may vary), changes (in the reference data structure next_record changes of a single list deleted successor pointer blank operation), delete_mask change (0-- not delete 1-- deleted), change heap_no, changes in the value of n_owned

Note: No matter how we do CRUD operations, InnoDB for data page always maintains a single list, each node in the list is the primary key values in ascending order according to the stored

Guess you like

Origin www.cnblogs.com/hxjz/p/12555903.html