XQuery Performance in BerkeleyDB More options

We are migrating from IPedo to Berkeley DB.
IPedo did not support multiple indices in their Xqueries, so we had to
concatenate some fields in to one field and index that field, the
Xqueries were really fast.
Unfortunately the same XQuery does not perform well in BerkeleyDB.
This is how we create the index for this filed (ContentKey) in
BerkeleyDB
addIndex '' 'ContentKey' edge-element-equality-string
and this is how I query using Java API.
queryContext.setEvaluationType(XmlQueryContext.Eager);
queryContext.setVariableValue("ContentKey", new XmlValue(
"a0a0188000001115348efcc00000003XXXXXXXXXXXXXYYYYYYYYYYYYYY"));
// Declare the query string
String myQuery = "collection('db/title')/Record[ContentKey=
$ContentKey]";
// Prepare (compile) the query
XmlQueryExpression xmlQueryExpression =
dbManager.prepare(myQuery,queryContext);
1. What is wrong with the index or the way I am using the Java API ?
Changing the evaluation type to Lazy did not help at all.
2. The Query performs OK in dbxml.
3. Are there any other commercial/open source tools to evaluate the
performance of a Xquery in BerkeleyDB? Stylus Studio does not support
BDB - 2.3.10 yet.
Any help would be appreciated.
Thanks,
Suresh

Hi,
I'm sorry, you're in the wrong forum. Please post to the Berkeley DB XML forum:
Berkeley DB XML
Thanks,
Mark

