MySQL-5.7-8.3 Optimization and Indexes

8.3.1 How MySQL Uses Indexes

8.3.2 Primary Key Optimization

8.3.3 Foreign Key Optimization

8.3.4 Column Indexes

8.3.5 Multiple-Column Indexes

8.3.6 Verifying Index Usage

8.3.7 InnoDB and MyISAM Index Statistics Collection

8.3.8 Comparison of B-Tree and Hash Indexes

8.3.9 Use of Index Extensions

8.3.10 Optimizer Use of Generated Column Indexes

8.3.11 Indexed Lookups from TIMESTAMP Columns

The best way to improve the performance of SELECT operations is to create indexes on one or more of the columns that are tested in the query.

提高SELECT操作性能的最佳方法是在查询中测试的一个或多个列上创建索引

The index entries act like pointers to the table rows, allowing the query to quickly determine which rows match a condition in the WHERE clause, and retrieve the other column values for those rows. All MySQL data types can be indexed.

引项的作用类似于指向表行的指针,允许查询快速确定哪些行匹配WHERE子句中的条件,并检索这些行的其他列值。所有MySQL数据类型都可以被索引。

Although it can be tempting to create an indexes for every possible column used in a query, unnecessary indexes waste space and waste time for MySQL to determine which indexes to use.

尽管为查询中使用的每一列创建索引很诱人,但不必要的索引会浪费MySQL确定使用哪个索引的空间和时间。

Indexes also add to the cost of inserts, updates, and deletes because each index must be updated. You must find the right balance to achieve fast queries using the optimal set of indexes.

索引还会增加插入、更新和删除的成本,因为每个索引都必须更新。您必须找到正确的平衡,以使用最优索引集实现快速查询。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值