1.(@CustomerID int)SELECT DISTINCT a.ID AS FeeID, a.Currency, a.AreaID, b.AreaName, b.AreaType, Isnull(c.SupplierCode, c.SupplierName) AS SupplierCode, d.TransportName, d.TransferAttribute, e.CustomerID, e.RegisteredFee, e.HandleFee, e.Discount, Isnull(ac.CountryID, 0) CountryID, ac.ProvincesCN, e.TransportDaysFrom, e.TransportDaysTo, e.Memo, a.ShipFeeType, d.ID TransportID, Isnull(c.IsActive, 0) AS IsActiveWithTransportSupplier FROM RB_Transport_Fee a WITH ( NOLOCK ) INNER JOIN RB_Area AS b(nolock) ON a.AreaID = b.ID LEFT JOIN RB_Area_Country ac(NOLOCK) ON a.AreaID = ac.AreaID AND a.CustomerID = ac.CustomerID LEFT JOIN RB_Transport_Supplier AS c(nolock) ON a.SupplierID = c.ID LEFT JOIN RB_Transport AS d(nolock) ON a.TransportID = d.ID AND a.SupplierID = d.DefaultSupplierID LEFT JOIN RB_Transport_SupplierTransport AS e(nolock) ON a.SupplierID = e.TransprotSupplierID AND a.TransportID = e.TransportID WHERE a.CustomerID = @CustomerID ORDER BY FeeID DESC
建议加入缓存,减少当前表的相关请求
2. SELECT a.* FROM RB_OrderSource a WITH(NOLOCK) INNER JOIN RB_OrderSource_EbayAmazonAPI b WITH(NOLOCK) ON a.CustomerID=b.CustomerID AND a.ID=b.OrderSourceID WHERE a.IsActive=1 AND b.IsActive=1 AND a.OrderSourceType=57
建议更具不同的 类型 a.OrderSourceType=57 创建多个缓存
1、从代码来看,这个是唐飞飞组的,而且从代码来看,已经做了缓存处理。