range query

A request for every item whose key lies between two bounds, such as all orders placed between 9:00 and 10:00.

In more detail

Range queries need sorted order: on a sorted list, two binary searches find the bounds in O(log n) and the results sit between them. A hash table has no notion of "between" and must scan all n items. Database indexes use B-trees largely for this reason.

Related terms

Taught in

References