Ivan Shcheklein <shchekl...@...> writes:

> 
> 
> Hi Alexander,Can you send us full queries?Ivan Shcheklein,Sedna Team
> On Tue, Nov 10, 2009 at 6:22 PM, Alexander Kabanov <alexander.kabanov-
Q1//[email protected]> wrote:I have a query (that works) returning a 
sequence of nodes. I need to wrap
> those up in a top-level node (to use xsltproc on them). The query itself
> is very fast - almost immediate on my machine. However, when I try to wrap 
this
> query up in an element constructor, it becomes very slow - it can take up to 
40
> minutes. So to be more specific, let's say a I have a working FLWOR query. 
Then
> FLWOR-query-text
> executes very quickly, but
> <Top>{ FLWOR-query-text }</Top> takes ages.
> This also happens if I put the query inside a function
> declare local:query_function(...) as element()*
> the call
> local:query_function(...)
> is fast
> but
> <Top>{ local:query_function(...)  }</Top>
> is really slow. What am I doing wrong?
> -----------------------------------------------------------------------------
-
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Sedna-discussion mailing listSedna-discussion <at> 
lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/sedna-
discussion
> 
> 
> 
> 
> 
> -----------------------------------------------------------------------------
-
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
> trial. Simplify your report design, integration and deployment - and focus on 
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> 
> _______________________________________________
> Sedna-discussion mailing list
> sedna-discuss...@...
> https://lists.sourceforge.net/lists/listinfo/sedna-discussion
> 

Here is the original query text

for $m in doc("SimulationDB")/SimulationData/Simulation[id=44]//Market
   let $rt := $m/registration_timer
   return<CrossSection>
   {
      for $r in $m//Order
         return <LimitOrder>
         { $rt }
         { $r/id }
         { $r/order_time }
         { $r/price }
         { $r/quantity }
         { $r/is_bid}
         </LimitOrder>
   }</CrossSection>

This works fine and executes quickly.

When I try do place the above inside an element constructor, i.e.

<Top>
{
for $m in doc("SimulationDB")/SimulationData/Simulation[id=44]//Market
   let $rt := $m/registration_timer
   return<CrossSection>
   {
      for $r in $m//Order
         return <LimitOrder>
         { $rt }
         { $r/id }
         { $r/order_time }
         { $r/price }
         { $r/quantity }
         { $r/is_bid}
         </LimitOrder>
   }</CrossSection>
}
</Top>

it still works but it's very slow. 

Here is a sample <Market> element

<Market>
 <init_price>100</init_price>
 <Offers>
  <depth>0</depth>
  <Order>
   <id>1</id>
   <price>100.21000000000001</price>
   <quantity>55</quantity>
   <is_bid>0</is_bid>
   <is_market>0</is_market>
   <order_time>1</order_time>
  </Order>
  <depth>1</depth>
  <Order>
   <id>2</id>
   <price>100.49000000000001</price>
   <quantity>175</quantity>
   <is_bid>0</is_bid>
   <is_market>0</is_market>
   <order_time>2</order_time>
  </Order>
 </Offers>
 <registration_timer>5</registration_timer>
</Market>








------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Sedna-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sedna-discussion

Reply via email to