一.怎样用索引才高效 1.隔离索引列 MySQL generally can’t use indexes on columns unless the columns are isolated in the query. “Isolating” the column means it should not be part of an expression or be inside a function in the query. 如,以下的查询不能用actor_id索引 SELECT actor_…
一. 1.什么是B-Tree indexes? The general idea of a B-Tree is that all the values are stored in order, and each leaf page is the same distance from the root. A B-Tree index speeds up data access because the storage engine doesn’t have to scan the whole tab…
一. 1.什么是hash index A hash index is built on a hash table and is useful only for exact lookups that use every column in the index. For each row, the storage engine computes a hash code of the indexed columns, which is a small value that will probably…
一.聚集索引介绍 1.什么是聚集索引? InnoDB’s clustered indexes actually store a B-Tree index and the rows together in the same structure. 2.为什么一张表只能一个聚集索引? When a table has a clustered index, its rows are actually stored in the index’s leaf pages.The term “clustered…
一. 1. 1). Indexes reduce the amount of data the server has to examine.2). Indexes help the server avoid sorting and temporary tables.3). Indexes turn random I/O into sequential I/O. Lahdenmaki and Leach’s book also introduces a three-star system for…
1.MySQL架构图 2.事务的隔离性 事务的隔离性是specific rules for which changes are and aren’t visible inside and outside a transaction (1)READ UNCOMMITTED In the READ UNCOMMITTED isolation level, transactions can view the results of uncommitted transactions. At this le…
1.Good schema design is pretty universal, but of course MySQL has special implementation details to consider. In a nutshell, it’s a good idea to keep things as small and simple as you can. MySQL likes simplicity, and so will the people who have to wo…