Hi, I have the following scheme:
<?xml version = "1.0" encoding = "UTF-8"?>
<xs:schema xmlns:tsd = “http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition” xmlns:xs = “XML Schema”>
xs:annotation
xs:appinfo
<tsd:schemaInfo name = “Docs”>
<tsd:collection name = “test”></tsd:collection>
<tsd:doctype name = “Document”>
tsd:logical
tsd:contentclosed</tsd:content>
</tsd:logical>
</tsd:doctype>
</tsd:schemaInfo>
</xs:appinfo>
</xs:annotation>
<xs:element name = “Document”>
xs:complexType
xs:sequence
<xs:element name = “Total” type = “xs:string”>
xs:annotation
xs:appinfo
tsd:elementInfo
tsd:physical
tsd:native
tsd:index
tsd:standard</tsd:standard>
</tsd:index>
</tsd:native>
</tsd:physical>
</tsd:elementInfo>
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name = “AccessControl” minOccurs = “0” maxOccurs = “unbounded”>
xs:complexType
xs:sequence
<xs:element name = “User” type = “xs:string”></xs:element>
<xs:element name = “Type” type = “xs:string”></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
As you can see, I use standard index for “Total” element and a compound index hosted
in “AccessControl” element.
My queries are:
let $c := (for $b in input()/Document
for $a in $b/AccessControl
where ($a/User=“0”
and
$a/Type=“view”)
return $b)
return count($c)
and
let $c :=(for $b in input()/Document
where ($b/Total=“500”)
return $b)
return count($c)
the response of both queries must be 20000 (and the same documents), but response time are very different:
First query: about 8 seconds (!?!?!?)
Second query: less than 1 seconds (:D)
which is the difference ? both elements are indexed !
and more, if I delete the compound index of the scheme, response time for the first query is the same (8 seconds)
I need to use the first query in my aplication and I will manage much more than 20000 documents.
Thanks
#API-Management#Tamino#webMethods