[mythtv-commits] mythtv commit: r15566 by cpinkham
mythtv at cvs.mythtv.org
mythtv at cvs.mythtv.org
Thu Jan 24 06:21:38 UTC 2008
Author: cpinkham
Date: 2008-01-24 06:21:38 +0000 (Thu, 24 Jan 2008)
New Revision: 15566
Changeset: http://cvs.mythtv.org/trac/changeset/15566
Modified:
trunk/mythtv/programs/mythbackend/scheduler.cpp
Log:
Make temporary copies of the record and recorded table for the Scheduler's BUQ.
When we are performing a scheduler run against the record table, a temp copy
will be created and used in the query instead. When we are speculative
sheduling against a different table, no temp table will be created, the
tablename provided will be used as-is. The code will always create a temp
copy of the recorded table. The temp tables are created with the same columns
and indexes as the original tables.
This code should eliminate quite a few places of contention which would hang
the frontend GUI during a scheduler run. These include anything that tries
to update the record or recorded table, such as updating a bookmark, the
cutlist, a scheduled recording, etc..
There was only a .068 second penalty on my dev box (with a remote DB) for
creating these temp tables with a record table size of 116 and a recorded
table size of 398. Building the temp tables without the indexes saved only
.035 seconds at the cost of the scheduler run taking a couple seconds longer
to run, so I used the indexed version in this patch.
2008-01-24 01:14:09.078 MSqlQuery: DROP TABLE IF EXISTS sched_temp_record;
2008-01-24 01:14:09.082 MSqlQuery: CREATE TEMPORARY TABLE sched_temp_record LIKE record;
2008-01-24 01:14:09.104 MSqlQuery: INSERT sched_temp_record SELECT * from record;
2008-01-24 01:14:09.104 MSqlQuery: DROP TABLE IF EXISTS sched_temp_recorded;
2008-01-24 01:14:09.107 MSqlQuery: CREATE TEMPORARY TABLE sched_temp_recorded LIKE recorded;
2008-01-24 01:14:09.145 MSqlQuery: INSERT sched_temp_recorded SELECT * from recorded;
2008-01-24 01:14:09.146 MSqlQuery: SELECT recpriority, selectclause FROM powerpriority;
More information about the mythtv-commits
mailing list