Download presentation
Presentation is loading. Please wait.
Published byKelley Fleming Modified over 8 years ago
1
1 Chengkai Li Kevin-Chen-Chuan Chang Ihab Ilyas Sumin Song Presented by: Mariam John CSE 6392 03/20/2006 RankSQL: Query Algebra and Optimization for Relational Top- k Queries
2
2 Contents Introduction RankSQL Ranking Query Model Rank-Relational Algebra Ranking Query Plans:Execution Model Conclusion
3
3 Introduction Top-k queries provides only the top k query results according to a user-specified ranking function. Most of the available solutions are in the middleware, or focus on specific operators and queries. Top-k queries are not treated as first class query type in RDBMS. Relational algebra has no notion for ranking.
4
4 RankSQL Provides seamless support and integration of top-k queries with the existing SQL query facility in RDBMS. Supports ranking as a first-class database construct. Extends relational algebra and query optimization.
5
5 Example of a Top-k Query SELECT * FROM Hotel h, Restaurant r, Museum m WHERE c1 AND c2 AND c3 ORDER BY p1+p2+p3 LIMIT k c1: r.cuisine=Italian p1: cheap(h.price) c2: h.price+r.price<100 p2: close(h.addr,r.addr) c3: r.area=m.area p3: related(m.collection, “dinosaur ”)
6
6 Rank Query Model Rank relational query has 4 types of predicates: Filtering – Boolean-selection predicates Boolean-join predicates Ranking – rank-selection predicates rank-join predicates Goal is to support rank relational queries efficiently. Filtering Ranking
7
7 Rank-Relational Query Such queries add a ranking dimension to query processing and optimization. Filtering restricts tuple “membership” by applying a Boolean function of Boolean selection or join predicates. Ranking restricts “order” by applying a monotonic scoring function of ranking predicates.
8
8 Ranking as First-Class Construct Support for ranking as a first class construct in RDBMS is lacking. Relational algebra models Boolean filtering as a first class construct in query processing. c1 is a selection over R, and c2 is a join condition over R * S
9
9 Filtering as a First-Class Construct Algebra framework supports the following for Boolean filtering: - splitting - interleaving Enable query optimization to transform from canonical form to efficient query plans.
10
10 Ranking as First-Class Construct Algebraic support for optimization is lacking for ranking. The sorting operator is ‘monolithic’. It may be beneficial to evaluate ranking predicates one by one and interleave them with Boolean filtering.
11
11 Challenges First, we must extend relational algebra to do the following: Handle ranking Define algebraic laws to handle equivalence transformation Second, we need to generalize query optimization techniques to integrate the parallel dimensions of Boolean filtering and ranking.
12
12 Rank-Relational Algebra Rank-Relation is a relation with its tuples scored and ordered accordingly How do we rank a relation, given
13
13 Ranking principle Maximum possible score of a tuple t, denoted by, is defined as: = if = 1otherwise
14
14 Examples of Rank-Relations
15
15 Operators Need to extend relational-algebra operators for manipulating rank- relations. For supporting ranking as a first-class construct, define a new operator ‘μ’. This new ‘rank’ operator should satisfy the two requirements: splitting and interleaving.
16
16 New Operator, μ Extend relational algebra by adding a new rank operator, μ. What does mean? Extend the original semantics of existing operators with rank-awareness, enabling interaction with the new rank operator. Extend relational algebra such that it gives several equivalences relevant to ranking.
17
17 Results of Operators
18
18 Ranking Query Plans: Execution Model Extend the common execution model to handle rank query. Operators incrementally output rank relations. Query has an explicitly requested result size. Key capability of a rank-aware operator is to decide if enough information has been obtained from its input tuples in order to incrementally produce the next ranked output tuple.
19
19 Example
20
20 Conclusion RankSQL is a system that provides a systematic framework to support efficient evaluation of top-k queries in RDBMS. Extend relational algebra to make ranking a first-class construct. Query execution model is extended to handle ranking query. Rank-aware operators are selective and context-sensitive.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.