<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    <span style="font-size: 11pt; font-family:
      &quot;Calibri&quot;,&quot;sans-serif&quot;; color: rgb(31, 73,
      125);"><o:p></o:p></span>
    <blockquote cite="mid:002801cbd871$c391d6d0$4ab58470$@calldei.com"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><span style="font-size: 11pt; font-family:
            &quot;Calibri&quot;,&quot;sans-serif&quot;; color: rgb(31,
            73, 125);"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 11pt; font-family:
            &quot;Calibri&quot;,&quot;sans-serif&quot;; color: rgb(31,
            73, 125);">Performance wise I tested my code (XQuery 1) vs
            XSLT 2 code doing the same thing (using for-each-group)
            using Saxon 9.3 HE<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 11pt; font-family:
            &quot;Calibri&quot;,&quot;sans-serif&quot;; color: rgb(31,
            73, 125);">This was using a 200MB XML file with about 17,000
            ungrouped elements and 4,000 grouped elements.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 11pt; font-family:
            &quot;Calibri&quot;,&quot;sans-serif&quot;; color: rgb(31,
            73, 125);"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 11pt; font-family:
            &quot;Calibri&quot;,&quot;sans-serif&quot;; color: rgb(31,
            73, 125);">XSLT2 took about 6 seconds<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 11pt; font-family:
            &quot;Calibri&quot;,&quot;sans-serif&quot;; color: rgb(31,
            73, 125);">XQuery took about 4 minutes.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 11pt; font-family:
            &quot;Calibri&quot;,&quot;sans-serif&quot;; color: rgb(31,
            73, 125);"><o:p>&nbsp;</o:p></span><br>
        </p>
      </div>
    </blockquote>
    <br>
    Saxon-EE's join optimizer should handle this query quite well, and
    produce the result in a time that isn't too far off the XSLT figure.
    This is the kind of query where a more powerful optimizer can make a
    big difference, especially with large input files.<br>
    <br>
    End of sales pitch.<br>
    <br>
    Michael Kay<br>
    Saxonica<br>
  </body>
</html>