1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-13 04:21:51 +02:00

Add index on playback_log.playtime

This commit is contained in:
Uwe L. Korn 2013-07-29 21:10:57 +02:00
parent 031bd3a0b1
commit 526c492409
5 changed files with 13 additions and 4 deletions

View File

@ -0,0 +1,6 @@
-- Script to migate from db version 29 to 30.
-- Add the following index to speed up all Operations that deal with a specific time period of plays
CREATE INDEX playback_log_playtime ON playback_log(playtime);
UPDATE settings SET v = '30' WHERE k == 'schema_version';

View File

@ -160,5 +160,6 @@
<file>data/fonts/PathwayGothicOne-Regular.ttf</file>
<file>data/js/cryptojs-core.js</file>
<file>data/js/cryptojs-sha256.js</file>
<file>data/sql/dbmigrate-29_to_30.sql</file>
</qresource>
</RCC>

View File

@ -46,7 +46,7 @@
*/
#include "Schema.sql.h"
#define CURRENT_SCHEMA_VERSION 29
#define CURRENT_SCHEMA_VERSION 30
Tomahawk::DatabaseImpl::DatabaseImpl( const QString& dbname )
{

View File

@ -272,6 +272,7 @@ CREATE TABLE IF NOT EXISTS playback_log (
CREATE INDEX playback_log_source ON playback_log(source);
CREATE INDEX playback_log_track ON playback_log(track);
CREATE INDEX playback_log_playtime ON playback_log(playtime);
@ -295,4 +296,4 @@ CREATE TABLE IF NOT EXISTS settings (
v TEXT NOT NULL DEFAULT ''
);
INSERT INTO settings(k,v) VALUES('schema_version', '29');
INSERT INTO settings(k,v) VALUES('schema_version', '30');

View File

@ -1,5 +1,5 @@
/*
This file was automatically generated from ./Schema.sql on Wed Sep 26 14:51:40 EDT 2012.
This file was automatically generated from ./Schema.sql on Mon Jul 29 21:04:33 CEST 2013.
*/
static const char * tomahawk_schema_sql =
@ -180,6 +180,7 @@ static const char * tomahawk_schema_sql =
");"
"CREATE INDEX playback_log_source ON playback_log(source);"
"CREATE INDEX playback_log_track ON playback_log(track);"
"CREATE INDEX playback_log_playtime ON playback_log(playtime);"
"CREATE TABLE IF NOT EXISTS http_client_auth ("
" token TEXT NOT NULL PRIMARY KEY,"
" website TEXT NOT NULL,"
@ -192,7 +193,7 @@ static const char * tomahawk_schema_sql =
" k TEXT NOT NULL PRIMARY KEY,"
" v TEXT NOT NULL DEFAULT ''"
");"
"INSERT INTO settings(k,v) VALUES('schema_version', '29');"
"INSERT INTO settings(k,v) VALUES('schema_version', '30');"
;
const char * get_tomahawk_sql()