title: how B-tree indexing works in mysql
body: <p>When I create an index for a table in mysql, I see that the index_type is type <code>BTREE</code>. Now although  I understand about btree(s), I do not quiet understand how it stores the index and how the database searches the records based on this.</p>
  
  <p>I mean, btree is excellent for databases to perform read and writes large blocks of data, 
  when we create an index for column type of <code>Primary key</code>, what I understand is, it creates a tree and splitting the values for the root based on the value type of the root. </p>
  
  <p>Now, does it store only the the primary key <code>ID</code> under the trees or the whole data associated with that primary key?</p>
  
  <p>After finding the wanted primary ID, how does the database extract the record? </p>