2024-05-07 14:57:59.538 ERROR (StatFilter.java:478) - slow sql 200511 millis. WITH temp2 AS ( SELECT * FROM ( SELECT getDateList.singleDay, ROW_NUMBER() OVER (ORDER BY getDateList.singleDay DESC) AS serialNum FROM ( SELECT CONVERT (VARCHAR(100), dateadd(d, -number, ?),23) AS singleDay FROM master..spt_values WHERE type = 'p' ) getDateList WHERE getDateList.singleDay between ? and ? ) temp1 WHERE temp1.serialNum BETWEEN (0+1) AND (0/10+1)*10 ), jfListTemp AS(select * from z_integral_record_201704 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201902 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202001 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202002 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202110 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202205 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202208 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202209 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202307 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202309 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202212 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202006 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201906 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201904 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201903 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201807 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202405 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202403 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202402 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202311 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202308 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202303 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202302 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202301 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202211 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202210 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202207 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202204 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202203 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202201 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202112 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202111 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202109 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202107 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202105 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202102 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202012 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202011 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202010 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202009 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202008 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202007 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201909 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201908 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201907 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201905 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201901 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201812 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201806 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201805 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201804 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201803 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201801 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201712 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201711 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201710 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201709 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201707 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201706 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201705 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201703 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201701 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201611 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201612 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201802 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201808 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201809 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201810 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201811 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201910 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201912 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202003 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202005 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202101 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202103 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202104 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202108 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202305 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202306 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202310 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202312 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202404 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202401 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202304 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202206 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202202 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202106 (NOLOCK) where is_del = 0 union all select * from z_integral_record_202004 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201911 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201708 (NOLOCK) where is_del = 0 union all select * from z_integral_record_201702 (NOLOCK) where is_del = 0 ) SELECT temp.singleDay AS singleDay, ISNULL((select SUM(integral_num) FROM jfListTemp WHERE mode in(1,2,3,6,7) and datediff(day, record_time, temp.singleDay) = 0), 0)+ ISNULL((SELECT SUM(integral_num) FROM questionnaire_integral_record WITH(NOLOCK) WHERE datediff(day, create_time, temp.singleDay) = 0), 0)- ISNULL((select SUM(integral_num) FROM jfListTemp WHERE mode in(4) and web_user_ID like '%±¸°¸%' and datediff(day, record_time, temp.singleDay) = 0), 0) AS GrantCount, ISNULL((select SUM(to_ex_integral) FROM exchange_app WITH(NOLOCK) WHERE datediff(day, commit_time, temp.singleDay) = 0), 0) AS ApplyCount, ISNULL((select SUM(to_ex_integral) FROM exchange_app WITH(NOLOCK) WHERE ex_status = 2 and datediff(day, commit_time, temp.singleDay) = 0), 0) AS ApplySucCount, ISNULL((SELECT SUM( integral_num ) FROM jfListTemp WHERE mode = 10 AND datediff(day, record_time, temp.singleDay) = 0), 0 ) AS CancelCount, ISNULL((SELECT SUM(integral_num) FROM jfListTemp WHERE mode in(1,2,3,6,7) and record_time <= temp.singleDay), 0)+ ISNULL((SELECT SUM(integral_num) FROM questionnaire_integral_record WITH(NOLOCK) WHERE create_time <= temp.singleDay), 0)- ISNULL((SELECT SUM(to_ex_integral) FROM exchange_app WITH(NOLOCK) WHERE ex_status = 2 and commit_time <= temp.singleDay), 0)- ISNULL((SELECT SUM(integral_num) FROM jfListTemp WHERE mode in(4) and web_user_ID like '%±¸°¸%' and record_time <= temp.singleDay), 0)- ISNULL((SELECT SUM( integral_num ) FROM jfListTemp WHERE mode = 10 AND record_time <= temp.singleDay), 0 ) AS SurplusCount from temp2 temp["2024-05-07","2018-09-28","2024-05-07"]