Skip to content

Add Missing Database Indexes #13

@caleb-vanlue

Description

@caleb-vanlue

The database lacks indexes on frequently queried fields, causing slow queries that worsen as data volume grows. Queries filtering by userId combined with sort fields scan entire tables. Release searches by artist or year are inefficient. The lack of proper indexing leads to high database CPU usage and poor query performance at scale.

Add compound indexes for common query patterns: user_collection(userId, createdAt), user_wantlist(userId, createdAt), and release(primaryArtist, year). Create a full-text search index on release(title) for text searches. Analyze query execution plans before and after to verify improvements. Monitor index usage and query performance.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions