In-depth understanding of the creation process of MySQL index - timestamp field
P粉418351692
2023-08-10 16:05:59
<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>
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.