I would like you to help us in the analysis of a query that is supposed to consume too much resources. This is not completely clear by the moment, but we are in a starting production phase and quick responses are needed.
The query manages every conditions with indexes, the STLHoldingIbermarc doctype contains 1.200.000 documents, and the expected result average is between 1 to 10 documents. From time to time, out of rule cases, deliver 100 documents.
Although elements used to restrict the query are indexes, the Tamino Analysis says that the postprocessor will be called. There is some special structure around these elements, a (*) sequence containing a required (1) group. You can see it in the attached schema. This is the only complexity I can see in the structure.
The query we perform now is the next:
STLHoldingIbermarc[STLWellKnownForeignKey/STLRelationForeignKey[STLForeignKey=‘B19960101822’ and STLRelationCode=‘STLIbRelBibliografico001’]] sortby(STLFields/STLRecordFields/STLRecordSort asc)
You can see such a double restriction level […[…]].
There is an equivalent query to this without such multiple restriction level, that is:
STLHoldingIbermarc/STLWellKnownForeignKey/STLRelationForeignKey[STLForeignKey=‘B19960101822’ and STLRelationCode=‘STLIbRelBibliografico001’]/…/…/. sortby(STLFields/STLRecordFields/STLRecordSort asc)
Asking for the Tamino analysis, the second query also needs post processing.
Tests without users, delivers instantaneous response, when system is charged, it seems problems arisen. Of course, besides system capacities, my concern is about the query itself.
If some of you have any contribution, what I am interested in, is:
- Is supposed the first query any problem ?
- Is the second one 100% equivalent ? (I think so)
- Any idea of why post processing is required ?
Thanks in advance.
ibermarcstorec.zip (19.9 KB)