Scenario: A large e-commerce website stores millions of product records in its database. Customers frequently search for products based on categories, brands, and price ranges. How would you design indexes to optimize search performance for this scenario?

  • Avoid indexing for better insert performance
  • Create composite indexes on category, brand, and price columns
  • Implement a full-text search index for keyword searches
  • Use a single index on the product ID column
In this scenario, creating composite indexes on the frequently searched columns like category, brand, and price would optimize search performance. Composite indexes cover multiple columns and are efficient for queries involving those columns.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *