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:
Anna Schumaker 2021-12-09 22:05:42 -05:00
parent 798ef20a72
commit 853594fc26
5 changed files with 0 additions and 30 deletions

View File

@ -4,11 +4,6 @@
# +---------+----------+-----------+------+------+
# | albumid | artistid | plstateid | name | sort |
# +---------+----------+-----------+------+------+
#
# Index: album_index
# +-----------------------------+
# | (artistid, name) -> albumid |
# +-----------------------------+
from gi.repository import GObject
from . import disc
from . import playlist
@ -51,7 +46,6 @@ class AlbumTable(playlist.ChildModel):
" FOREIGN KEY(artistid) REFERENCES artists(artistid), "
" FOREIGN KEY(plstateid) REFERENCES playlist_states(plstateid), "
" UNIQUE(artistid, release, name))")
sql.execute("CREATE INDEX IF NOT EXISTS artist_index ON albums(artistid, name)")
def do_factory(self, row):
return Album(row)

View File

@ -4,11 +4,6 @@
# +----------+-----------+------+------+
# | artistid | plstateid | name | sort |
# +----------+-----------+------+------+
#
# Index: artist_index
# +------------------+
# | name -> artistid |
# +------------------+
from gi.repository import GObject
from . import album
from . import playlist
@ -40,7 +35,6 @@ class ArtistTable(playlist.Model):
" name TEXT UNIQUE, "
" sort TEXT, "
" FOREIGN KEY(plstateid) REFERENCES playlist_states(plstateid))")
sql.execute("CREATE INDEX IF NOT EXISTS artist_index ON artists(name)")
def do_factory(self, row):
return Artist(row)

View File

@ -9,11 +9,6 @@
# +-----------------+
# | name -> genreid |
# +-----------------+
#
# Map: genre_map
# +---------+---------+
# | genreid | trackid |
# +---------+---------+
from gi.repository import GObject
from . import playlist
from . import track
@ -49,7 +44,6 @@ class GenreTable(playlist.Model):
" FOREIGN KEY(genreid) REFERENCES genres(genreid), "
" FOREIGN KEY(trackid) REFERENCES tracks(trackid), "
" UNIQUE(genreid, trackid))")
sql.execute("CREATE INDEX IF NOT EXISTS genre_index ON genres(name)")
def do_drop(self):
sql.execute("DROP TABLE genres")

View File

@ -6,11 +6,6 @@
# +---------+-----------+------------+---------+--------+--------+
# | number | playcount | lastplayed | length | title | path |
# +---------+-----------+------------+---------+--------+--------|
#
# Index: track_index
# +-----------------+
# | path -> trackid |
# +-----------------+
import datetime
import pathlib
from gi.repository import GObject
@ -135,7 +130,6 @@ class TrackTable(table.Table):
" FOREIGN KEY(albumid) REFERENCES albums(albumid), "
" FOREIGN KEY(discid) REFERENCES discs(discid), "
" FOREIGN KEY(yearid) REFERENCES years(yearid))")
sql.execute("CREATE INDEX IF NOT EXISTS track_index ON tracks(path)")
def do_factory(self, row):
return Track(row)

View File

@ -4,11 +4,6 @@
# +------ ---+-----------+------+------+
# | playlistid | plstateid | name | sort |
# +-------- -+-----------+------+------+
#
# Index: playlist_index
# +--------------------+
# | name -> playlistid |
# +--------------------+
from gi.repository import GObject
from . import playlist
from . import sql
@ -132,7 +127,6 @@ class UserTable(playlist.Model):
" FOREIGN KEY(playlistid) REFERENCES playlists(playlistid), "
" FOREIGN KEY(trackid) REFERENCES tracks(trackid), "
" UNIQUE(playlistid, trackid))")
sql.execute("CREATE INDEX IF NOT EXISTS playlist_index ON playlists(name)")
self.find("Collection", loop=True)
self.find("Favorites")