From 3ac04ec290fbaf975c49095e905f42d7841d5a20 Mon Sep 17 00:00:00 2001
From: Karl Dietz <dekarl@mythtv.org>
Date: Fri, 29 May 2015 15:32:20 +0200
Subject: [PATCH] add daily defragmentation of the recordedseek table
This fixed very slow (more then 10 seconds) waiting times on start of
recording playback caused by very slow loading of the seek table from
the database.
Fixes #12451
---
mythtv/programs/mythbackend/backendhousekeeper.cpp | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/mythtv/programs/mythbackend/backendhousekeeper.cpp b/mythtv/programs/mythbackend/backendhousekeeper.cpp
index 7e0da83..d421476 100644
a
|
b
|
void CleanupTask::CleanupRecordedTables(void) |
271 | 271 | } |
272 | 272 | |
273 | 273 | if (!query.exec("DROP TABLE temprecordedcleanup;")) |
| 274 | { |
274 | 275 | MythDB::DBError("CleanupTask::CleanupRecordedTables" |
275 | 276 | "(deleting temporary table)", query); |
| 277 | return; |
| 278 | } |
| 279 | |
| 280 | query.prepare(QString("ALTER TABLE recordedseek ORDER BY chanid, starttime;")); |
| 281 | if (!query.exec() || !query.isActive()) |
| 282 | { |
| 283 | MythDB::DBError("CleanupTask::CleanupRecordedTables" |
| 284 | "(defragmenting recorded seek table)", query); |
| 285 | return; |
| 286 | } |
276 | 287 | } |
277 | 288 | |
278 | 289 | void CleanupTask::CleanupProgramListings(void) |