MySQL InnoDB table--btree Basic data structure

Source: Internet
Author: User

MySQL InnoDB table is the index organization table this should be the knowledge that every MySQL learner will learn first, which means that the data in this table is stored in the primary key order, that is, the btree leaf node stores all the data for that row.

I started with Oracle, the first time I contacted MySQL, the default engine was MyISAM. At that time, I saw that the company established all the InnoDB table in the first column plus a business-independent self-increment key, I think it is not necessary to ask some people to do so the meaning of the answer is also let people do not understand, in fact, also did not say fundamentally, just said that the efficiency will be better. So I generally do not use this form in the construction of the Data Warehouse project, most of the tables do not specify the primary key.

Actually now want to think, the person who first design those watches really is to MySQL InnoDB has studied, build table is very fastidious. So, what's btree like?

I drew a picture, but this figure is a bit problematic, the leaf node should be a doubly linked list, I only draw a one-way list. This also can be seen, all the values are stored in the leaf node, as for each page can put how much data, I have not textual research, if you know may wish to tell me. Often see this picture I think of my college days of blood years, every day to draw a binary tree to calculate the cost of traverse, when really young don't know sorrow taste ah. The blue squares here refer to pointers, and I don't distinguish between pointers to sub-pages and pointers to the next leaf page.

The basic data structure has been made clear, the next time to update the insert data and delete data, how to do.

MySQL InnoDB table--btree Basic data structure

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.