Forum Stats

  • 3,816,083 Users
  • 2,259,137 Discussions


dateTime index query returning empty set - Berkeley DB XML 6.1.4

User_F8QRJ Member Posts: 1 Green Ribbon

I have schema conforming node documents with the following structure:

<ty:Detections xmlns:ty="" xmlns:xsi="">

stored in Berkeley DB XML 6.1.4 running on Windows 10. I have set up indices for elements that are queried frequently and have a dateTime edge index on the Start element:

Index: edge-element-equality-dateTime for node {}:Start

Is there a specific way that XQueries should be written to take advantage of the index? The following query looks like it is using the index, but returns an empty result set.

declare default element namespace "";
for $det in collection("Detections")/Detections[Effort/Start >= xs:dateTime("2000-01-01T00:00:00Z")]

with query plan

    <ForTuple name="{}det" position="">
          <StepQP axis="parent-of-child" uri="" localname="Detections" nodeType="element">
            <StepQP axis="parent-of-child" uri="" localname="Effort" nodeType="element">
              <ValueQP container="Detections" index="edge-element-equality-dateTime" operation="gte" parent="Effort:" child="Start:" value="2000-01-01T00:00:00Z"/>
      <NodePredicateFilterQP name="{}#tmp21">
        <PresenceQP container="Detections" index="edge-element-equality-dateTime" operation="prefix" parent="Effort:" child="Start:"/>
          <VariableQP name="{}det"/>
          <StepQP axis="parent-of-child" uri="" localname="Effort" nodeType="element">
            <VariableQP name="{}#tmp21"/>

I assume that this is a pilot error, are there any suggestions on how to resolve this? Leaving off the xs:dateTime results in a similar query plan.

Thank you - Marie