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

change getLazySimilarityMatches and getLazySimilarityMatchesByFeatureIds to...

change getLazySimilarityMatches and getLazySimilarityMatchesByFeatureIds to speed up loading similarity and polypeptide domains that are featureLoc'ed


git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@8882 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 04b9ba65
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,11 @@ ...@@ -12,7 +12,11 @@
<cacheModel id="feature-cache" type ="LRU" readOnly="true"> <cacheModel id="feature-cache" type ="LRU" readOnly="true">
<flushInterval hours="24"/> <flushInterval hours="24"/>
<property name="cache-size" value="4" /> <flushOnExecute statement="insertFeature"/>
<flushOnExecute statement="updateFeature"/>
<flushOnExecute statement="deleteFeature"/>
<flushOnExecute statement="deleteFeatureById"/>
<property name="cache-size" value="10" />
</cacheModel> </cacheModel>
<parameterMap id="schema-cvlist" <parameterMap id="schema-cvlist"
...@@ -110,18 +114,21 @@ ...@@ -110,18 +114,21 @@
<result property="featureLoc.strand" column="strand" nullValue="0" /> <result property="featureLoc.strand" column="strand" nullValue="0" />
<result property="featureLoc.phase" column="phase" nullValue="0" /> <result property="featureLoc.phase" column="phase" nullValue="0" />
</resultMap> </resultMap>
<resultMap id="map-similaritymatch" class="Feature"
<resultMap id="map-similaritymatch-lazy" class="Feature"
groupBy="featureId" extends="map-basicfeature"> groupBy="featureId" extends="map-basicfeature">
<result property="cvTerm.cvTermId" column="type_id" /> <result property="cvTerm.cvTermId" column="type_id" />
<result property="featureLocsForFeatureId" resultMap="FeatureLoc.map-location" /> <result property="featureLocsForFeatureId" column="{id=id}"
select="getFeatureLoc" />
<result property="featureProps" column="{feature_id=id}" <result property="featureProps" column="{feature_id=id}"
select="getFeaturePropByFeatureId" /> select="getFeaturePropByFeatureId" />
<result property="featureDbXRefs" column="{featureId=id}" <result property="featureDbXRefs" column="{featureId=id}"
select="getFeatureDbXRef" /> select="getFeatureDbXRef" />
<result property="dbXRef" column="dbXRefId" <result property="dbXRef" column="dbXRefId"
select="getDbXRefByDbXRefId" /> select="getDbXRefByDbXRefId" />
<result property="analysisFeatures" resultMap="AnalysisFeature.map-analysisfeature" /> <result property="analysisFeatures" column="{feature_id=id}"
select="getAnalysisFeaturesByFeatureId" />
</resultMap> </resultMap>
...@@ -224,34 +231,34 @@ ...@@ -224,34 +231,34 @@
LEFT JOIN cvterm ON f.type_id=cvterm.cvterm_id LEFT JOIN cvterm ON f.type_id=cvterm.cvterm_id
</isNotNull> </isNotNull>
</dynamic> </dynamic>
WHERE
<dynamic> <dynamic prepend="WHERE">
<isGreaterThan property="featureId" compareValue="0"> <isGreaterThan property="featureId" compareValue="0">
f.feature_id=$featureId$ AND f.feature_id=$featureId$
</isGreaterThan> </isGreaterThan>
<isNotNull property="uniqueName"> <isNotNull property="uniqueName" prepend="AND">
<isNotNull property="featureSynonyms"> <isNotNull property="featureSynonyms">
<iterate property="featureSynonyms" conjunction="OR" open="(" close=") OR"> <iterate property="featureSynonyms" conjunction="OR" open="(" close=") OR">
f.feature_id=#featureSynonyms[].feature.featureId# f.feature_id=#featureSynonyms[].feature.featureId#
</iterate> </iterate>
</isNotNull> </isNotNull>
( uniquename LIKE #uniqueName# ESCAPE '/' OR f.name LIKE #uniqueName# ESCAPE '/') AND ( uniquename=#uniqueName# )
</isNotNull> </isNotNull>
<isGreaterThan property="cvTerm.cvTermId" compareValue="0"> <isGreaterThan property="cvTerm.cvTermId" compareValue="0" prepend="AND">
f.type_id=$cvTerm.cvTermId$ AND f.type_id=$cvTerm.cvTermId$
</isGreaterThan> </isGreaterThan>
<isNotNull property="cvTerm.name"> <isNotNull property="cvTerm.name" prepend="AND">
cvterm.name=#cvTerm.name# AND cvterm.name=#cvTerm.name#
</isNotNull> </isNotNull>
</dynamic> </dynamic>
f.feature_id > 0
</select> </select>
<select id="getLazyFeatureNoResiduesById" resultMap ="map-feature-lazy-no-residues" > <select id="getLazyFeatureNoResiduesById" resultMap ="map-feature-lazy-no-residues"
cacheModel="feature-cache">
SELECT SELECT
timelastmodified, timelastmodified,
f.feature_id AS id, f.feature_id AS id,
...@@ -343,20 +350,17 @@ ...@@ -343,20 +350,17 @@
f.dbxref_id AS dbXRefId, f.dbxref_id AS dbXRefId,
f.name AS feature_name, f.name AS feature_name,
f.seqlen, f.seqlen,
f.residues, f.residues
srcfeature_id, fmin, fmax, strand, phase, residue_info, locgroup, fl.rank, FROM feature f
rawscore, normscore, significance, identity, a.analysis_id, <!--LEFT JOIN featureloc fl ON f.feature_id=fl.feature_id
a.name, description, program, programversion, algorithm, sourcename, sourceversion,sourceuri, timeexecuted
FROM feature f
LEFT JOIN featureloc fl ON f.feature_id=fl.feature_id
LEFT JOIN analysisfeature af ON f.feature_id=af.feature_id LEFT JOIN analysisfeature af ON f.feature_id=af.feature_id
LEFT JOIN analysis a ON af.analysis_id=a.analysis_id LEFT JOIN analysis a ON af.analysis_id=a.analysis_id-->
WHERE f.feature_id IN WHERE f.feature_id IN
</sql> </sql>
<!-- Returns matches for all features on a given srcfeature --> <!-- Returns matches for all features on a given srcfeature -->
<select id="getLazySimilarityMatches" parameterClass="java.lang.Integer" <select id="getLazySimilarityMatches" parameterClass="java.lang.Integer"
resultMap="map-similaritymatch"> resultMap="map-similaritymatch-lazy">
<include refid="selectSimilarityMatch"/> <include refid="selectSimilarityMatch"/>
( SELECT feature_id FROM featureloc WHERE srcfeature_id IN ( SELECT feature_id FROM featureloc WHERE srcfeature_id IN
( SELECT feature_id FROM featureloc WHERE srcfeature_id=$value$) ) ( SELECT feature_id FROM featureloc WHERE srcfeature_id=$value$) )
...@@ -365,7 +369,7 @@ ...@@ -365,7 +369,7 @@
<!-- Returns matches for a list of feature_id's --> <!-- Returns matches for a list of feature_id's -->
<select id="getLazySimilarityMatchesByFeatureIds" parameterClass="java.util.List" <select id="getLazySimilarityMatchesByFeatureIds" parameterClass="java.util.List"
resultMap="map-similaritymatch"> resultMap="map-similaritymatch-lazy">
<include refid="selectSimilarityMatch"/> <include refid="selectSimilarityMatch"/>
( SELECT feature_id FROM featureloc WHERE srcfeature_id IN ( SELECT feature_id FROM featureloc WHERE srcfeature_id IN
<iterate open="(" close=")" conjunction=","> $[]$ </iterate> <iterate open="(" close=")" conjunction=","> $[]$ </iterate>
......
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