Hi,
I am observing a performance loss between BaseX versions 9.2.4 (which I was using so far) and 9.3.2 (to which I updated recently) when executing an xQuery like this:
---
(: Open 2 databases and get all <record>s :)
let $recsFromDb1 := db:open('db1')/record
let $recsFromDb2 := db:open('db2')/record
(: Get distinct IDs of all records in db1 :)
let $idsFromRecsInDb1 := distinct-values($recsFromDb1/exampletag[@exampleattr='id'])
(: Iterate over the distinct IDs of db1 and return the records from db2 with the same ID :)
for $id in $idsFromRecsInDb1
let $recFromDb2WithSameId := $recsFromDb2[exampletag[@exampleattr='id']=$id]
return $recFromDb2WithSameId
---
In BaseX version 9.2.4 the query executes very fast (2 - 3 seconds). In 9.3.2 I didn't wait to the end ... I aborted after several minutes because I suspected that something must be wrong.
Both BaseX instances have allocated the same amount of memory (4096MB). The databases (db1 and db2) were created in the respective BaseX version from scratch and contain attribute and text indexes. They were optimized before executing the query mentioned above.
All options and preferences are the same in both BaseX instances. I am using the GUI in Ubuntu 18.04.
Here are some more details about the two databases:
db1:
- Size: 2255MB
- Nodes: 97598775
- Documents: 7489
- Uptodate: true
db2:
- Size: 883MB
- Nodes: 46317512
- Documents: 1
- Uptodate: true
Does someone have an idea why there is such a difference in performance between the two BaseX versions?
Thanks for any answers and hints!
Best regards,
Michael