From a62ecf819a3dd383bfbbfa5c728577e3f3256ec2 Mon Sep 17 00:00:00 2001
From: Karl Dietz <dekarl@users.sourceforge.net>
Date: Wed, 7 Sep 2011 13:36:56 +0200
Subject: [PATCH 2/2] Speed up time search by factoring out the description into a super query.
---
mythtv/libs/libmyth/programinfo.cpp | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/mythtv/libs/libmyth/programinfo.cpp b/mythtv/libs/libmyth/programinfo.cpp
index b4b73f1..010fefc 100644
a
|
b
|
static bool FromProgramQuery( |
4366 | 4366 | const QString &sql, const MSqlBindings &bindings, MSqlQuery &query) |
4367 | 4367 | { |
4368 | 4368 | QString querystr = QString( |
| 4369 | "select program.description, sub.* from program, (" |
4369 | 4370 | "SELECT DISTINCT program.chanid, program.starttime, program.endtime, " |
4370 | | " program.title, program.subtitle, program.description, " |
| 4371 | " program.title, program.subtitle, " |
4371 | 4372 | " program.category, channel.channum, channel.callsign, " |
4372 | 4373 | " channel.name, program.previouslyshown, channel.commmethod, " |
4373 | 4374 | " channel.outputfilters, program.seriesid, program.programid, " |
… |
… |
static bool FromProgramQuery( |
4400 | 4401 | if (!sql.contains(" LIMIT ")) |
4401 | 4402 | querystr += " LIMIT 20000 "; |
4402 | 4403 | |
| 4404 | querystr += " ) as sub where program.chanid=sub.chanid and program.starttime=sub.starttime"; |
| 4405 | |
4403 | 4406 | query.prepare(querystr); |
4404 | 4407 | MSqlBindings::const_iterator it; |
4405 | 4408 | for (it = bindings.begin(); it != bindings.end(); ++it) |