search

Home  >  Q&A  >  body text

In-depth understanding of the creation process of MySQL index - timestamp field

<p>I want to understand how indexes are created in MySQL - i.e. if it is a <code>TimeStamp</code> field - it creates the hash of the <code>TimeStamp</code> field and stores it <strong> or </strong> only stores the literal value of the timestamp. Since timestamp precision is milliseconds - each index will be unique, so how effective is index creation? Is there any <strong>internal</strong> information that might help me understand this issue? </p>
P粉418351692P粉418351692474 days ago625

reply all(1)I'll reply

  • P粉704066087

    P粉7040660872023-08-11 13:38:42

    When you create an index on a TIMESTAMP field or any other data type, MySQL does not store the hash of the value or the literal value itself as the index key. Instead, it uses a data structure called a B-tree (balanced tree) to organize and store index keys. B-trees are widely used in databases because they provide an efficient way to search, insert, and delete data.

    reply
    0
  • Cancelreply