From 1caf7a443074cd400f9e62c4ce627f164bd63d14 Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 27 Aug 2019 14:45:02 -0500 Subject: 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 --- wqflask/wqflask/api/gen_menu.py | 24 ++++++++++++++++-------- 1 file 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])]) -- cgit v1.2.3