Skip to content

Commit

Permalink
add index to improve mythfilldatabase performance
Browse files Browse the repository at this point in the history
fix index documentation of related index while here

slipping it in before the beta is cut as per discussion at
http://irc.mythtv.org/ircLog/channel/4/2013-08-15:19:25

Fixes #11282
  • Loading branch information
dekarl committed Aug 16, 2013
1 parent f64d715 commit 8acb5ad
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mythtv/bindings/perl/MythTV.pm
Expand Up @@ -115,7 +115,7 @@ package MythTV;
# schema version supported in the main code. We need to check that the schema
# version in the database is as expected by the bindings, which are expected
# to be kept in sync with the main code.
our $SCHEMA_VERSION = "1315";
our $SCHEMA_VERSION = "1316";

# NUMPROGRAMLINES is defined in mythtv/libs/libmythtv/programinfo.h and is
# the number of items in a ProgramInfo QStringList group used by
Expand Down
2 changes: 1 addition & 1 deletion mythtv/bindings/python/MythTV/static.py
Expand Up @@ -5,7 +5,7 @@
"""

OWN_VERSION = (0,27,-1,0)
SCHEMA_VERSION = 1315
SCHEMA_VERSION = 1316
NVSCHEMA_VERSION = 1007
MUSICSCHEMA_VERSION = 1018
PROTO_VERSION = '77'
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/mythversion.h
Expand Up @@ -61,7 +61,7 @@
* mythtv/bindings/php/MythBackend.php
#endif

#define MYTH_DATABASE_VERSION "1315"
#define MYTH_DATABASE_VERSION "1316"


MBASE_PUBLIC const char *GetMythSourceVersion();
Expand Down
17 changes: 15 additions & 2 deletions mythtv/libs/libmythtv/dbcheck.cpp
Expand Up @@ -63,8 +63,9 @@ The schema contains the following tables:
<tr><td>people <td>pk(person) uk(name)
<tr><td>pidcache <td>
<tr><td>profilegroups <td>pk(id) uk(name,hostname)
<tr><td>program <td>k(endtime) k(title) k(title_pronounce) k(seriesid)
k(programid) k(chanid,starttime,endtime)
<tr><td>program <td>k(endtime) k(title_pronounce) k(seriesid)
k(programid,starttime) k(chanid,starttime,endtime)
k(title,subtitle,starttime)
<tr><td>programgenres <td>pk(chanid,starttime,relevance)
<tr><td>programrating <td>uk(chanid,starttime,system,rating)
k(starttime,system)
Expand Down Expand Up @@ -2450,6 +2451,18 @@ NULL
return false;
}

if (dbver == "1315")
{
const char *updates[] = {
"ALTER TABLE program ADD INDEX title_subtitle_start (title, subtitle, starttime);",
"ALTER TABLE program DROP INDEX title;",
NULL
};
if (!performActualUpdate(updates, "1316", dbver))
return false;
}


return true;
}

Expand Down

0 comments on commit 8acb5ad

Please sign in to comment.