Design a query-retrieval system
Start Timer
0:00:00
You are working on a Snowflake-like analytics platform that stores query history for enterprise customers. Product managers want a feature that lets users search past queries by text, filter by metadata, and retrieve the most relevant results quickly.
Design a query-retrieval system that supports the following requirements:
- Users can search by keywords appearing in the SQL text, for example
join,customer_id, ordate_trunc. - Users can filter by
user_id,warehouse_name,start_timeandend_time, andstatussuch asSUCCESS,FAILED, orCANCELLED. - Results should be ranked by relevance, with exact keyword matches ranked higher than partial matches.
- The system should return the top
kresults, sorted by relevance and then by most recent execution time. - The system must scale to billions of query records and support low-latency search.
.
.
.
.
.
.
.
.
.
Comments