[步骤]
系统读写延迟,调查发现读库有这个语句非常慢,请调整处理。
select t1.ID, t1.CustomerID, t1.OrderCode, t1.P_S_Code, t1.ProductType, t1.SKU, t1.ParameterIDs, t1.OptionsIDs, t1.ParameterValues, t1.Standard, t1.ProductNum, t1.ProductNumUpdate, t1.PurchaseNum, t1.PurchaseType, t1.ProblemType, t1.ProductPrice, t1.ShippingPrice, t1.BuyPrice, t1.ActivityID, t1.ActivityName, t1.ActivityMinusPrice, t1.ClientSKU, t1.OrderItemId, t1.ASIN, t1.SellerSKU, t1.ItemTitle, t1.ItemTitleCn, t1.ItemMemo, t1.MemberID, t1.CookieValue, t1.IP, t1.AddTime, t1.GroupSKU, t1.GroupProductNum, t1.GroupProductPrice, t1.P_Code_Build, t1.P_Code_Time, t1.OldOrderListID, t1.LockNum, t1.LockTime, t1.SharePrice, t1.ItemListingType, t1.CommentType, t1.CheckAdminID, t1.CheckAdminName, t1.AssignDevelopAdminID, t1.AssignDevelopAdminName, t1.BuyerID, t1.BuyerName, t1.EditAdminID, t1.EditAdminName, t1.ImageAdminID, t1.ImageAdminName, t1.BusinessAdminID, t1.BusinessAdminName, t1.SellerType, t1.IsFBA, t1.ItemSite, t1.RefundPrincipalAmount, t1.RefundShippingAmount, t1.PromotionDiscount, t1.PromotionId, t1.AmazonDeliveryStatus, t1.AmazonCompeteRemark, t1.BusinessTeamID, t1.BusinessTeamName, t1.DevelopAdminID, t1.DevelopAdminName, t1.Marks, t1.GroupShippingPrice, t1.GroupProductNumUpdate, t1.LockGroupProductNum, t1.IsBiSycnComplete, t1.BiSycnCompleteTime, CASE WHEN t1.UpdateTime IS NULL THEN t1.AddTime ELSE t1.UpdateTime END "UpdateTime", t1.ExtendedInfo FROM dbo.RB_OrderList(NOLOCK) t1 inner join dbo.RB_OrderInfo(NOLOCK) t2 on t1.CustomerID = t2.CustomerID and t1.OrderCode = t2.OrderCode WHERE t2.IsStockOrder = 0 and t2.IsPay = 1 and (t1.UpdateTime >='2020-12-31 23:59:59' or t1.AddTime >='2020-12-31 23:59:59')
[结果]
[期望]