xml column Performance problem -
05-27-2010
, 10:20 AM
Hello,
The following is my XML data
<specification>
<item name="bore" measure="mm">96</item>
<item name="stroke" measure="mm">117</item>
<item name="power" measure="hp">573</item>
</specification>
I have created schema for this and defined xml column using this.
Also I have created the primary and secondary xml index on this column
Thanks,
Bala
I have tried this following query
select Spec.query('//item[@name eq "bore"][@measure eq
"mm"]').value('/','int') bore
from EngineSpecNew
where
Spec.query(N'//item[@name="power"][@measure="hp"]').value('/','int')>100
which takes almost 3 to 4 seconds querying 14000 records and returning almost
6000 records
Am I doing anything wrong with the query?
Or is there any other way of doing it.
Please help me regarding this |