Index和Index Hint的区别

本文解析了Axapa SELECT语句中使用INDEX与INDEXHINT的区别:INDEX仅指示排序方式,并不强制数据库使用特定索引;INDEXHINT则明确指定数据库必须使用指定索引进行查询。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Conclusion:

Adding the "index" statement to an Axapta select, it does NOT mean that this index will be used by the database. What it DOES mean is that Axapta will send an "order by" to the database.

Adding the "index hint" statement to an Axapta select, it DOES mean that this index will be used by the database (and no other one).

1. select文里加入了index, 并不表示执行的时候会选择你指定的index来查找数据。但是可定会按你指定的Index里面的字段来排序。

2.select文里加入了index hint, 表示执行的时候肯定会选择你指定的index来查找数据。

这下终于明白了为什么经常看到sql文里有index hint而没有index, 它很鸡肋,order by也可以实现它的功能。 


文章来源

http://dynamicsuser.net/forums/t/37123.aspx

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值