-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Create database indexes to improve query performance for common operations.
Requirements:
- Add indexes to User model:
- Unique index on email
- Unique index on username
- Add indexes to Photo model:
- Index on userId
- Index on albumId
- Text index on title for search
- Add indexes to Album model:
- Index on userId
- Text index on title for search
- Compound indexes for common queries
- Migration script to create indexes
Acceptance Criteria:
- All necessary indexes created
- Unique constraints on email/username
- Text indexes for search functionality
- Compound indexes for filtered queries
- Index creation script
- Performance testing shows improvement
- Index usage verified with explain()
Implementation Notes:
// In Photo model
photoSchema.index({ userId: 1 })
photoSchema.index({ albumId: 1 })
photoSchema.index({ title: "text" })
photoSchema.index({ userId: 1, albumId: 1 }) // compoundMetadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request