项目里面有几个查询太慢了,但是hql都是必须的,不能改,但是条件字段加索引,反而更慢了,怎么办呀。我sql贴一下,谁有好的方法。

 

from IncidentMonitorFilter where status =1 and creator.userID =” + getLoginUser().getUserID()
sql:select incidentmo0_.filterID as filterID1_123_, incidentmo0_.userID as userID6_123_, incidentmo0_.description as descript2_123_, incidentmo0_.filterCondition as filterCo3_123_, incidentmo0_.filterContent as filterCo4_123_, incidentmo0_.filterName as filterNa5_123_ from t_inc_monitorFilter incidentmo0_ where status=1 and incidentmo0_.userID=520

from IncidentLabel
sql:select incidentla0_.labelID as labelID1_121_, incidentla0_.labelName as labelNam2_121_, incidentla0_.labelStyle as labelSty5_121_, incidentla0_.labelType as labelTyp3_121_ from t_inc_label incidentla0_

from SysParam where paramName = ‘RefreshIncInterval’
sql:select sysparam0_.paramID as paramID1_275_, sysparam0_.displayType as displayT2_275_, sysparam0_.isEncrypted as isEncryp3_275_, sysparam0_.isModifiable as isModifi4_275_, sysparam0_.paramDesc as paramDes5_275_, sysparam0_.paramDisplayName as paramDis6_275_, sysparam0_.paramName as paramNam7_275_, sysparam0_.paramValue as paramVal8_275_, sysparam0_.paramCategoryID as paramCa12_275_, sysparam0_.tips as tips9_275_, sysparam0_.unit as unit10_275_, sysparam0_.verificationType as verific11_275_ from t_sys_param_init sysparam0_ where sysparam0_.paramName=’MissionMaxAcceptTime’ limit ?

from IncidentMonitorSetting
sql:select incidentmo0_.gID as gID1_124_, incidentmo0_.extremeLevelVoice as extremeL2_124_, incidentmo0_.highLevelVoice as highLeve3_124_, incidentmo0_.isShowGrounding as isShowGr4_124_, incidentmo0_.latestIncSet as latestIn5_124_, incidentmo0_.middleLevelVoice as middleLe6_124_, incidentmo0_.normalLevelVoice as normalLe7_124_ from t_inc_monitorSetting incidentmo0_ limit ?

1 收藏


直接登录