Skip to content

perf: add compound product indexes - #958

Open
priyansh0602 wants to merge 3 commits into
parthbuilds-community:mainfrom
priyansh0602:perf/product-compound-indexes
Open

perf: add compound product indexes#958
priyansh0602 wants to merge 3 commits into
parthbuilds-community:mainfrom
priyansh0602:perf/product-compound-indexes

Conversation

@priyansh0602

Copy link
Copy Markdown
Contributor

📋 What does this PR do?

Adds compound MongoDB indexes to the Product schema to improve frequent product queries that filter by category and sort/filter by price or rating.

Added:

  • { category: 1, price: 1 }
  • { category: 1, rating: -1 }

Existing indexes were left unchanged.

🔗 Related Issue

Closes #955

🧪 How was this tested?

Ran the server test suite locally with:

npm test

Result:

  • 3 test suites passed
  • 78 tests passed
  • 0 tests failed

📸 Screenshots (if UI changes)

N/A — no UI changes.

✅ Checklist

  • I've read the CONTRIBUTING guide
  • My code follows the project's style guidelines
  • I've tested my changes locally
  • I've linked the related issue
  • I haven't introduced any new secrets or API keys

@github-actions github-actions Bot added enhancement New feature or request refactor Improve code without changing functionality backend labels Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend devops enhancement New feature or request refactor Improve code without changing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Performance: Add Compound Indexes for frequent Product queries

1 participant