需要查询汇总一个数据,数据量较大(百万行数据),主要有以下几个字段:客户、部门、客户业态、客户类型、账目、销售、成本、利润等。
现在按部门汇总或业态汇总30秒左右
按部门、账目汇总30秒左右
按账目汇总15小时也未查询出结果
请问是什么原因导致此现象.
Rocky Yang
你好,
请问您是怎么查询的呢,相关的查询语句是什么?
如果按前两种方式可以查询到数据的话,那有可能是按账目汇总语句本身出现了什么问题。
Chester Hong MSDN Community Support | Feedback to us Develop and promote your apps in Windows Store Please remember to mark the replies as answers if they help and unmark them if they provide no help.
針對 where 裡邊用到的欄位以及 join on 的欄位建立些index試試,
一般來說能有效地提升查詢效能
Best regards