Permalink
Browse files

add index for incrementusecount to the texture database

  • Loading branch information...
1 parent 3877767 commit db6b4bb4605e7de40d461dbfd25d785238d09d53 Jonathan Marshall committed May 24, 2012
Showing with 6 additions and 1 deletion.
  1. +5 −0 xbmc/TextureDatabase.cpp
  2. +1 −1 xbmc/TextureDatabase.h
View
@@ -53,6 +53,7 @@ bool CTextureDatabase::CreateTables()
CLog::Log(LOGINFO, "create sizes table, index, and trigger");
m_pDS->exec("CREATE TABLE sizes (idtexture integer, size integer, width integer, height integer, usecount integer, lastusetime text)");
m_pDS->exec("CREATE INDEX idxSize ON sizes(idtexture, size)");
+ m_pDS->exec("CREATE INDEX idxSize2 ON sizes(idtexture, width, height)");
m_pDS->exec("CREATE TRIGGER textureDelete AFTER delete ON texture FOR EACH ROW BEGIN delete from sizes where sizes.idtexture=old.id; END");
CLog::Log(LOGINFO, "create path table");
@@ -136,6 +137,10 @@ bool CTextureDatabase::UpdateOldVersion(int version)
m_pDS->exec("CREATE INDEX idxSize ON sizes(idtexture, size)");
m_pDS->exec("CREATE TRIGGER textureDelete AFTER delete ON texture FOR EACH ROW BEGIN delete from sizes where sizes.idtexture=old.id; END");
}
+ if (version < 13)
+ { // index for updateusecount
+ m_pDS->exec("CREATE INDEX idxSize2 ON sizes(idtexture, width, height)");
+ }
}
catch (...)
{
View
@@ -82,6 +82,6 @@ class CTextureDatabase : public CDatabase
virtual bool CreateTables();
virtual bool UpdateOldVersion(int version);
- virtual int GetMinVersion() const { return 12; };
+ virtual int GetMinVersion() const { return 13; };
const char *GetBaseDBName() const { return "Textures"; };
};

0 comments on commit db6b4bb

Please sign in to comment.