执行计划不一样.dat (16.5 KB)
新老版本执行计划不同的点。后面用 hint 解决的:
explain
SELECT
/*+ LEADING(rs,om,ro) */
count(1) AS refundCount
FROM
TCSceneryMemberOrderAll.RefundSupplier rs
INNER JOIN
TCSceneryMemberOrderAll.OrderMain om
ON
om.SerialID = rs.SerialID
INNER JOIN
TCSceneryMemberOrderAll.RefundOrder ro
ON
ro.RefundSerialId = rs.RefundSerialId
WHERE
1 = 1
AND rs.CreateTime >= '2024-03-01'
AND rs.CreateTime < '2024-04-24'
AND rs.SupplierID = 39407
AND rs.AssignOperatorJobNum = 'V20810'
AND rs.RefundStatus = 0
AND ro.PlatId <> 415
AND ro.ProjectID = 0
AND rs.IsValid = 1
AND om.AgentID = 1993;