[bdbxml] DB XML Performance?

"Antony Grinyer" <antony.grinyer-TjPRh57ScDpaa/[email protected]> Tue, 27 Sep 2005 10:31:05 +0100
Newsgroups gmane.comp.db.dbxml.general
Message-ID <989E1989F3130042879B902D175842163F038C@msxmigration.cswgroup.local>
We've been stress testing our DB XML application which uses one
container holding 10,000 small XML files. Our Java code has a simple
query method for which we pass an XQuery expression, which then uses the
DB XML Java API to query our container.=20

Our simple XML document format is shown:

<AMP>
  <APID>59111000001100</APID>
  <VPID>318052005</VPID>
  <NM>Amiloride 5mg tablets</NM>
  <DESC>Amiloride 5mg tablets (The Boots Company)</DESC>
  <SUPPCD>7497111000001106</SUPPCD>
  <LIC_AUTHCD>0001</LIC_AUTHCD>
  <AVAIL_RESTRICTCD>0001</AVAIL_RESTRICTCD>
</AMP>

We have added these 7 indexes:

1. addIndex "" AMP node-element-presence-none
2. addIndex "" AMP/APID edge-element-presence-none=20
3. addIndex "" AMP/SUPPCD edge-element-presence-none=20
4. addIndex "" APID node-element-equality-decimal
5. addIndex "" SUPPCD node-element-equality-decimal
6 addIndex "" NM node-element-substring-string
7. addIndex "" DESC node-element-substring-string

We're concerned at the performance of the queries despite having indexed
(we think) all the relevant XML components we query against. We have run
timing benchmarks against various query scenarios using the following
xquery:

collection("Sample.bdbxml")//AMP[SUPPCD=3D"3144701000001104"]

...and here are the results:

Test1: Single query run five times (waiting for previous to finish): 18,
5.6, 15, 26,
33 seconds. i.e. The results for the same query run on its own can take
anything from 5 through to 33 seconds! Why such a difference?=20

Test2: 5 concurrent queries: 67, 79.9, 79.8, 90, 87 seconds. i.e.
Running 5 queries together slows all queries down considerably.

Test3: 10 concurrent queries: 72, 74, 79, 102, 115, 119, 130, 140.3,
140.1, 140.2 seconds. Slower still.

Test4: 20 concurrent queries: No results -
com.sleepycat.bdbxml.XmlException: Uncaught exception from C++ API:
Unknown error, errcode =3D INTERNAL_ERROR - for all threads except one
which said: Error: BaseMemoryManager::allocate(): Out of memory, errcode
=3D XPATH_EVALUATION_ERROR

Despite having such a simple setup, we're confused why the queries are
taking so long and why the query timing results are so different running
the same query multiple times in test 1.

Can anyone help or offer advice on why this might be happening? Is there
any way to determine the optimal indexes or something similar to
optimize query performance?

Thanks a lot!
Ant




------------------------------------------
To remove yourself from this list, send an
email to [email protected]