Hi Everyone,
I have a query as -
select top 10 bm.name, sum(sd.Amount) as bd
from brandmaster bm join lobattributevalue lob
on bm.brandid = lob.valueid and bm.lobid = lob.lobid
join salesdetail sd
on sd.productid = lob.productid
where lob.attributeid = 3
group by bm.name
order by bd desc
Now In this query I am joining multiple tables which has millions of rows.
This query takes about 40-50sec for execution
Can anyone tell me how can I optimize this query.
Does anyone know about INDEXING, PERFORMANCE ANALYZER and steps to use them in MSSQL 2005