MSSQL에서 WITH 문을 사용한 쿼리에서 검색 속도가 느려서 개선함. 


declare @ordDateS nvarchar(20)

declare @ordDateE nvarchar(20)

set @ordDateS = #{ordDateS};

set @ordDateE = #{ordDateE};


...

WHERE ORDERT.ORD_DATE BETWEEN @ordDateS+' 00:00:00' AND @ordDateE+' 23:59:59'


변수를 바로 넣지 말고 위에서 선언을 한뒤 쿼리를 돌리면 매우 빨라짐. 


MyBatis에서 DB로 쿼리를 바로 던지지 않고 뭔가를 하나 봄. 

+ Recent posts