[mythtv-commits] Ticket #12167: Improve caching to reduce SQL queries

MythTV noreply at mythtv.org
Sun Jun 8 21:59:40 UTC 2014


#12167: Improve caching to reduce SQL queries
----------------------------------------+-------------------------
     Reporter:  Rune Petersen <rune@…>  |      Owner:
         Type:  Patch - Feature         |     Status:  new
     Priority:  minor                   |  Milestone:  unknown
    Component:  MythTV - General        |    Version:  Unspecified
     Severity:  medium                  |   Keywords:
Ticket locked:  0                       |
----------------------------------------+-------------------------
 mythfrontend make allot of SQL queries when when it is launched, and this
 affects the time it takes to launch the frontend quite significantly when
 you have a relatively slow master backend.

 Allot of the time is spent querying the settings table for a single value
 at a time, and for querying the keymappings a single key at a time.

 I have made 2 PoC patches showing it is possible to to eliminate almost
 all of these SQL queries which reduces launch time from 18 secs. to 4-5
 secs with a Cortes A8 1GHz master backend.


 mythtv_poc_improve_caching_of_host_settings.patch:
     - Enable caching if settings a little earlier.
     - When enabling settings cache query all host specific and global
 settings from master backend.
     - If cache is enabled and a key is not found in the cache don't fall
 back to querying master backend since we should be synchronized.
     - Use HostSettingStorage instead of HostDBStorage for Settings menus.
       HostSettingStorage gets/sets settings via MythDB which is cached.
       (can be extended to also work with global settings as well)
     - Reduces load time by ca. 9 secs. for me.


 mythtv_poc_cache_all_keybindings.patch:
     - Cache all keymappings and make use of it when binding keys.
     - Reduces load time by ca. 4 secs. for me.


 I know these patches are little rough, but I would like to know if you are
 interested in changes along these lines.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/12167>
MythTV <http://www.mythtv.org>
MythTV Media Center


More information about the mythtv-commits mailing list