Scenario: A social media platform stores user posts, comments, and interactions in its database. Users frequently search for posts by keyword, user ID, or time period. How would you implement indexing to facilitate efficient searching in this scenario?

  • Avoid indexing for simplicity in data retrieval
  • Create a composite index on user ID and timestamp columns
  • Implement a clustered index on the post content column
  • Use a full-text search index for keyword searches, and create non-clustered indexes on user ID and timestamp columns
In this scenario, utilizing a full-text search index for keyword searches and creating non-clustered indexes on user ID and timestamp columns would facilitate efficient searching. Full-text search indexes are suitable for textual searches, and non-clustered indexes provide quick access to specific columns.
Add your answer
Loading...

Leave a comment

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