From e39b18f75120b3efa6b53e35868ab535a0bcd342 Mon Sep 17 00:00:00 2001 From: Drapersniper <27962761+drapersniper@users.noreply.github.com> Date: Thu, 19 Dec 2019 18:37:16 +0000 Subject: [PATCH] Create index Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> --- redbot/cogs/audio/playlists.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/redbot/cogs/audio/playlists.py b/redbot/cogs/audio/playlists.py index af3495cc6..2af3c902d 100644 --- a/redbot/cogs/audio/playlists.py +++ b/redbot/cogs/audio/playlists.py @@ -171,6 +171,9 @@ VALUES playlist_url = excluded.playlist_url, tracks = excluded.tracks; """ +_CREATE_INDEX = """ +CREATE INDEX IF NOT EXISTS name_index ON playlists (scope_type, playlist_id, playlist_name, scope_id); +""" @dataclass @@ -205,6 +208,7 @@ class Database: self.cursor.execute(_PRAGMA_UPDATE_journal_mode) self.cursor.execute(_PRAGMA_UPDATE_read_uncommitted) self.cursor.execute(_CREATE_TABLE) + self.cursor.execute(_CREATE_INDEX) def close(self): self._database.close()