Fagin, R., Lotem, A. and Naor, M. (2001). Optimal aggregation algorithms for middleware. In Proc. PODS 2001, pp. 102–113. DOI 10.1145/375551.375567. Journal version: Journal of Computer and System Sciences 66(4), 614–656 (2003), DOI 10.1016/S0022-0000(03)00026-6
Key takeaways
Read in full (NOTE-924). Given m lists of the same N objects, each sorted by one attribute’s grade, and a monotone function combining the grades, the threshold algorithm (TA) reads the lists in parallel, random-accesses each newly seen object’s other grades, and stops once k seen objects score at least the combined score of the last grades read. It is correct for every monotone combining function, needs constant buffers, and is instance optimal among correct algorithms that make no “wild guesses”: on every database its cost is within a constant factor of any such algorithm’s, the factor being m + m(m−1)c_R/c_S, which is best possible when the combining function is strict (conjunction-like). Without the no-wild-guesses restriction no algorithm is instance optimal, and the counterexample is a two-list conjunction whose target sits in the middle of both lists, which any algorithm must search linearly. Fagin’s Algorithm’s sublinear cost O(N^((m−1)/m) k^(1/m)) is cited from Fagin, not proved here, and holds only when the lists’ orderings are probabilistically independent. The model prices queries over a given set of single-attribute sorted lists. It does not price building or keeping the lists, choosing an arrangement, or any computation beyond accesses.
Why this is here
CLAIM-310 and THEORY-358 (Treisman and Gelade): the Threshold Algorithm finds the best objects under a monotone combined score from lists each sorted by one feature, and is instance-optimal against algorithms that make no wild guesses. A conjunctive query’s cost depends on how the features co-occur, from about k accesses to about half the collection when they are anti-correlated, as in Treisman’s conjunction displays. Read from the authors’ full version.