[mythtv-commits] Ticket #10023: Improve performance of time search
MythTV
noreply at mythtv.org
Wed Sep 7 11:35:45 UTC 2011
#10023: Improve performance of time search
-------------------------------------+-------------------------------------
Reporter: dekarl@… | Type: Bug Report -
Status: new | General
Milestone: unknown | Priority: minor
Version: Trunk Head | Component: MythTV - General
Keywords: | Severity: medium
| Ticket locked: 0
-------------------------------------+-------------------------------------
The SQL query for time search takes 2 minutes over here. By slightly
refactoring the query that can be brought down to 2 seconds. Just factor
out the description column into a superquery with the actual query being a
subquery.
The new query looks like:
{{{
select program.description, sub.* from program, (
SELECT DISTINCT program.chanid,
... here is the old query but without the description column ...
) as sub where program.chanid=sub.chanid and
program.starttime=sub.starttime;
}}}
The reason for the difference is each description taking 48kb of memory no
matter how much of that is actually used leading to the whole joining and
sorting being done on the hard disk because it doesn't fit into the memory
buffer. (at least that's what I suspect)
--
Ticket URL: <http://code.mythtv.org/trac/ticket/10023>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center
More information about the mythtv-commits
mailing list