db: Remove indexes
They aren't doing anything useful to help speed up sorting, so remove for now and reevaluate later Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
798ef20a72
commit
853594fc26
|
@ -4,11 +4,6 @@
|
||||||
# +---------+----------+-----------+------+------+
|
# +---------+----------+-----------+------+------+
|
||||||
# | albumid | artistid | plstateid | name | sort |
|
# | albumid | artistid | plstateid | name | sort |
|
||||||
# +---------+----------+-----------+------+------+
|
# +---------+----------+-----------+------+------+
|
||||||
#
|
|
||||||
# Index: album_index
|
|
||||||
# +-----------------------------+
|
|
||||||
# | (artistid, name) -> albumid |
|
|
||||||
# +-----------------------------+
|
|
||||||
from gi.repository import GObject
|
from gi.repository import GObject
|
||||||
from . import disc
|
from . import disc
|
||||||
from . import playlist
|
from . import playlist
|
||||||
|
@ -51,7 +46,6 @@ class AlbumTable(playlist.ChildModel):
|
||||||
" FOREIGN KEY(artistid) REFERENCES artists(artistid), "
|
" FOREIGN KEY(artistid) REFERENCES artists(artistid), "
|
||||||
" FOREIGN KEY(plstateid) REFERENCES playlist_states(plstateid), "
|
" FOREIGN KEY(plstateid) REFERENCES playlist_states(plstateid), "
|
||||||
" UNIQUE(artistid, release, name))")
|
" UNIQUE(artistid, release, name))")
|
||||||
sql.execute("CREATE INDEX IF NOT EXISTS artist_index ON albums(artistid, name)")
|
|
||||||
|
|
||||||
def do_factory(self, row):
|
def do_factory(self, row):
|
||||||
return Album(row)
|
return Album(row)
|
||||||
|
|
|
@ -4,11 +4,6 @@
|
||||||
# +----------+-----------+------+------+
|
# +----------+-----------+------+------+
|
||||||
# | artistid | plstateid | name | sort |
|
# | artistid | plstateid | name | sort |
|
||||||
# +----------+-----------+------+------+
|
# +----------+-----------+------+------+
|
||||||
#
|
|
||||||
# Index: artist_index
|
|
||||||
# +------------------+
|
|
||||||
# | name -> artistid |
|
|
||||||
# +------------------+
|
|
||||||
from gi.repository import GObject
|
from gi.repository import GObject
|
||||||
from . import album
|
from . import album
|
||||||
from . import playlist
|
from . import playlist
|
||||||
|
@ -40,7 +35,6 @@ class ArtistTable(playlist.Model):
|
||||||
" name TEXT UNIQUE, "
|
" name TEXT UNIQUE, "
|
||||||
" sort TEXT, "
|
" sort TEXT, "
|
||||||
" FOREIGN KEY(plstateid) REFERENCES playlist_states(plstateid))")
|
" FOREIGN KEY(plstateid) REFERENCES playlist_states(plstateid))")
|
||||||
sql.execute("CREATE INDEX IF NOT EXISTS artist_index ON artists(name)")
|
|
||||||
|
|
||||||
def do_factory(self, row):
|
def do_factory(self, row):
|
||||||
return Artist(row)
|
return Artist(row)
|
||||||
|
|
|
@ -9,11 +9,6 @@
|
||||||
# +-----------------+
|
# +-----------------+
|
||||||
# | name -> genreid |
|
# | name -> genreid |
|
||||||
# +-----------------+
|
# +-----------------+
|
||||||
#
|
|
||||||
# Map: genre_map
|
|
||||||
# +---------+---------+
|
|
||||||
# | genreid | trackid |
|
|
||||||
# +---------+---------+
|
|
||||||
from gi.repository import GObject
|
from gi.repository import GObject
|
||||||
from . import playlist
|
from . import playlist
|
||||||
from . import track
|
from . import track
|
||||||
|
@ -49,7 +44,6 @@ class GenreTable(playlist.Model):
|
||||||
" FOREIGN KEY(genreid) REFERENCES genres(genreid), "
|
" FOREIGN KEY(genreid) REFERENCES genres(genreid), "
|
||||||
" FOREIGN KEY(trackid) REFERENCES tracks(trackid), "
|
" FOREIGN KEY(trackid) REFERENCES tracks(trackid), "
|
||||||
" UNIQUE(genreid, trackid))")
|
" UNIQUE(genreid, trackid))")
|
||||||
sql.execute("CREATE INDEX IF NOT EXISTS genre_index ON genres(name)")
|
|
||||||
|
|
||||||
def do_drop(self):
|
def do_drop(self):
|
||||||
sql.execute("DROP TABLE genres")
|
sql.execute("DROP TABLE genres")
|
||||||
|
|
|
@ -6,11 +6,6 @@
|
||||||
# +---------+-----------+------------+---------+--------+--------+
|
# +---------+-----------+------------+---------+--------+--------+
|
||||||
# | number | playcount | lastplayed | length | title | path |
|
# | number | playcount | lastplayed | length | title | path |
|
||||||
# +---------+-----------+------------+---------+--------+--------|
|
# +---------+-----------+------------+---------+--------+--------|
|
||||||
#
|
|
||||||
# Index: track_index
|
|
||||||
# +-----------------+
|
|
||||||
# | path -> trackid |
|
|
||||||
# +-----------------+
|
|
||||||
import datetime
|
import datetime
|
||||||
import pathlib
|
import pathlib
|
||||||
from gi.repository import GObject
|
from gi.repository import GObject
|
||||||
|
@ -135,7 +130,6 @@ class TrackTable(table.Table):
|
||||||
" FOREIGN KEY(albumid) REFERENCES albums(albumid), "
|
" FOREIGN KEY(albumid) REFERENCES albums(albumid), "
|
||||||
" FOREIGN KEY(discid) REFERENCES discs(discid), "
|
" FOREIGN KEY(discid) REFERENCES discs(discid), "
|
||||||
" FOREIGN KEY(yearid) REFERENCES years(yearid))")
|
" FOREIGN KEY(yearid) REFERENCES years(yearid))")
|
||||||
sql.execute("CREATE INDEX IF NOT EXISTS track_index ON tracks(path)")
|
|
||||||
|
|
||||||
def do_factory(self, row):
|
def do_factory(self, row):
|
||||||
return Track(row)
|
return Track(row)
|
||||||
|
|
|
@ -4,11 +4,6 @@
|
||||||
# +------ ---+-----------+------+------+
|
# +------ ---+-----------+------+------+
|
||||||
# | playlistid | plstateid | name | sort |
|
# | playlistid | plstateid | name | sort |
|
||||||
# +-------- -+-----------+------+------+
|
# +-------- -+-----------+------+------+
|
||||||
#
|
|
||||||
# Index: playlist_index
|
|
||||||
# +--------------------+
|
|
||||||
# | name -> playlistid |
|
|
||||||
# +--------------------+
|
|
||||||
from gi.repository import GObject
|
from gi.repository import GObject
|
||||||
from . import playlist
|
from . import playlist
|
||||||
from . import sql
|
from . import sql
|
||||||
|
@ -132,7 +127,6 @@ class UserTable(playlist.Model):
|
||||||
" FOREIGN KEY(playlistid) REFERENCES playlists(playlistid), "
|
" FOREIGN KEY(playlistid) REFERENCES playlists(playlistid), "
|
||||||
" FOREIGN KEY(trackid) REFERENCES tracks(trackid), "
|
" FOREIGN KEY(trackid) REFERENCES tracks(trackid), "
|
||||||
" UNIQUE(playlistid, trackid))")
|
" UNIQUE(playlistid, trackid))")
|
||||||
sql.execute("CREATE INDEX IF NOT EXISTS playlist_index ON playlists(name)")
|
|
||||||
|
|
||||||
self.find("Collection", loop=True)
|
self.find("Collection", loop=True)
|
||||||
self.find("Favorites")
|
self.find("Favorites")
|
||||||
|
|
Loading…
Reference in New Issue