PAPER DIGEST
Most Influential SIGMOD 2005 Paper · 2026-03 edition

RankSQL: Query Algebra And Optimization For Relational Top-k Queries

Chengkai Li; Kevin Chen-Chuan Chang; Ihab F. Ilyas; Sumin Song

Venue
ACM SIGMOD Conference (SIGMOD) 2005
Recognition
Most Influential SIGMOD 2005 Paper (Rank No. 11)
Edition
2026-03
Impact factor
6
Certificate ID
2bd4418bb7042f91

Abstract

This paper introduces RankSQL, a system that provides a systematic and principled framework to support efficient evaluations of ranking (<i>top-k</i>) queries in relational database systems (RDBMS), by extending relational algebra and query optimization. Previously, <i>top-k</i> query processing is studied in the middleware scenario or in RDBMS in a "piecemeal" fashion, <i>i.e.,</i> focusing on specific operator or sitting outside the core of query engines. In contrast, we aim to support ranking as a first-class database construct. As a key insight, the new ranking relationship can be viewed as another logical property of data, parallel to the "membership" property of relational data model. While membership is essentially supported in RDBMS, the same support for ranking is clearly lacking. We address the fundamental integration of ranking in RDBMS in a way similar to how membership, <i>i.e.,</i> Boolean filtering, is supported. We extend relational algebra by proposing a <i>rank-relational</i> model to capture the ranking property, and introducing new and extended operators to support ranking as a first-class construct. Enabled by the extended algebra, we present a pipelined and incremental execution model of ranking query plans (that cannot be expressed traditionally) based on a fundamental <i>ranking principle.</i> To optimize <i>top-k</i> queries, we propose a dimensional enumeration algorithm to explore the extended plan space by enumerating plans along two dual dimensions: ranking and membership. We also propose a sampling-based method to estimate the cardinality of rank-aware operators, for costing plans. Our experiments show the validity of our framework and the accuracy of the proposed estimation model.

Download PDF certificate