Indexes are the best apposite choice for quickly retrieving the records. This is nothing but cutting down the number of Disk IO. Instead of scanning the complete table for the results, we can decrease the number of IO's or page fetches using index structures such as B-Trees or Hash Indexes to retrieve the data faster. The most convenient way to consider an index is to think like a dictionary. It has words and its corresponding definitions against those words. The dictionary will have an index on "word" because when we open a dictionary and we want to fetch its corresponding word quickly, then find its definition. The dictionary generally contains just a single index - an index ordered by word. When we modify any record and change the corresponding value of an indexed column in a clustered index, the database might require moving the entire row into a separately new position to maintain the rows in the sorted order. This action is essentially turned into an update query into a DELETE followed by an INSERT, and it decreases the performance of the query. The clustered index in the table can often be available on the primary key or a foreign key column because key values usually do not modify once a record is injected into the database.


翻译:索引是快速检索记录的最佳适当选择。 这只不过是减少磁盘 IO 的数量而已。 我们不用扫描完整表格的完整结果, 也可以用 B- Treees 或 Hash 索引等索引结构来减少 IO 或页面获取的数量, 以便更快地检索数据。 最方便地考虑索引的方法是像字典一样思考索引。 它有词及其相对这些词的相应定义。 字典上将有一个“ 字典” 索引, 因为当我们打开字典并想要快速获取相应的单词, 然后找到定义 。 字典一般只包含一个单一索引 - 单词命令的索引 。 当我们修改任何记录并改变组合索引索引中索引列的相应值时, 数据库可能需要将整个行移动到一个单独的新位置, 以维持排序顺序中的行。 这一行动基本上变成更新查询, 由 INSERT 跟随为 DELETE, 并且它会降低查询的性能。 表格中的组合索引通常会在主键或外部键列上提供, 因为通常不会修改数据库。

0
下载
关闭预览

相关内容

Microsoft SQL Server 是由美国微软公司所推出的关系数据库解决方案,最新的版本是SQL Server 2012,已经在2012年3月6日发布。
FlowQA: Grasping Flow in History for Conversational Machine Comprehension
专知会员服务
34+阅读 · 2019年10月18日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
163+阅读 · 2019年10月12日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
计算机视觉的不同任务
专知
5+阅读 · 2018年8月27日
【推荐】自然语言处理(NLP)指南
机器学习研究会
35+阅读 · 2017年11月17日
【推荐】YOLO实时目标检测(6fps)
机器学习研究会
20+阅读 · 2017年11月5日
Semantics of Data Mining Services in Cloud Computing
Arxiv
4+阅读 · 2018年10月5日
VIP会员
相关资讯
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
计算机视觉的不同任务
专知
5+阅读 · 2018年8月27日
【推荐】自然语言处理(NLP)指南
机器学习研究会
35+阅读 · 2017年11月17日
【推荐】YOLO实时目标检测(6fps)
机器学习研究会
20+阅读 · 2017年11月5日
Top
微信扫码咨询专知VIP会员