merge into using插入数据效率较慢,有啥好的优化方法吗?
代码如下:
MERGE INTO HHB_UO_INFO_TEMP T1
USING(
select
#{item.opId,jdbcType=VARCHAR} opId,
#{item.opName,jdbcType=VARCHAR} opName,
#{item.phone,jdbcType=VARCHAR} phone,
#{item.createDate,jdbcType=DATE} createDate,
#{item.opStatus,jdbcType=VARCHAR} opStatus,
#{item.validDate,jdbcType=DATE} validDate,
#{item.expireDate,jdbcType=DATE} expireDate,
#{item.cityId,jdbcType=VARCHAR} cityId,
#{item.countyId,jdbcType=VARCHAR} countyId,
#{item.orgId,jdbcType=VARCHAR} orgId,
#{item.regType,jdbcType=VARCHAR} regType,
#{item.regNbr,jdbcType=VARCHAR} regNbr,
#{item.address,jdbcType=VARCHAR} address,
#{item.postCode,jdbcType=VARCHAR} postCode,
#{item.lockStatus,jdbcType=VARCHAR} lockStatus,
#{item.sdyy,jdbcType=VARCHAR} sdyy,
#{item.sdDate,jdbcType=DATE} sdDate,
#{item.orgType,jdbcType=VARCHAR} orgType,
#{item.validStatus,jdbcType=VARCHAR} validStatus,
#{item.opType,jdbcType=VARCHAR} opType
from DUAL
)T2
ON (1 = 0)
WHEN NOT MATCHED THEN INSERT
(USER_NAME,USER_MOBILE,OP_ID,CREATE_DATE,OP_STATUS,VALID_DATE,EXPIRE_DATE,CITY_ID,COUNY_ID,ORG_ID,REG_TYPE
,REG_NBR,ADDRESS,POST_CODE,LOCK_STATUS,LOCK_REASON,LOCK_DATE,ORG_TYPE,VALID_STATUS,OP_TYPE)
VALUES
(T2.opName,T2.phone,T2.opId,T2.createDate,T2.opStatus,T2.validDate,T2.expireDate,T2.cityId,T2.countyId,T2.orgId,T2.regType,T2.regNbr,T2.address,T2.postCode,T2.lockStatus,T2.sdyy,T2.sdDate,T2.orgType,T2.validStatus,T2.opType)