销售价格方案维护选择客户时,很长时间才出来物料价格
金蝶云社区-南瀚卢生
南瀚卢生
0人赞赏了该文章 803次浏览 未经作者许可,禁止转载编辑于2016年06月18日 21:45:40

旗舰版4.0和4.2的销售价格方案维护那里,客户使用了客户和物料的组合方案,点一个客户的时候,要2分钟以上才出来,实际上记录数才1000条左右。请问是不是查询的问题,能不能优化一下?客户意见很大,因为经常要改价格和增加新产品的价格,影响很大,能帮忙查查什么问题?
用数据库跟踪,发现某一条语句,查询1000条记录,就用了一分钟,该语句如下:SELECT vw_ICCtoIGroup.FInterID,vw_ICCtoIGroup.FClassTypeID,vw_ICCtoIGroup.FNumber,vw_ICCtoIGroup.FName,vw_ICCtoIGroup.FLogic ,vw_ICPrcPly_CtoI.FID, t_ICItem.FNumber AS t_ICItemFNumber , t_Auxitem.FName AS t_AuxitemFName , t_Measureunit.FName AS t_MeasureunitFName FROM vw_ICCtoIGroup INNER JOIN vw_ICPrcPly_CtoI ON vw_ICCtoIGroup.FInterID=vw_ICPrcPly_CtoI.FInterID AND vw_ICCtoIGroup.FID = vw_ICPrcPly_CtoI.FID
LEFT JOIN t_ICItem ON vw_ICPrcPly_CtoI.FItemID=t_ICItem.FItemID AND t_ICItem.FItemID<>0
LEFT JOIN t_Organization ON vw_ICPrcPly_CtoI.FRelatedID=t_Organization.FItemID AND t_Organization.FItemID<>0
LEFT JOIN t_AuxItem ON vw_ICPrcPly_CtoI.FAuxPropID=t_AuxItem.FItemID AND t_AuxItem.FItemID<>0
LEFT JOIN t_Measureunit ON vw_ICPrcPly_CtoI.FUnitID=t_Measureunit.FItemID AND t_Measureunit.FItemID<>0
LEFT JOIN t_Currency ON vw_ICPrcPly_CtoI.FCuryID=t_Currency.FCurrencyID AND t_Currency.FCurrencyID<>0
LEFT JOIN t_SubMessage ON vw_ICPrcPly_CtoI.FPriceType=t_SubMessage.FInterID AND t_SubMessage.FInterID<>0
LEFT JOIN t_Currency t_Currency1 ON vw_ICPrcPly_CtoI.FLPriceCuryID=t_Currency1.FCurrencyID AND t_Currency1.FCurrencyID<>0
LEFT JOIN t_User t_User2 ON vw_ICPrcPly_CtoI.FCreator=t_User2.FUserID AND t_User2.FUserID<>0
LEFT JOIN t_User t_User3 ON vw_ICPrcPly_CtoI.FOperator=t_User3.FUserID AND t_User3.FUserID<>0
WHERE vw_ICCtoIGroup.FParentID=10107 AND vw_ICCtoIGroup.FDetail<>0 AND vw_ICPrcPly_CtoI.FNumber='01' And vw_ICPrcPly_CtoI.FPlyType='PrcAsm1' And IsNull(t_ICItem.FDeleted,0)=0 AND vw_ICCtoIGroup.FClassTypeID=1007701 AND vw_ICCtoIGroup.FDiscontinued=0 Order By t_ICItem.FNumber , t_Auxitem.FName , t_Measureunit.FName