perf: remove PostgreSQL covering index idx_torrents_covering for torrents table

This commit is contained in:
g0ldyy
2026-01-05 16:43:11 +01:00
parent 3ef2d3454b
commit 4f0be0a786
-10
View File
@@ -512,16 +512,6 @@ async def setup_database():
"""
)
if settings.DATABASE_TYPE == "postgresql":
# Covering index for get_cached_torrents
await database.execute(
"""
CREATE INDEX IF NOT EXISTS idx_torrents_covering
ON torrents (media_id, season, episode)
INCLUDE (info_hash, file_index, title, seeders, size, tracker, sources, parsed, timestamp)
"""
)
if settings.DATABASE_TYPE == "sqlite":
await database.execute("PRAGMA busy_timeout=30000") # 30 seconds timeout
await database.execute("PRAGMA journal_mode=WAL")