0 Replies Latest reply: Nov 1, 2011 5:58 AM by 896739 RSS

    XQuery select query is not working in proper speed

    896739
      In our project we have large no. data (its a property listing site) and I'm storing that data to Barkeley DB (XML DB). The problem is when I am searching for a property it will list the first 10 property quickly(100% speed). Then I'm going to 2dn, 3rd page its working in the same speed. But if I'm going to 10th(30% speed) or 100th or 1500th(15%speed) page is working very slowly.

      Following are my query:

      let $property_ids:=
      (
      for $property in collection('bdb/properties.dbxml')/properties/property

      order by $property/sale_price/number() descending
      return $property/@property_id,

      for $property in collection('bdb/properties.dbxml')/properties/property

      order by $property/sale_price/number() descending
      return $property/@property_id,

      for $property in collection('bdb/properties.dbxml')/properties/property

      order by $property/sale_price/number() descending
      return $property/@property_id
      )
      return <properties>{
      for $id in subsequence($property_ids, 1, 10) return
      collection('bdb/properties.dbxml')/properties/property@property_id = $id
      }</properties>

      And some times query will change like the following way based on the filter option in my page(means sort by only sale_price field):

      let $property_ids:=
      (
      for $property in collection('bdb/properties.dbxml')/properties/property
      order by $property/sale_price/number() descending
      return $property/@property_id
      )
      return <properties>{
      for $id in subsequence($property_ids, 1, 10) return
      collection('bdb/properties.dbxml')/properties/property@property_id = $id
      }</properties>


      then from the first page its self its performance is very slow(15%).

      Could you please check my query and help me to solve the issue...

      Thank you,
      Vijesh