How to store multiple record in Mysql variable?

Does mysql B+ tree store all important information in internal node?

  • Hi all, I am going through MySQL and underlying data-structure  I came across B Trees and B+ trees and my findings pointed that MySQL uses some special form of B+ tree. Now my question is simple. 1. if i am creating a table with a primary key, foreign key, a unique key. And i have inserted 1 million records into my new table. what happens.  Now does MySQL B+ tree stores this information ( primary key, foreign key and unique key) with the node or it keeps in a separate block on the disk. Is MySQL b+ tree dynamic in its approach. Depending on the situation does it changes it tactic to handle the problem.

  • Answer:

    Well it is dependent on what kind of storage you use. Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file type. An .frm file stores the table format. The data file has an .MYD (MYData) extension. The index file has an .MYI (MYIndex) extension. All the data in InnoDB is stores in single tablespace be it index, table format or data. Tablespace can be raw disk partition. All InnoDB indexes are B-Trees where the index records are stored in the leaf pages of the tree. The default size of an index page is 16KB. When new records are inserted, InnoDB tries to leave 1/16 of the page free for future insertions and updates of the index records. Source: http://dev.mysql.com/doc/refman/5.6/en/innodb-table-and-index.html http://dev.mysql.com/doc/refman/5.5/en/myisam-storage-engine.html http://dev.mysql.com/doc/refman/5.5/en/innodb-storage-engine.html I don't think it will be dynamic as such may be in some sort of optimization but other than that I highly doubt.

Neeraj Khandelwal at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.