In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article shows you what the non-leaf node pointer of MySQL is, which is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
The pointer is 8 bytes: 4 (number of unique positioning fields) + 4 (page no). The function is dict_index_build_node_ptr. Only this record, follow-up study
/ * 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); else {n_unique = dict_index_get_n_unique_in_tree_nonleaf (index) / / the number of fields uniquely located to the leaf node} tuple = dtuple_create (heap, n_unique + 1); / / create tuples / * 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); / / comparison field is data field dict_index_copy_types (tuple, index, n_unique); / / Type replication buf = static_cast (mem_heap_alloc (heap, 4)); / / allocate memory mach_write_to_4 (buf, page_no) / / write leaf node page no field = dtuple_get_nth_field (tuple, n_unique); / / number of fields that can be uniquely located dfield_set_data (field, buf, 4); / / number of fields written dtype_set (dfield_get_type (field), DATA_SYS_CHILD, DATA_NOT_NULL, 4); rec_copy_prefix_to_dtuple (tuple, rec, index, n_unique, heap) / / copy data dtuple_set_info_bits (tuple, dtuple_get_info_bits (tuple) | REC_STATUS_NODE_PTR); ut_ad (dtuple_check_typed (tuple)); return (tuple);} what is the non-leaf node pointer of MySQL? have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.