IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

create index for queries in format "//"

  • 1.  create index for queries in format "//"

    Posted Tue August 23, 2005 10:12 PM

    query 1: /div[@id=“5”]/note
    with index created on attribute “id”, the processor will use the index

    query 2: //div[@id=“5”]/note
    with multipath indexed created on attribute “id”, the processor will use the index

    query 3: /div[@id=“5”]//note
    query 4: //div[@id=“5”]//note
    no matter what kind of index created on “id”, no index is used.

    how can I create index so that query 3 and 4 can use the index.


    #Tamino
    #webMethods
    #API-Management


  • 2.  RE: create index for queries in format "//"

    Posted Wed August 24, 2005 12:40 PM

    Hi

    again usage of a multiPath standard index (available with Tamino 4.2) is the best answer.

    Best regards
    Uli


    #Tamino
    #API-Management
    #webMethods


  • 3.  RE: create index for queries in format "//"

    Posted Wed August 24, 2005 06:49 PM

    as you can see, I tried to use multipath index on attribute “id”, which case make the second query use the index. I also have been able to create a index on “Div” to make the 4th query to use the index on attribute “id”.

    However, no matter what index I created, the 3rd query just don’t use the index on attribute “id”


    #API-Management
    #webMethods
    #Tamino


  • 4.  RE: create index for queries in format "//"

    Posted Wed August 24, 2005 07:26 PM

    Hi Eric

    sorry - I missed that you are already using the multiPath index.
    Could you pls provide the schema you are using?

    Thanks
    Uli


    #API-Management
    #webMethods
    #Tamino


  • 5.  RE: create index for queries in format "//"

    Posted Wed August 24, 2005 08:06 PM

    here is the schema I used.

    I actually simplify a real schema I used to this one. You can still just define this schema
    against a temp collection. I have created multipath index on “div”, “id”, and even “note”,
    with this schema,
    /div[@id]/note ----- use the index “id”
    //div[@id]/note------ use the index “id”

    //div[@id]//note and /div[@id]//note don’t use the index “id”

    some how, in my real schema, //div[@id]//note works. anyway, how can we
    make the two queries to use the index on “id”

    the scenario I have is : many users will update the documents in a collection at the same time using queries in above format, if Tamino doesn’t use the index, then it will lock the whole
    doctype when a user update a document, preventing others to update different document at the same time.


    #Tamino
    #webMethods
    #API-Management


  • 6.  RE: create index for queries in format "//"

    Posted Wed August 24, 2005 08:17 PM

    Hi

    it looks like there is no attachement - I just try to attach a dummy doc for testing.

    Regards
    Uli
    dummy.txt (11 Bytes)


    #API-Management
    #webMethods
    #Tamino


  • 7.  RE: create index for queries in format "//"

    Posted Wed August 24, 2005 08:21 PM

    so sorry, I forget to attach.
    Notebook_Simple.tsd (2.19 KB)


    #API-Management
    #webMethods
    #Tamino


  • 8.  RE: create index for queries in format "//"

    Posted Thu August 25, 2005 03:42 PM

    Hi

    why do you think that no index is being used?
    If you are using _xql=ino:explain(…,“tree”) you’ll see, that indexes
    are being used for both queries
    //div[@id=“myId”]/note
    and
    //div[@id=“myId”]//note
    if the doctype does already contain documents contributing to the indexes.
    This restriction is related to the special nature of multiPath indexes.

    Best regards
    Uli


    #webMethods
    #Tamino
    #API-Management


  • 9.  RE: create index for queries in format "//"

    Posted Thu August 25, 2005 06:10 PM

    thanks for checking out that for me. However, I did have document in my doctype, and I also used the “explain” button in “inoxplorer” for the xquery I used.

    //div[@id=“ab”]//note

    and

    /div[@id=“ab”]//note

    don’t use index.

    I posted 4 screenshot for you. 1.jpg and 2.jpg are the screen for the two queries not using index. Success.jpg is for the query using the index. And file.jpg is the file I have in under my doctype.

    Thanks a lot.
    screenshot.zip (266 KB)


    #Tamino
    #API-Management
    #webMethods