Hello Basexers,

 

I’m getting such a low performance on a relatively simple join between two databases that I feel there must be something going wrong here. I can provide the sources if necessary, but basically DB1 is 26 MB, about 80,000 small documents; DB2 is 47 MB, about 18,500 small documents. I’m using 8.4, by the way, haven’t tested on other releases.

 

Query 1 [returns in 144 minutes]

----------------------------------------

 

for $a in (db:open('DB1')/item/order-id)

return

  if (db:open('DB2')//order-id[. = $a]) then

    $a

  else

    ()

 

Note that the optimized query uses db:open-pre to access DB2. When I re-write the query myself to use the TEXT index then performance is excellent. But why such a difference?

 

 

Query 2 [returns in 0.3 second]

----------------------------------------

 

for $a in (db:open('DB1')/item/order-id)

return

  if (db:text('DB2', $a)/parent::order-id) then

    $a

  else

   ()



Elsevier B.V. Registered Office: Radarweg 29, 1043 NX Amsterdam, The Netherlands, Registration No. 33156677, Registered in The Netherlands.