Select t9.Product_ID,a.Product_Name,a.Product_BuyNum, b.Org_Price, b.Sale_Price, c.Img_Small, c.Img_Middle,
isnull((select SubShop_Price from subshop_product where subshop_id=1057 and product_id=a.product_id),b.Sug_Price) as SubShop_Price, b.Sug_Price,a.Product_SeeNum,a.AddTime,
a.orderid From
(
Select Top 30 product_id from
(
Select row_number() over(order by a.product_id desc) as rownumber,a.product_id
From Product_Info a
Inner Join Product_Price b On a.Product_ID = b.Product_ID
Inner Join SubShop_ProductRight d ON a.Class_ID = d.Class_ID AND d.SubShop_ID=1057
Where ((a.SubShop_ID is null or a.SubShop_ID=-1) or ((a.SubShop_ID=1057 or a.Is_AllShow=0 ) and Is_Audit=0))
and a.IsHidden = 0 And a.IsDelete = 0
And a.Product_Name Like '%%' and a.Product_ID
not in (select product_id from SubShop_Product where IsHidden=1 and SubShop_ID=1057)
) t
where rownumber>4170 Order By rownumber
) as t9
inner join Product_Info a on a.Product_ID=t9.Product_ID
Inner Join Product_Price b On a.Product_ID = b.Product_ID left Join Product_Detail c On a.Product_ID = c.Product_ID
rownumber>4170 這個數值會根據不同頁數變化,求解怎麼優化,這個占用CPU很高,導致系統速度慢
你那個算法太多了,能不能精簡一下