什么是索引? [英] What is an index?

查看:94
本文介绍了什么是索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是MySQL中的索引?

解决方案

索引加速SELECT查询,因为索引按定义排序。此外,UNIQUE索引强制执行该列的值(或绑定列的值的组合)仅存在一次的约束(同样适用于PRIMARY,但与UNIQUE键相比,PRIMARY只能对每个表存在一次)。<索引是一种权衡:它们极大地加快了SELECT查询(当使用的列有INDEX时),但是它们使得MySQL表消耗更多的空间,并且在更改表时花费更多的时间。 INSERT / UPDATE / DELETE。


What is an index in MySQL ????

解决方案

Indexes speed up SELECT queries because indexes are sorted by definition. Additionally a UNIQUE index enforces the constraint that the value of that column (or the combination of values of bound columns) exists only once (same applies to PRIMARY, but PRIMARY can only exist once per table in contrast to a UNIQUE key).

Indexes are a tradeoff: they tremendously speed up SELECT queries (when used columns have an INDEX) but they make that MySQL table consume more space and cost more time when changing the table via INSERT/UPDATE/DELETE.

这篇关于什么是索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