[mythtv-commits] Ticket #13649: Excessive calls to SELECT sourceid FROM capturecard WHERE cardid = ?

MythTV noreply at mythtv.org
Tue Jul 14 17:22:25 UTC 2020


#13649: Excessive calls to SELECT sourceid FROM capturecard WHERE cardid = ?
----------------------------------+-------------------------------
 Reporter:  bib1963               |          Owner:  Klaas de Waal
     Type:  Bug Report - General  |         Status:  accepted
 Priority:  minor                 |      Milestone:  31.1
Component:  MythTV - General      |        Version:  Unspecified
 Severity:  medium                |     Resolution:
 Keywords:                        |  Ticket locked:  0
----------------------------------+-------------------------------
Changes (by Klaas de Waal):

 * status:  assigned => accepted
 * milestone:  needs_triage => 31.1


Comment:

 This problem can be easily reproduced.
 What happens is the following.
 The SQL query comes from CaptureCard::GetSourceID.
 This is called from DVBChannel::GetMasterLock each time this function is
 called in order to create the key for the master lock of which the source
 ID is a part.
 This is done 40 times per second for each device so for two devices that
 is indeed 80 times per second. Well spotted!

 The solution is to create the key only once and to save the key for later
 use.
 This is now being tested, if no problems appear then this will be
 committed.
 For the curious and for those wanting to review, the implementation is
 attached.

-- 
Ticket URL: <https://code.mythtv.org/trac/ticket/13649#comment:3>
MythTV <http://www.mythtv.org>
MythTV Media Center


More information about the mythtv-commits mailing list