This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1297618 - [SLOW QUERY] reprovision_distro_tree_id
[SLOW QUERY] reprovision_distro_tree_id
Status: NEW
Product: Beaker
Classification: Community
Component: web UI (Show other bugs)
21
Unspecified Unspecified
unspecified Severity unspecified (vote)
: ---
: ---
Assigned To: beaker-dev-list
tools-bugs
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-11 21:56 EST by Dan Callaghan
Modified: 2016-07-27 02:32 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dan Callaghan 2016-01-11 21:56:34 EST
bkr/server/controllers.py has this code:

 666         options['reprovision_distro_tree_id'] = [(dt.id, unicode(dt)) for dt in
 667                 system.distro_trees().order_by(Distro.name,
 668                     DistroTree.variant, DistroTree.arch_id)]

which produces this slow query:

Count: 15673  Time=0.14s (2259s)  Lock=0.00s (2s)  Rows_sent=353.3 (5537714), Rows_examined=40911.1 (641199732), beaker[beaker]@localhost
  SELECT osmajor.id AS osmajor_id, osmajor.osmajor AS osmajor_osmajor, osmajor.alias AS osmajor_alias, osversion.id AS osversion_id, osversion.osmajor_id AS osversion_osmajor_id, osversion.osminor AS osversion_osminor, distro.id AS distro_id, distro.name AS distro_name, distro.osversion_id AS distro_osversion_id, distro.date_created AS distro_date_created, distro_tree.id AS distro_tree_id, distro_tree.distro_id AS distro_tree_distro_id, distro_tree.arch_id AS distro_tree_arch_id, distro_tree.variant AS distro_tree_variant, distro_tree.ks_meta AS distro_tree_ks_meta, distro_tree.kernel_options AS distro_tree_kernel_options, distro_tree.kernel_options_post AS distro_tree_kernel_options_post, distro_tree.date_created AS distro_tree_date_created 
  FROM distro_tree INNER JOIN distro ON distro.id = distro_tree.distro_id INNER JOIN osversion ON osversion.id = distro.osversion_id INNER JOIN osmajor ON osmajor.id = osversion.osmajor_id 
  WHERE (EXISTS (SELECT N 
  FROM distro_tree_lab_controller_map 
  WHERE distro_tree.id = distro_tree_lab_controller_map.distro_tree_id AND N = distro_tree_lab_controller_map.lab_controller_id)) AND distro_tree.arch_id IN (N) AND NOT (EXISTS (SELECT N 
  FROM exclude_osmajor 
  WHERE osmajor.id = exclude_osmajor.osmajor_id AND N = exclude_osmajor.system_id AND exclude_osmajor.arch_id = distro_tree.arch_id)) AND NOT (EXISTS (SELECT N 
  FROM exclude_osversion 
  WHERE osversion.id = exclude_osversion.osversion_id AND N = exclude_osversion.system_id AND exclude_osversion.arch_id = distro_tree.arch_id)) ORDER BY distro.name, distro_tree.variant, distro_tree.arch_id

but I'm 90% sure that code for reprovision_distro_tree_id is actually dead, since the UI is using the new distro tree selector modal now instead. Double check and then delete it to avoid these (relatively expensive!) pointless queries.

Note You need to log in before you can comment on or make changes to this bug.