[mythtv-commits] Ticket #7330: Inefficient SQL in Mythweb

MythTV mythtv at cvs.mythtv.org
Thu Oct 15 19:31:02 UTC 2009


#7330: Inefficient SQL in Mythweb
--------------------------------------------------------+-------------------
 Reporter:  Mark Edwards <mythtv-trac@…>                |       Owner:  kormoc 
     Type:  patch                                       |      Status:  new    
 Priority:  trivial                                     |   Milestone:  unknown
Component:  Plugin - MythWeb                            |     Version:  head   
 Severity:  low                                         |     Mlocked:  0      
--------------------------------------------------------+-------------------
 I noticed a query in Mythweb that looks to me a little inefficient.
 The main issue is it LEFT JOINS to two large tables that aren't actually
 selected from (credits and people).
 It also could make use of channel.visible=1 to cut down unwanted results
 and it may as well do an inner join of program to channel cos if either
 isn't there it's cos something weird has happened and we wouldn't want it
 in the result set anyway.
 The attached patch changes this.

 Further to this I believe (but I'm not sure) that the sorting clause could
 be removed from this query as Mythweb appears to always sort the results
 anyway, but perhaps someone with more knowledge could verify this.

 This query was one that used to always turn up in my slow query logs, with
 the attached patch and the additional removal of the sorting clause it no
 longer does :)

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/7330>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list