Bug #109
closedquery speed slows as database grows
0%
Description
As the database grows in size, the speed at which a query result is returned
becomes greater. The database size to query result time ratio seems to grow at
a large rate. These results were obtained by the experiment described below:
First of all, I wrote a script that adds an xml file to the database
repetitively using the command line INSERT feature of
DocumentImpl.java. I used this script for the following tests. When I
started, the database (under the jones username) had about 15 documents
in it and queries were returned pretty quickly (within 5 seconds or
so). I started by adding several different small xml document (<20
lines, <500 bytes) to the database about 10-15 times each. Query speed
was not noticably effected by adding these documents. It took about 5
seconds or so to add each document. Then I added a larger document (973
lines, 34,000 bytes). I added it about 10 times and it averaged about
30 seconds for the INSERT. After inserting this document query time was
noticable slower. It took about 10 seconds to return any simple query.
Next, I added a bohemith document (~5000 lines, 186,000 bytes). I added
this document only once. It took it 5 min. 20 sec. to insert. After
inserting this document, queries are now slowed to about 15-20
seconds/query. The database now contains 105 documents and xml_nodes
contains 37,449 records. I think we expected these results, and after
loading the 5000 line file, I actually expected it to take much longer
to retrieve a query.
Updated by Chad Berkley about 24 years ago
Changed the queries to reduce the number of subqueries which increased the speed
of the query signifigantly.