Similar Messages

  • XQuery Performance in BerkeleyDB

    We are migrating from IPedo to Berkeley DB.
    IPedo did not support multiple indices in their Xqueries, so we had to
    concatenate some fields in to one field and index that field, the
    Xqueries were really fast.
    Unfortunately the same XQuery does not perform well in BerkeleyDB.
    This is how we create the index for this filed (ContentKey) in
    BerkeleyDB
    addIndex '' 'ContentKey' edge-element-equality-string
    and this is how I query using Java API.
    queryContext.setEvaluationType(XmlQueryContext.Eager);
    queryContext.setVariableValue("ContentKey", new XmlValue(
    "a0a0188000001115348efcc00000003XXXXXXXXXXXXXYYYYYYYYYYYYYY"));
    // Declare the query string
    String myQuery = "collection('db/title')/Record[ContentKey=
    $ContentKey]";
    // Prepare (compile) the query
    XmlQueryExpression xmlQueryExpression =
    dbManager.prepare(myQuery,queryContext);
    1. What is wrong with the index or the way I am using the Java API ?
    Changing the evaluation type to Lazy did not help at all.
    2. The Query performs OK in dbxml.
    3. Are there any other commercial/open source tools to evaluate the
    performance of a Xquery in BerkeleyDB? Stylus Studio does not support
    BDB - 2.3.10 yet.
    Any help would be appreciated.
    Thanks,
    Suresh

    Hi John:
    Thanks for your mail.
    I did declare variable as xs:string external, it did not work. I heard from other engineers in the group that since 2.3.8, “external” variables in BerkeleyDB stopped working. We are using 2.3.10.
    I also noticed that the query plan when we using external variables is not valid XML (<GlobalVar name="var external="true">). I hope this is just a toString() issue and nothing major.
    I have attached the query plans; I do not see anything different between the two. I would really appreciate your help on this.
    Thanks,
    Suresh
    Here are the query plans:
    Query that executes in 2 ms (which has the hard coded value):
    Query:
    String myQuery = "declare namespace tf = \"http://aplaud.com/ns/0.1/tts/format\";" +
    "count (collection('db/title')/Record[ContentKey=\"a0a0188000001115348efcc00000003http://daxweb.org/ns/1.0/taxonomy/Product Type/Gift Receipt\"]/tf:TitleDocument/tf:Title/Content/Detail/GiftInfo/Gift)";
    Query Plan:
    <XQuery>
    <Function name="{http://www.w3.org/2005/xpath-functions}:count">
    <DocumentOrder>
    <DbXmlNav>
    <LookupIndex container="db/title">
    <ValueQP index="edge-element-equality-string" operation="eq" parent="Record" child="ContentKey" value="a0a0188000001115348efcc00000003http://daxweb.org/ns/1.0/taxonomy/Product Type/Gift Receipt"/>
    </LookupIndex>
    <Join type="parent-of-child" return="argument">
    <DbXmlNav>
    <QueryPlanFunction result="collection" container="db/title">
    <OQPlan>V(edge-element-equality-string,Record.ContentKey,=,'a0a0188000001115348efcc00000003http://daxweb.org/ns/1.0/taxonomy/Product Type/Gift Receipt')</OQPlan>
    </QueryPlanFunction>
    <DbXmlStep axis="child" name="Record" nodeType="element"/>
    </DbXmlNav>
    </Join>
    <DbXmlStep axis="child" prefix="tf" uri="http://aplaud.com/ns/0.1/tts/format" name="TitleDocument" nodeType="element"/>
    <DbXmlStep axis="child" prefix="tf" uri="http://aplaud.com/ns/0.1/tts/format" name="Title" nodeType="element"/>
    <DbXmlStep axis="child" name="Content" nodeType="element"/>
    <DbXmlStep axis="child" name="Detail" nodeType="element"/>
    <DbXmlStep axis="child" name="GiftInfo" nodeType="element"/>
    <DbXmlStep axis="child" name="Gift" nodeType="element"/>
    </DbXmlNav>
    </DocumentOrder>
    </Function>
    </XQuery>
    Query that executes takes 4 seconds (which has the declared var as xs:string external):
    Query:
    String myQuery = "declare namespace tf = \"http://aplaud.com/ns/0.1/tts/format\"; declare variable $var as xs:string external;" + "count (collection('db/title')/Record[ContentKey=$var]/tf:TitleDocument/tf:Title/Content/Detail/GiftInfo/Gift)";
    Query Plan:
    <XQuery>
    <GlobalVar name="var external="true">
    <SequenceType occurrence="exactly_one" testType="atomic-type" type="http://www.w3.org/2001/XMLSchema:string"/>
    </GlobalVar>
    <Function name="{http://www.w3.org/2005/xpath-functions}:count">
    <DocumentOrder>
    <DbXmlNav>
    <LookupIndex container="db/title">
    <ValueQP index="edge-element-equality-string" operation="eq" parent="Record" child="ContentKey">
    <Variable name="var"/>
    </ValueQP>
    </LookupIndex>
    <Join type="parent-of-child" return="argument">
    <DbXmlNav>
    <QueryPlanFunction result="collection" container="db/title">
    <OQPlan>P(edge-element-equality-string,prefix,Record.ContentKey)</OQPlan>
    </QueryPlanFunction>
    <DbXmlStep axis="child" name="Record" nodeType="element"/>
    </DbXmlNav>
    </Join>
    <DbXmlStep axis="child" prefix="tf" uri="http://aplaud.com/ns/0.1/tts/format" name="TitleDocument" nodeType="element"/>
    <DbXmlStep axis="child" prefix="tf" uri="http://aplaud.com/ns/0.1/tts/format" name="Title" nodeType="element"/>
    <DbXmlStep axis="child" name="Content" nodeType="element"/>
    <DbXmlStep axis="child" name="Detail" nodeType="element"/>
    <DbXmlStep axis="child" name="GiftInfo" nodeType="element"/>
    <DbXmlStep axis="child" name="Gift" nodeType="element"/>
    </DbXmlNav>
    </DocumentOrder>
    </Function>
    </XQuery>

  • HT201304 I want to buy new level from candy crush, but unfortunately apple required to accept terms and condition first before I can buy. But once I click yes no more option to click I agree with the condition. what should I do?

    I want to buy new level from candy crush, but unfortunately apple required to accept terms and condition first before I can buy. But once I click yes no more option to click I agree with the condition. what should I do?

    Perform a Reset... Try again...
    Reset  ( No Data will be Lost )
    Press and hold the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears. Release the Buttons.
    http://support.apple.com/kb/ht1430

  • Adding more options onrollOver of the DataGird Row

    Hi All,
    I have Saved Reports DataGrid (which the Data comes from
    external XML
    file) for which, I want to add more Options (Like open,
    Delete,
    Rename) on rollover of the particular Row. as we have in AOL
    Email.
    Please let me known how to get this done for the Flex
    DataGrid, if
    possible with Example code
    Thanks in Advance
    PSamanth

    Camelot summarized it perfectly..
    What it ultimately comes down to (as always!) is how much money you have.
    Cheapest is to buy Firewire drives and hook them in. Problem is, if the drive dies so does your data.
    Most expensive and fastest is indeed Fiber channel stuff. But its expensive. A 6TB G-Tech FC RAID unit will cost you at least £3000 if you can get a good deal. And you have to have a FC card as well..
    In between, and with the advantage that you can use the onboard kit, have a look at the Drobopro gear... for £900 ish you can get an empty unit and populate it with whatever drives you want. Expandable, has redundancy built in and simple to use. Has dual interfaces (FW and iSCSI). Performance wise, im not 100% sure as I dont have one myself, but reviews have been pretty positive so far.
    The G-Tech FC RAID boxes are very fast and very nice pieces of kit. I have several of them on various macs dotted around, and theyre used for editing HD video. They handle it without breaking a sweat. G-Tech also keep upping the capacity, so the 6TB ones may not be the current versions...
    Hope this helps!

  • Vendor EDI invoice // More options in OBCD

    Hi,
    SAP standard OBCD or table T07M does not have much option and new fields can also not be added for more options in determination of tax code from different ship-from-country .
    Like to know the possible ways to do it.
    With regards,
    Mrinal

    Hi ,
    I meant table T076M.
    Regards,
    Mrinal

  • Where is the "search more" option in Gmail?

    Currently using: Lumia 920 white - Windows Phone 8
    I had a Lumia 800 before and when opening my email and searching for something, if it did not come up I could use the "search more" option and It would search in all my email. (not synced)
    It looks like this option is not available any more in WP8.
    However I can still use "search more" for hotmail or outlook but not for Gmail.
    Anyone else experiencing this same problem?
    How are you supposed to search through not-synced emails in gmail?
    Thanks,

    Found the answer here:
    http://www.wpcentral.com/quick-tip-gmail-settings-windows-phone-8

  • A window has popped up saying, "Want more options? Right-click the app" how do I get rid of this. It won't let me exit it. Is it a virus?

    A window is popping up everytime I open firefox. It says "Want more options? Right click the app" It will not let me close it and won't let me continue on firefox until I give it an answer

    You can start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Need more options for display

    Is it possible to add more option like "default date format mask" for results that are output in the grid?
    I am using this product since this AM and I already love it.
    ps: Will this be the right forum to request nwe enhancements?
    Raj

    we have logged this as an enhancement request. This is a great place for enhancement requests; one person sugested using a single thread for enhancement requests, and created a thread called enhancement requests; but we will take good ideas any way we can.
    Mike

  • More Options in QOS please?

    Is there any way to re-configure the flash bios to allow more options in in QOS for more computers of the Linksys WRT54GL? I have two areas where I can add a computer and select weather it should have lowest-highest priorities, but two computers are not enough. I would like an extended ability to add more computers to this list, can anyone tell me if there is a bios out there with this abilitiy? I would be willing to look into third party bios as well if they are the only ones which support this. I like Linksys and their products, however, I believe they should have added extended features to the bios in this case. I understand the WRT54GL code is under GPL and that I could be able to edit it myself had I known programming, alas I do not and I could very easily brick my router.. and that would not be fun

    I think only 3-4 computer can be added under QoS on the router ....
    Even you upgrade the firmware of the router ... still the basic features remains the same .....

  • BAM 11g - creating new report - More options not active

    I am creating new reports in BAM 11g. 11.1.1.3.0 Build 8553
    I can select the Data Object and Data Fields, but.... When I select any of the More options.... such as Create a filter or Create a calculated fied etc... I get the View Prompts screen and I cannot get out of it.
    The Properties object works, but as soon as I go back to the Data Objects - I am on the View prompts screen with several unlabelled tabs... and I can only OK, Cancel or Save.
    If I re-edit the reprt - I go straight to this View Prompts Screen... and can do nothing on the data objects.
    Rebooting makes no difference....
    Has anyone else seen this.
    I am using JDK 1.6.0_14... which i picked up from a post in the forum.... but this has made no difference.
    Thanks
    Cliff

    There must have been a typo or something when I reset the Java version.... re applying the copy of JDK 1.6.0_14 and restarting, Fixed the problem.

  • How to add new item in more options dialog box

    Hi all,
    Can anyone tell me how to add new item in more options dialog box(site actions -> more options). I want to add new item there to the new page layout which I created but I didn't find any way to do it. can anyone assist me for this.

    Good point, in order to add a Page into that area, you will need to define a Custom Action. You can learn more about creating Custom Actions here:
    http://msdn.microsoft.com/en-us/library/hh500259(v=office.14).aspx
    As an example, Microsoft uses the following Custom Action to add the "Publishing Page" to that Create Silverlight control when enabling the Publishing features:
    <CustomAction
    Id="CreatePublishingPage"
    GroupId="WebPages"
    Location="Microsoft.SharePoint.Create"
    Sequence="100"
    Title="$Resources:cmscore,Create_WebPages_PublishedPage;"
    Description="$Resources:cmscore,Create_WebPages_PublishedPage_Description;"
    ImageUrl="/_layouts/images/ltpp.png">
    <UrlAction Url="_Layouts/CreatePage.aspx" />
    </CustomAction>
    Dimitri Ayrapetov (MCSE: SharePoint)

  • OWA More Option redirects to my OWA page

    I have a strange situation, 
    When i log into the OWA page "https://exchangeserver.domain/owa" I get a login page (using incognito mode) I enter as [email protected] and it successfully logs me into the administrators OWA but then when I click the more Options selection
    the page redirects to my OWA inbox from the administrator. I have tried removing all the network credentials in credential manager, but it still does the same, then removed all cookies and temp files from IE (deleted files) removed all browser history in chrome,
    and saved passwords also reset Chrome. Somehow it's getting my username and password to authenticate to the ECP page.
    I think it might be from editing the host file in C:\windows]System32\Drivers\Etc "hosts" because for a while it would ask for credentials again when clicking "more options" after log in from the administrator OWA. Now it just redirects
    straight into my OWA. Could it be from the host file? 
    I have removed all the entries from the host file. And it's back to how it was before editing.

    I can only think that the IIS authentication settings for the ECP virtual directory are different to those for the OWA virtual directory. They should be the same. I'd suggest recreating the ECP vdir using powershell.
    I can't think of anything in the hosts file that would affect it, since the server names used for OWA and ECP are supposed to be the same. But you never know...
    OWA For SmartPhone

  • Protocol for turning off conversation threads in hotmail cant be followed 'cos tools options doesn't display "more options" help!

    Don't want new conversation threading in hotmail. Suggested protocol for switching off says; Tools> options>more options etc. Well my tools
    button does not provide the facility "more options"! Help.

    If you want access to the console, try booting with a modified kernel command line. Add systemd.unit=multi-user.target, then you can modify your configuration, try startx, ...

  • "See more" Option on Yosemite's Mail

    Hi guys,
    I have a problem to display the Email's chain in Yosimite's Mail.
    When I click on " see more" option what I got is a blank page.
    Do you know if this is a defect of Yosemite' mail application?
    PS: A friend of my have the same problem and it's mac it's a new one.
    Best regards.
    MacBook Pro (15-inch, Late 2008)
    2,66 GHz Intel Core 2 Duo

    It very simple...
    When you received more then one email from the same user when you open the last email received if you want to see to see the whole conversation/email there is an option as I wrote in my previous thread "see more from..." if you click on it usually apear the content of the email but in my case I got an blank page and I cannot display any email. If then I way to see correctly the other email lI have to close "MAIL" and reopen it.
    Hope I've been more clear now,
    Cheers

  • How to add extra options for style of images.   iPad version has far more options than Mac version

    How to add extra options for style of images in pages.   iPad version has far more options than Mac version

    Thank you, you made me go look again and I realised the ones I use on the iPad are under Borders not style and they are on Mac also.  I feel a bit silly but I wouldn't have got there without your prompting.  Do you mean by "create your own"  using the borders and then saving as a style or can you create something that is not in either?
    Thanks again

Maybe you are looking for