选择查询花费太多时间来检索空值的数据 [英] Select query takes too much time to retrieve data for blank values
问题描述
我有一个名为TrackerResponse的表,其列如下:
Id(PK)
TrackerId(FK)
ImagePath
EventName(Nullable)
纬度
经度
角度
方向
ResponseCode
InputStatus
OutputStatus
启用Idexes:
EventName(非集群)
ImagePath(非集群)
ReceiveTime(非集群)
TracherId(非群集)
TrackerResponseId(聚集)
现在的问题是,当EvenName列中有一些空白值时特定ID然后用select查询获取数据需要很长时间。
我尝试过的方法:
我用null更新了空白值并刷新了
索引,但没有任何改进。
I have a table named TrackerResponse having columns as following :
Id (PK)
TrackerId(FK)
ImagePath
EventName(Nullable)
Latitude
Longitude
Angle
Direction
ResponseCode
InputStatus
OutputStatus
Having Idexes on :
EventName (Non-Clustered)
ImagePath (Non-clustered)
ReceiveTime(Non-clustered)
TracherId(Non-clustered)
TrackerResponseId(Clustered)
Now the problem is that when there are some blank values in EvenName column for a specific Id then it takes too long to fetch data with select query.
What I have tried:
I have updated blank values with null and also refreshed
indexes but there is no improvement .
推荐答案
我建议按照说明操作在那篇文章中:如何:优化SQL索引 [ ^ ]。最重要的部分:使用SQL事件探查器捕获数据
这个:重组和重建索引 [ ^ ]也可能有用。
I'd suggest to follow instructions in that article: How To: Optimize SQL Indexes[^]. The most important part: Use SQL Profiler to Capture Data
This: Reorganize and Rebuild Indexes[^] may be helpful too.
这篇关于选择查询花费太多时间来检索空值的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!