XSLT performance question regarding XPATH V2 key() feature

Discussion in 'XML' started by David Blickstein, Sep 14, 2005.

  1. In my XML Schema I'm dealing with, I can assume that key(x,y) and key(x,y,z)
    always returns the same result set. That is, y is unique in key x
    throughout the entire
    document.

    Does anyone know offhand if the performance of one form is likely to be
    better than the other?

    I would intuit that the 3-parameter form of key might actually be LESS
    efficient in that the constraint can't be used in the key lookup but is an
    additional filtering process that has to be done.

    Unfortunately, I can't use IDs because I can't be guaranteed its declared in
    a DTD.
    David Blickstein, Sep 14, 2005
    #1
    1. Advertising

  2. Do not expect any (noticeable) difference between the two overloads of the
    key() function.

    The two-argument one is simply a shorthand for:

    key(<kName>, <kExpr>, .)

    How and when the index corresponding to an xsl:key and used by a key()
    function application -- this is implementation dependent, however most
    implementations build an index "on-demand" -- the first time it is needed
    for a particular document by a key() function.

    Therefore, both overloads will not differ in this respect.


    Cheers,
    Dimitre Novatchev

    "David Blickstein" <> wrote in message
    news:43283fa0$...
    > In my XML Schema I'm dealing with, I can assume that key(x,y) and
    > key(x,y,z)
    > always returns the same result set. That is, y is unique in key x
    > throughout the entire
    > document.
    >
    > Does anyone know offhand if the performance of one form is likely to be
    > better than the other?
    >
    > I would intuit that the 3-parameter form of key might actually be LESS
    > efficient in that the constraint can't be used in the key lookup but is an
    > additional filtering process that has to be done.
    >
    > Unfortunately, I can't use IDs because I can't be guaranteed its declared
    > in
    > a DTD.
    >
    >
    >
    Dimitre Novatchev, Sep 14, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Schroeder

    xslt / xpath question

    Brian Schroeder, Aug 4, 2004, in forum: XML
    Replies:
    3
    Views:
    340
    Ben Edgington
    Aug 5, 2004
  2. Replies:
    3
    Views:
    20,960
    Martin Honnen
    Oct 4, 2005
  3. shyam
    Replies:
    8
    Views:
    427
    Priscilla Walmsley
    Jun 21, 2006
  4. M P
    Replies:
    1
    Views:
    456
  5. Dan Kohn
    Replies:
    2
    Views:
    180
    Gavin Kistner
    Sep 15, 2005
Loading...

Share This Page