performance problem

Hi,
We have a collection with 9200 very small and simple documents (data volume in total ~1MB ) like:

+3456-789 Hans Muster

Retrieving all documents with the query “input()/person” via Java-Api takes about 6 seconds (only the query time, without reading the result in java) This is too long, when comparing with e.g. SQL Server, storing the data in a relational table, takes only a few milliseconds. We expect much higher data volume.

We guess this is not normal and we missed something, e.g. some parameter settings or inappropriate query??
Any kind of tuning suggestion is welcome.

In Java, we use TDOMObjectModel and TXQuery objects to perform the query.
We use Tamino 4.1.4.1 (from XML Starter Kit) on Windows XP Professional. The Computer is a Pentium 2,8 Ghz, 2GB RAM

Regards,
Papageno

I wonder if this has something to do with the time it takes to fetch the first document, vs. the time it takes to fetch all the documents.

Does it still take 6 seconds if you execute the query in “Tamino Interactive Interface”?

Thanks for your answer.
With the Tamino Interactive Interface it is not faster.

The measured time in Java includes only the xquery() method of the XMLObjectAccessor, the time for reading the result in Java is not measured.

Reading only one document of the collection is pretty fast, so I would wonder why it should take long to fetch the first document.

Oh, I forgot to say that in Interactive Interface you should specify
Position in result set = 1
Result size = 1

Also, you should try X-Query (/document), as opposed to XQuery, to compare performance.

My guess is that querying all the documents does locking, or something similar, that takes time proportional to the number of documents… Querying with a condition (input/document[@id=123]) is fast, right?

Great, thanks for that hint, that helped a lot :slight_smile:
Like you said, it is fast, when querying with result size = 1. Do you know how to specify this parameters via Java-API?

I think you want TXMLObjectAccessor.query(TQuery query, int quantity)