主权项 |
1. A method for scheduling queries, comprising:
assigning scheduling priorities to a plurality of queries the scheduling priorities to place the queries in an order inverse to the respective query execution times of the respective queries, the queries submitted by users ranked in a hierarchy; weighting, via a logic circuit, the previously assigned scheduling priorities according to the ranks of the users in the hierarchy to generate weighted scheduling priorities; sorting a list of the queries in order based on the weighted scheduling priorities to incorporate both the ranks of the users and the query execution times of the respective queries in the sorted list; selecting a first query for execution from a head of the sorted list of queries; executing the first query to completion without preemption by other queries from the sorted list; and executing a stream of queries from the sorted list, wherein weighting the scheduling priorities comprises computing a weight wi for each query, qi, in the queries as wi=(SLi)/pi, where SLi is a service level associated with the rank in the hierarchy of the user corresponding to the query qi, and pi is the execution time of the corresponding query qi. |