Re: [bdbxml] Cross Query Performance Issues
"Deepak Jois" <[email protected]> Tue, 21 Feb 2006 15:19:31 +0800
| Newsgroups | gmane.comp.db.dbxml.general |
|---|---|
| Message-ID | <[email protected]> |
Hi
I noticed some inconsistency and also had some weird observations.
Please help me figure out what is going on. Please see my previous
mail as I am not going to repeat some of things here for brevity.
So, my initial query was :
=3D=3D=3D=3D
for $x in collection("enzyme.dbxml")/gnv_enzyme_pathway
for $y in collection("upt_swissprot.dbxml")/uniprot/entry
where
$x/db_entry/swissprot_reference_list/reference/@swissprot_accession_number
=3D $y/accession and
contains($x/db_entry/enzyme_description,"Aristolochene")
return
<result name=3D"{$y/name}" id=3D"{$y/accession}"/>
=3D=3D=3D=3D
As I said earlier, this returns two results. I checked again and this
query runs quite fast (almost instantaneous).
Now, I replace the word 'Aristolochene' with the word 'cyclase'. There
are 12 documents in the collection 'enzyme.dbxml' that match this
keyword, and the query itself returns 138 results because of multiple
/gnv_enzyme_pathway/db_entry/swissprot_reference_list/reference nodes
inside each of the 12 documents.
This causes the query to be held up for a long time. The last time I
checked, I waited for an hour and the query had not come back.
Then, I changed to query to this, which I guess is equivalent to the above =
query
=3D=3D=3D=3D=3D=3D
for $x in collection("enzyme.dbxml")/gnv_enzyme_pathway
where contains($x/db_entry/enzyme_description,"cyclase")
return
for $y in $x/db_entry/swissprot_reference_list/reference
for $z in collection("upt_swissprot.dbxml")/uniprot/entry
where
$y/@swissprot_accession_number =3D $z/accession
return
<result name=3D"{$z/name}" id=3D"{$z/accession[1]}"/>
=3D=3D=3D=3D=3D=3D
Now, the results for both 'Aristolochene' and 'cyclase' come back
within one second. Ofcourse, in the second query I am making use of
the info that number of documents in enzyme.dbxml is way lesser (only
about 4000) than in upt_swissprot.dbxml .
So, my two questions are :
- Does DBXML optimise by taking into account the fact that
enzyme.dbxml has fewer records than upt_swissprot.dbxml
- In any case, why does the first query take a disproportionately long
time as to not return even within an hour, when the second query which
seems equivalent returns almost instantaneously.
If you need to look at some sample data, is it okay to send XML files
as attachments to the list? Or shall I email it to you separately,
John?
Thanks for your help
Deepak
------------------------------------------
To remove yourself from this list, send an
email to [email protected]