aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2019-08-27 14:45:02 -0500
committerzsloan2019-08-27 14:45:02 -0500
commit1caf7a443074cd400f9e62c4ce627f164bd63d14 (patch)
tree2c9d69db17c488be4ccb80f3a6a114d0593d9c6b /wqflask
parent0cec57ef9ada33207a6636a54276566896b21da6 (diff)
downloadgenenetwork2-1caf7a443074cd400f9e62c4ce627f164bd63d14.tar.gz
Removed part of a query that was slowing down dropdown menu generation; doesn't seem to be needed, but should keep an eye out for any issues
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/api/gen_menu.py24
1 files changed, 16 insertions, 8 deletions
diff --git a/wqflask/wqflask/api/gen_menu.py b/wqflask/wqflask/api/gen_menu.py
index a2faa463..5182ea13 100644
--- a/wqflask/wqflask/api/gen_menu.py
+++ b/wqflask/wqflask/api/gen_menu.py
@@ -5,6 +5,7 @@ import sys
from flask import g
from utility.tools import locate, locate_ignore_error, TEMPDIR, SQL_URI
+from utility.benchmark import Bench
import MySQLdb
@@ -54,15 +55,22 @@ def get_groups(species):
groups = {}
for species_name, _species_full_name in species:
groups[species_name] = []
+ # results = g.db.execute("""SELECT InbredSet.Name, InbredSet.FullName
+ # FROM InbredSet, Species, ProbeFreeze, GenoFreeze, PublishFreeze
+ # WHERE Species.Name = '{}' AND
+ # InbredSet.SpeciesId = Species.Id AND
+ # (PublishFreeze.InbredSetId = InbredSet.Id OR
+ # GenoFreeze.InbredSetId = InbredSet.Id OR
+ # ProbeFreeze.InbredSetId = InbredSet.Id)
+ # GROUP by InbredSet.Name
+ # ORDER BY InbredSet.FullName""".format(species_name)).fetchall()
+
results = g.db.execute("""SELECT InbredSet.Name, InbredSet.FullName
- FROM InbredSet, Species, ProbeFreeze, GenoFreeze, PublishFreeze
- WHERE Species.Name = '{}' AND
- InbredSet.SpeciesId = Species.Id AND
- (PublishFreeze.InbredSetId = InbredSet.Id OR
- GenoFreeze.InbredSetId = InbredSet.Id OR
- ProbeFreeze.InbredSetId = InbredSet.Id)
- GROUP by InbredSet.Name
- ORDER BY InbredSet.FullName""".format(species_name)).fetchall()
+ FROM InbredSet, Species
+ WHERE Species.Name = '{}' AND
+ InbredSet.SpeciesId = Species.Id
+ GROUP by InbredSet.Name
+ ORDER BY InbredSet.FullName""".format(species_name)).fetchall()
for result in results:
groups[species_name].append([str(result[0]), str(result[1])])