sql索引,如何正确使用

编程入门 行业动态 更新时间:2024-10-19 21:36:00
本文介绍了sql索引,如何正确使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我用google网页索引.. 只有我理解正确 是 用于创建索引

i googled web for indexing .. and only that i understand properly is for creating index

create index MyIndex ON companytbl(companyId) and for using it i have to use given below select * from companytbl with (Index(MyIndex))

i没有看到这个查询的任何影响.. 任何一个人都可以告诉它是对的...... 还有给定的聚集,非聚集索引......考试的内容是什么请... 在此先感谢..我无法找到这个

i have not seen any effect of this query .. can any one tell is it right ... there are also given clustered , non clustered index ... what is it with example ... Thanks in advance .. iam unable to find out corrct material for this

推荐答案

Quote:

我没有看到这个查询的任何影响..

i have not seen any effect of this query ..

当表有大量数据时,你可以看到效果。并查看执行计划 [ ^ ]用于幕后 查看此文章 数据库性能优化第1部分(索引策略) [ ^ ]

You could see the effect when the table has massive data. And see the Execution plan[^] for behind the scene(s) Check this article Database performance optimization part 1 (Indexing strategies)[^]

索引意味着您的数据库不需要比较每一行来查找你想要的价值观。想象一下,你有书,你想在其中找到一些东西。你看看索引吧?这是一样的。关键列的索引(您经常查询的索引)将使您的数据库更快。没有索引的数据库距离堆只有一步之遥。 An index means that your database doesn't need to compare each row to find the values you want. Imagine you have book and you want to find something in it. You look in the index, right ? This is the same. Indexes on key columns ( ones you query a lot ) will make your DB a LOT faster. A DB without indexes is one step away from a heap.

更多推荐

sql索引,如何正确使用

本文发布于:2023-10-13 10:08:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1487656.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何正确   索引   sql

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!