久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

MySQL的非葉子節點指針是什么

182次閱讀
沒有評論

共計 2164 個字符,預計需要花費 6 分鐘才能閱讀完成。

本篇文章為大家展示了 MySQL 的非葉子節點指針是什么,內容簡明扼要并且容易理解,絕對能使你眼前一亮,通過這篇文章的詳細介紹希望你能有所收獲。

這個指針為 8 字節:4(唯一定位字段個數)+4(page no)。函數為 dict_index_build_node_ptr。僅此記錄,后續研究

/**********************************************************************//**
Builds a node pointer out of a physical record and a page number.
@return own: node pointer */
dtuple_t*
dict_index_build_node_ptr(
/*======================*/
 const dict_index_t* index, /*!  in: index */
 const rec_t* rec, /*!  in: record for which to build node
 pointer */
 ulint page_no,/*!  in: page number to put in node
 pointer */
 mem_heap_t* heap, /*!  in: memory heap where pointer
 created */
 ulint level) /*!  in: level of rec in tree:
 0 means leaf level */
 dtuple_t* tuple;
 dfield_t* field;
 byte* buf;
 ulint n_unique;
 if (dict_index_is_ibuf(index)) {
 /* In a universal index tree, we take the whole record as
 the node pointer if the record is on the leaf level,
 on non-leaf levels we remove the last field, which
 contains the page number of the child page */
 ut_a(!dict_table_is_comp(index- table));
 n_unique = rec_get_n_fields_old(rec);
 if (level   0) { ut_a(n_unique   1);
 n_unique--;
 }
 } else { n_unique = dict_index_get_n_unique_in_tree_nonleaf(index);//  唯一定位   到葉子節點的字段個數
 }
 tuple = dtuple_create(heap, n_unique + 1); // 建立元組  
 /* When searching in the tree for the node pointer, we must not do
 comparison on the last field, the page number field, as on upper
 levels in the tree there may be identical node pointers with a
 different page number; therefore, we set the n_fields_cmp to one
 less: */
 dtuple_set_n_fields_cmp(tuple, n_unique); // 比較字段為   數據域
 dict_index_copy_types(tuple, index, n_unique); // 進行類型復制
 buf = static_cast byte* (mem_heap_alloc(heap, 4)); // 分配內存
 mach_write_to_4(buf, page_no);// 寫入   葉子節點 page no
 field = dtuple_get_nth_field(tuple, n_unique); // 字段個數   能夠唯一定位的字段個數
 dfield_set_data(field, buf, 4);// 寫入字段個數
 dtype_set(dfield_get_type(field), DATA_SYS_CHILD, DATA_NOT_NULL, 4);
 rec_copy_prefix_to_dtuple(tuple, rec, index, n_unique, heap); // 復制數據
 dtuple_set_info_bits(tuple, dtuple_get_info_bits(tuple)
 | REC_STATUS_NODE_PTR);
 ut_ad(dtuple_check_typed(tuple));
 return(tuple);
}

上述內容就是 MySQL 的非葉子節點指針是什么,你們學到知識或技能了嗎?如果還想學到更多技能或者豐富自己的知識儲備,歡迎關注丸趣 TV 行業資訊頻道。

正文完
 
丸趣
版權聲明:本站原創文章,由 丸趣 2023-07-28發表,共計2164字。
轉載說明:除特殊說明外本站除技術相關以外文章皆由網絡搜集發布,轉載請注明出處。
評論(沒有評論)
主站蜘蛛池模板: 花垣县| 武威市| 贵德县| 库尔勒市| 泸州市| 镇安县| 伊宁县| 新平| 乌鲁木齐市| 彰化县| 鹤壁市| 剑阁县| 连城县| 丹江口市| 孝感市| 华宁县| 长乐市| 四子王旗| 商都县| 和静县| 噶尔县| 康乐县| 治县。| 镇原县| 景宁| 南澳县| 湘西| 蛟河市| 许昌市| 且末县| 页游| 抚州市| 大理市| 定陶县| 巫山县| 乌兰察布市| 漾濞| 肃宁县| 湾仔区| 盐边县| 焦作市|