Ticket #11282: 0018-add-index-to-improve-mythfilldatabase-performance.patch

File 0018-add-index-to-improve-mythfilldatabase-performance.patch, 1.4 KB (added by Karl Egly, 11 years ago)
  • mythtv/libs/libmythtv/dbcheck.cpp

    From 1e171aa3f4555d781e4e82d62167a2d60eed4bf3 Mon Sep 17 00:00:00 2001
    From: Karl Dietz <dekarl@mythtv.org>
    Date: Sun, 21 Jul 2013 23:50:55 +0200
    Subject: [PATCH 18/18] add index to improve mythfilldatabase performance
    
    Fixes #11282
    ---
     mythtv/libs/libmythtv/dbcheck.cpp |   12 ++++++++++++
     1 file changed, 12 insertions(+)
    
    diff --git a/mythtv/libs/libmythtv/dbcheck.cpp b/mythtv/libs/libmythtv/dbcheck.cpp
    index 6ae3b3d..551ed92 100644
    a b The schema contains the following tables: 
    6565<tr><td>profilegroups              <td>pk(id) uk(name,hostname)
    6666<tr><td>program                    <td>k(endtime) k(title) k(title_pronounce) k(seriesid)
    6767                                       k(programid) k(chanid,starttime,endtime)
     68                                       k(starttime,title,subtitle)
    6869<tr><td>programgenres              <td>pk(chanid,starttime,relevance)
    6970<tr><td>programrating              <td>uk(chanid,starttime,system,rating)
    7071                                       k(starttime,system)
    NULL 
    24502451            return false;
    24512452    }
    24522453
     2454    if (dbver == "1315")
     2455    {
     2456        const char *updates[] = {
     2457"ALTER TABLE program ADD INDEX start_title_subtitle (starttime, title, subtitle);",
     2458NULL
     2459};
     2460        if (!performActualUpdate(updates, "1316", dbver))
     2461            return false;
     2462    }
     2463
     2464
    24532465    return true;
    24542466}
    24552467