何时可以使用索引 [英] when can indexes be used

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

问题描述



我们什么时候在sql查询中使用索引....?

解决方案

索引使用者 sql查询和未在 sql查询中使用。



当查询效果不佳时创建索引。

参考:



http:/ /odetocode.com/code/237.aspx [ ^ ]


简而言之:

当表中有数千条记录时,检索信息需要很长时间。

因此 c>索引是在经常访问的列上创建的,以便信息可以快速检索



索引可以在一列或一组列上创建。

当创建索引时,它首先对数据进行排序,然后为每一行分配一个ROWID。



有效索引是在数据库应用程序中提高性能的最佳方法之一。


Hi,
When do we use indexes in sql queries....?

解决方案

Indexes are used by sql queries and not used in sql queries.

You create indexes when your queries are not performing well.


Refer this:

http://odetocode.com/code/237.aspx[^]


In short:
When there are thousands of records in a table, retrieving information will take a long time.
Therefore indexes are created on columns which are accessed frequently, so that the information can be retrieved quickly.

Indexes can be created on a single column or a group of columns.
When a index is created, it first sorts the data and then it assigns a ROWID for each row.

Effective indexes are one of the best ways to improve performance in a database application.


这篇关于何时可以使用索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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