I have a query below:
select col1,
col2,
.
.
.
coln
from table1
left join table2
on some condition
.
.
left join tablen
on some condition
left join (
select t1.col1,
(
select t2.col2 + ';' as [data()]
from SomeTable t2
where t2.col1 = t1.col1
for xml path('')
) value
from SomeTable t1
group by t1.Col1
)MyTable
on some condition
The above query will return about 4000 rows. The inline select statement using xml path will also result in about 4000 records.
I wish to know if there will be any performance impact with this query due to the use of xml path.
Thanks in advance.
Unless and untill you have proper indexes on the all joining columns in left join and proper covering indexes in select list of columns,there wont be any performance issue here.