我有以下查詢。它是否可以用其他方式編寫以最小化執行時間並優化性能?優化SQL查詢性能
declare @addPrefix as Varchar(10)
set @addPrefix = 'ADD02'
select * from dbo.Products where Products.ProdId='P01' order by
case @addPrefix
when 'ADD01' then 'Address01'
when 'ADD02' then 'Address01'
when 'ADD03' then 'Address03'
when 'ADD04' then 'Address04'
when 'ADD05' then 'Address05'
end, Products.ProdName desc