Author Topic: [SOLVED] - UpdateMedia mysql queries takes 100% CPU on a core - is that normal ?  (Read 4213 times)

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
It almost looks like the long list of PK_Files is the subset of media files of the particular MediaType that the data grid is to be for. eg all the media files of "LinuxMCE Video File" type, so the query only returns video files.

That doesn't seem very efficient (intuition only here!). If that is the purpose wouldn't it have been better to have used the EK_MediaType key in the pluto_media.File table and just use a normal matching Where clause?

Or is that set of PK_Files something else entirely? hmmm.... perhaps it is the subset of files it has determined are currently "available" based on which media sources are currently online/connected to the LMCE network?

Viking

  • Addicted
  • *
  • Posts: 521
    • View Profile
Someone will have to dig the code to find out ;)

Viking

phenigma

  • wants to work for LinuxMCE
  • **
  • Posts: 945
    • View Profile
So I'd been unhappy with my queries performances following a re-install in January and it turns out the indexes built in this thread are not being applied to new installations.  I have added at least one more index now which has added another significant speed-up to some of my queries and I've made some adjustments to query_cache which have also significantly sped-up some of my queries and reduced the load on my core.  I'm hopefully going to wrap this all up on a dev system and submit a patch in about 1.5 weeks (when I have a week off). 

There has been some discussion in IRC about optimizations regarding the video query after doing tv episode tagging. 

Has anyone else figured out any other optimizations during their playing?  I'd love to incorporate anything/everything I can.

J.

Viking

  • Addicted
  • *
  • Posts: 521
    • View Profile
Sounds good :) looking forward to that.

I had no time looking further into this. But it feels as if the queries has gone slower again :( - probably beacuse I have added more videos and pictures.

Viking