Hello all,
I create a big query which includes mutiple ctes and joins. and it is taking lot of cpu overhead and time. By running this i got to know that.
exec sp_who2 'active
Now My teammate gave me advice to use temptables instead of cte and use indexes on temptables whenever join with other tables. My question are:
1.How can I create indexes on temptables, can I do it using SSMS or query?
2. joining temptable with other table is just the same syntax or differs
#temp a join tablex b on a.id=b.id is this correct or any change needed.
Please let me know If I'm not clear,
Thanks in advance.