Skip to content
Snippets Groups Projects
Commit e1395d07 authored by tjc's avatar tjc
Browse files

speed up getFeatureDbXRefsBySrcFeature

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@7212 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent eb51d6e7
No related branches found
No related tags found
No related merge requests found
......@@ -58,18 +58,17 @@
<select id="getFeatureDbXRefsBySrcFeature"
parameterClass="org.gmod.schema.sequence.Feature"
resultMap="map-feature-dbxref">
SELECT db.name, dbx.accession, dbx.version, dbx.description,
dbx_f.feature_id, dbx_f.is_current
FROM feature_dbxref dbx_f
LEFT JOIN dbxref dbx ON dbx.dbxref_id=dbx_f.dbxref_id
LEFT JOIN db ON db.db_id=dbx.db_id
LEFT JOIN feature f ON dbx_f.feature_id=f.feature_id
WHERE dbx_f.feature_id IN
(SELECT feature_id FROM featureloc fl WHERE srcfeature_id=$featureId$
SELECT db.name, dbx.accession, dbx.version, dbx.description,
dbx_f.feature_id, dbx_f.is_current
FROM featureloc fl
RIGHT JOIN feature_dbxref dbx_f ON fl.feature_id = dbx_f.feature_id
LEFT JOIN dbxref dbx ON dbx.dbxref_id=dbx_f.dbxref_id
LEFT JOIN db ON db.db_id=dbx.db_id
WHERE srcfeature_id = $featureId$
<isGreaterThan property="featureLoc.fmin" compareValue="0" prepend="AND">
<![CDATA[ fl.fmin > $featureLoc.fmin$ AND fl.fmax < $featureLoc.fmax$ ]]>
</isGreaterThan>)
ORDER BY f.type_id, uniquename
</isGreaterThan>
ORDER BY fl.feature_id, dbx.accession , db.name;
</select>
<!-- WRITE BACK -->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment