Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add index for incrementusecount to the texture database

  • Loading branch information...
commit db6b4bb4605e7de40d461dbfd25d785238d09d53 1 parent 3877767
Jonathan Marshall authored
Showing with 6 additions and 1 deletion.
  1. +5 −0 xbmc/TextureDatabase.cpp
  2. +1 −1  xbmc/TextureDatabase.h
View
5 xbmc/TextureDatabase.cpp
@@ -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
2  xbmc/TextureDatabase.h
@@ -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"; };
};
Please sign in to comment.
Something went wrong with that request. Please try again.