主权项 |
1. A method for automating a retrieval of partitionable search results from a database, and reducing latency of delivering the partitionable search results, the method comprising:
receiving a search request from a client, the search request comprising at least one query for searching the database, wherein the database is configured to provide a plurality of partitions of a set of search results responsive to the at least one query, wherein the set of search results contain all search results from the database that are responsive to the at least one query; partitioning the set of search results into the plurality of partitions of the set of search results after the search request comprising the at least one query is received from the client and after submitting an initial request to the database, wherein each partition from the plurality of partitions of the set of search results contains a fraction of the set of search results responsive to the at least one query; allocating a set of processing threads for a set of processing tasks, each task being: assigned to retrieve a subset of search results from the set of search results, and configured to execute in parallel with other processing tasks in the set of processing tasks, wherein each subset of search results is one of the partitions from the plurality of partitions of the set of search results; and executing the set of processing tasks, the step of executing comprising, for each processing task of the set of processing tasks:
submitting at least one request to the database to retrieve the assigned subset of search results,receiving a response from the database, the response from the database comprising the assigned subset of search results,creating a response message for the client based on the response from the database, andsending the response message to the client, wherein the set of processing tasks execute in parallel and continuously send response messages to the client until all search results responsive to the at least one query have been retrieved from the database and sent to the client resulting in the plurality of partitions of the set of search results responsive to the at least one query being sent to the client. |