Getting Started with Adobe After Effects - Part 6: Motion Blur
Ask
Ask questions, discuss or help others by answering
Related Posts · View All
SQL Server 141
TSQL 75
SSRS 70
SSIS 66
XML 54

Top Categories · View All
SQL Server 141
TSQL 75
SSRS 70
SSIS 66
XML 54

XML Exist will improve the performance

Jun 30 2011 9:21AM by Dinesh Sodani   

I have a process which process the history data. I want to know if I use exists function in the where it will improve any performance..

declare @data xml
set @data  ='<AuditData><Data><Inserted><ins>
    <Endocrine><Endocrine Asymptomatic="0" Lethargy="0" >
      <Diabetic value="1" DietControlled="0" OralMedication="0">
    	<Insulin value="0" />
      </Diabetic>
      <DisposalSharps value="1" />
      <Comments value="" />
    </Endocrine></Endocrine></ins></Inserted></Data></AuditData>'

select pref.query('Endocrine') as value
FROM  @data.nodes('//AuditData/Data/Inserted/ins/Endocrine') AS d(pref)

select pref.query('Endocrine') as value
FROM  @data.nodes('//AuditData/Data/Inserted/ins/Endocrine') AS d(pref)
WHERE @data.exist('(//Endocrine)') = 1

Submitted under:  ·  ·  ·  · 


Dinesh Sodani
30 · 6% · 1807

2 Replies

  • A close look into the execution plan indicates that the second query is estimated to be faster than the first one. However, only a detailed test with a few bigger XML documents can actually tell which one would run faster. Using a schema is expected to help here.

    commented on Jun 30 2011 9:32AM
    Jacob Sebastian
    1 · 100% · 32004
  • Thanks, Jacob

    commented on Aug 21 2012 5:23AM
    Dinesh Sodani
    30 · 6% · 1807

Your Reply


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]