Successfully reported this slideshow.
Upcoming SlideShare
×

# The skyline operator lee, woonghee

997 views

Published on

For my first paper review at my lab seminar, this paper is dedicated by Borzsonyi, S., Kossmann, D., and Stocker, K. I made the PPT file to present in front of my colleague students and my professor. This paper is good to study not only algorithm(divide and conquer) but also mathematical aspect of database of linear algebraic methods.

Published in: Data & Analytics
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

### The skyline operator lee, woonghee

1. 1. The Skyline Operator Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Lee, Woonghee M.S. student at the Big Data Mining Lab. Department of computer science and engineering at the Hanyang University July 24th - August 07th, 2015
2. 2. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Contents β Introduction: What is the Skyline? β SQLβs Extensions β Implementation β’ Two dimensional dddddddd β’ Block-nested-loops algorithm β’ Divide-and-conquer algorithm ο¬ Experiments and results
3. 3. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Introduction ο¬ Holiday to Nassau (Bahamas) ο¬ To look for a hotel cheap and close to the beach ο¬ Two goals(distance, price) are complementary as the hotels near the beach tend to be more expensive
4. 4. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Introduction: Definition of the Skyline ο¬ Interesting hotels are not worse than any other hotels. ο¬ The set of interesting hotels are the Skyline.
5. 5. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Introduction: Definition of the Skyline ο¬ Interesting hotels are not worse than any other hotels. ο¬ The set of interesting hotels are the Skyline. A This set is dominated by A ex) Hotel A <\$80, 0.7 miles> dominates Hotel B <\$120, 1.0 miles> B
6. 6. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Introduction: Definition of the Skyline β’ Definition of the Skyline πΏππ‘ π£πππ‘πππ  βπ, βπ β π π ππ βπ =< π₯π1, β¦ , π₯ππ >, βπ =< π₯π1, β¦ , π₯ππ >. πΌπ πππ π₯ππ πππ πππ‘π‘ππ π‘βππ πππ πππ’ππ π‘π π₯ππ, πππ ππ‘ ππππ π‘ πππ π₯ππ ππ  πππ‘π‘ππ π‘βππ π₯ππ, βπ β» βπ
7. 7. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Introduction: Applied the Skyline ο¬ To propose interesting hotels ο¬ To find good salesperson which have low salary ο¬ To derive database visualization
8. 8. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. SQLβs Extensions ο¬ To propose to extend SQLβs SELECT statement by an optional SKYLINE OF clause
9. 9. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. SQLβs Extensions ο¬ Ex) The price of a hotel should be minimized The rating should be maximized dimension of the Skyline To specify whether the value in each dimension should be minimized, maximized or be different
10. 10. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. SQLβs Extensions: SKYLINE OF clause ο¬ Tuple π = (π1, β¦ , π π, π π+1, β¦ , ππ, ππ+1, β¦ , π π, π π+1, β¦ , π π)dominates tuple q = (π1, β¦ , π π, π π+1, β¦ , ππ, ππ+1, β¦ , π π, π π+1, β¦ , π π)for a Skyline query SKYLINE OF π1MIN, β¦, π πMIN, π π+1MAX, β¦, ππMAX, ππ+1DIFF, β¦, π πDIFF if the following three conditions hold: ππ β€ ππ πππ πππ π = 1, β¦ , π ππ β₯ ππ πππ πππ π = π + 1 , β¦ , π ππ = ππ πππ πππ π = (π + 1), β¦ , π
11. 11. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. SQLβs Extensions: SKYLINE OF clause ο¬ If two tuples have the same values for all attributes and are not dominated, both are part of the result (if no distinct). ο¬ A one dimensional Skyline is equivalent a min, max, or distinct SQL query. ο¬ Dominance is a transitive relation; if π dominates π and π dominates π, then π dominates π.
12. 12. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. SQLβs Extensions: Example Skyline Queries
13. 13. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation of the Skyline Operation ο¬ Nested SQL query ο¬ Two dimensional sorting ο¬ Three variants based on a block-nested-loops algorithm ο¬ Three variants based on divide-and-conquer
14. 14. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: Nested SQL query Same with the SKYLINE OF clause but poor performance
15. 15. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: Nested SQL query The reasons why this approach shows very poor performance: ο¬ This query cannot be unnested. ο¬ If this query involves a ππππ or ππππ’π ππ¦, the ππππ or ππππ’π ππ¦ might execute as the outer query and as the subquery. ο¬ Combining with other operations (e.g., ππππ or πππ π) might cause additional cost to compute the Skyline.
16. 16. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: Two Dimensional ο¬ A one-dimensional Skyline is equivalent to computing the πππ, πππ₯, or πππ π‘ππππ‘. ο¬ Computing two-dimensional Skyline is also easy by sorting the data (It just needs to compare with the last previous tuple).
17. 17. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. ο¬ A one-dimensional Skyline is equivalent to computing the πππ, πππ₯, or πππ π‘ππππ‘. ο¬ Computing two-dimensional Skyline is also easy by sorting the data (It just needs to compare with the last previous tuple). Implementation: Two Dimensional Skyline
18. 18. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. ο¬ Definition the Skyline at 2-dimensional πΏππ‘ π΄, π΅ ππ π£πππ‘πππ  ππ π2, πππ π΄π =< π₯π, π¦π >, π΅π =< π₯π, π¦π > πππ πππ π, π. π΄ β π΅ π€βππ π₯π < π₯π πππ π¦π β€ π¦π ππ π₯π β€ π₯π πππ π¦π < π¦π ππ π₯π < π₯π πππ π¦π < π¦π. Implementation: Two Dimensional
19. 19. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. i j k dominate no dominate ο¬ To prove 2-dimensional Skyline Algorithm ππππππ π 1: π < π, βπ β β π. ππππππ π 2: βπ β» βπ. ππππππ π 3: π < π, πππ πππ β π, β π, π₯ π < π₯ π. ππππππ ππ‘πππ: β π < π, β π β» βπ. Implementation: Two Dimensional
20. 20. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. ο¬ To prove 2-dimensional Skyline Algorithm πΏππ‘ πππβ π£πππ‘πππ  ππππ ππ π‘ ππ πππππππ‘π  < π₯, π¦ >. πππππππππ¦ ππππππ π 2, πππ πππ βπ, βπ β π¦π > π¦π β΅ 2 β π· πππ¦ππππ πππππππ‘πππ πππ ππππππ π 3 . πΏππ‘ π’π  ππππ ππ‘ ππ  ππππππ π 4. Implementation: Two Dimensional
21. 21. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. ο¬ To prove 2-dimensional Skyline Algorithm πΏππ‘ ππ π π’ππ β π β βπ, π. π. , π¦ π β€ π¦π. π΅ππππ’π π ππ π₯ π < π₯π(β΅ Implementation: Two Dimensional
22. 22. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: Two Dimensional ο¬ However, more than two-dimensions does not work to get the Skyline by sorting the data. β1 is not β3βs direct predecessor. rating (star)
23. 23. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Basic Block-nested-loops Algorithm Idea β’ reads repeatedly the set of tuples like the naive nested- loops algorithm. β’ keeps a π€πππππ€ of incomparable tuples in main memory. 1. BNL-basic 2. BNL-sol 3. BNL-solrep
24. 24. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Basic Block-nested-loops Algorithm Steps: 1. A tuple π is read from the input. 2. π is compared to all tuples of the π€πππππ€. 3. Based on step 2, π is either eliminated, placed into the π€πππππ€ or into a π‘ππππππππ¦ ππππ. 1. BNL-basic 2. BNL-sol 3. BNL-solrep
25. 25. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Basic Block-nested-loops Algorithm β’ After an iteration, three cases can occur: 1. π is dominated by a tuple within the π€πππππ€. 2. π dominates one or more tuples in the π€πππππ€. 3. π is incomparable with all tuples in the π€πππππ€. Complexity: The best case is O(π). The worst case is π(π2 ). 1. BNL-basic 2. BNL-sol 3. BNL-solrep
26. 26. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Demonstration BNL-basic1. BNL-basic 2. BNL-sol 3. BNL-solrep <h1, \$50, 0.9 miles> <h2, \$50, 1.0 miles> <h3, \$55, 1.0 miles> <h4, \$52, 0.7 miles> <h5, \$49, 1.0 miles> <h6, \$51, 0.7 miles> Data set Window Temporary file β¦
27. 27. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Demonstration BNL-basic1. BNL-basic 2. BNL-sol 3. BNL-solrep <h1, \$50, 0.9 miles> t = 1 <h1, \$50, 0.9 miles> <h2, \$50, 1.0 miles> <h3, \$55, 1.0 miles> <h4, \$52, 0.7 miles> <h5, \$49, 1.0 miles> <h6, \$51, 0.7 miles> Data set Window Temporary file time stamp t to do not compare two tuples are never compared twice β¦
28. 28. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Demonstration BNL-basic1. BNL-basic 2. BNL-sol 3. BNL-solrep <h1, \$50, 0.9 miles> t = 1 <h1, \$50, 0.9 miles> <h2, \$50, 1.0 miles> <h3, \$55, 1.0 miles> <h4, \$52, 0.7 miles> <h5, \$49, 1.0 miles> <h6, \$51, 0.7 miles> Data set Window Temporary file compare β¦
29. 29. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Demonstration BNL-basic1. BNL-basic 2. BNL-sol 3. BNL-solrep <h1, \$50, 0.9 miles> t = 1 <h1, \$50, 0.9 miles> <h2, \$50, 1.0 miles> <h3, \$55, 1.0 miles> <h4, \$52, 0.7 miles> <h5, \$49, 1.0 miles> <h6, \$51, 0.7 miles> Data set Window Temporary file dominated β¦
30. 30. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Demonstration BNL-basic1. BNL-basic 2. BNL-sol 3. BNL-solrep <h1, \$50, 0.9 miles> t = 1 <h1, \$50, 0.9 miles> <h2, \$50, 1.0 miles> <h3, \$55, 1.0 miles> <h4, \$52, 0.7 miles> <h5, \$49, 1.0 miles> <h6, \$51, 0.7 miles> Data set Window Temporary file dominated β¦
31. 31. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Demonstration BNL-basic1. BNL-basic 2. BNL-sol 3. BNL-solrep <h1, \$50, 0.9 miles> t = 1 <h1, \$50, 0.9 miles> <h2, \$50, 1.0 miles> <h3, \$55, 1.0 miles> <h4, \$52, 0.7 miles> <h5, \$49, 1.0 miles> <h6, \$51, 0.7 miles> Data set Window Temporary file incomparable β¦
32. 32. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Demonstration BNL-basic1. BNL-basic 2. BNL-sol 3. BNL-solrep <h1, \$50, 0.9 miles> t = 1 <h4, \$52, 0.7 miles> t = 2<h1, \$50, 0.9 miles> <h2, \$50, 1.0 miles> <h3, \$55, 1.0 miles> <h4, \$52, 0.7 miles> <h5, \$49, 1.0 miles> <h6, \$51, 0.7 miles> Data set Window Temporary file incomparable β¦
33. 33. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Demonstration BNL-basic1. BNL-basic 2. BNL-sol 3. BNL-solrep <h1, \$50, 0.9 miles> t = 1 <h4, \$52, 0.7 miles> t = 2<h1, \$50, 0.9 miles> <h2, \$50, 1.0 miles> <h3, \$55, 1.0 miles> <h4, \$52, 0.7 miles> <h5, \$49, 1.0 miles> <h6, \$51, 0.7 miles> Data set Window Temporary file incomparable β¦
34. 34. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Demonstration BNL-basic1. BNL-basic 2. BNL-sol 3. BNL-solrep <h1, \$50, 0.9 miles> t = 1 <h4, \$52, 0.7 miles> t = 2<h1, \$50, 0.9 miles> <h2, \$50, 1.0 miles> <h3, \$55, 1.0 miles> <h4, \$52, 0.7 miles> <h5, \$49, 1.0 miles> <h6, \$51, 0.7 miles> <h5, \$49, 1.0 miles> t = 3 Data set Window Temporary file β¦
35. 35. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Demonstration BNL-basic1. BNL-basic 2. BNL-sol 3. BNL-solrep <h1, \$50, 0.9 miles> t = 1 <h4, \$52, 0.7 miles> t = 2<h1, \$50, 0.9 miles> <h2, \$50, 1.0 miles> <h3, \$55, 1.0 miles> <h4, \$52, 0.7 miles> <h5, \$49, 1.0 miles> <h6, \$51, 0.7 miles> <h5, \$49, 1.0 miles> t = 3 Data set Window Temporary file compare dominated β¦
36. 36. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Demonstration BNL-basic1. BNL-basic 2. BNL-sol 3. BNL-solrep <h1, \$50, 0.9 miles> t = 1 <h4, \$52, 0.7 miles> t = 2<h1, \$50, 0.9 miles> <h2, \$50, 1.0 miles> <h3, \$55, 1.0 miles> <h4, \$52, 0.7 miles> <h5, \$49, 1.0 miles> <h6, \$51, 0.7 miles> <h5, \$49, 1.0 miles> t = 3 Data set Window Temporary file removed β¦
37. 37. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Demonstration BNL-basic1. BNL-basic 2. BNL-sol 3. BNL-solrep <h1, \$50, 0.9 miles> t = 1 <h6, \$51, 0.7 miles> t = 4<h1, \$50, 0.9 miles> <h2, \$50, 1.0 miles> <h3, \$55, 1.0 miles> <h4, \$52, 0.7 miles> <h5, \$49, 1.0 miles> <h6, \$51, 0.7 miles> <h5, \$49, 1.0 miles> t = 3 Data set Window Temporary file replace β¦
38. 38. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Demonstration BNL-basic1. BNL-basic 2. BNL-sol 3. BNL-solrep <h1, \$50, 0.9 miles> t = 1 <h6, \$51, 0.7 miles> t = 4<h1, \$50, 0.9 miles> <h2, \$50, 1.0 miles> <h3, \$55, 1.0 miles> <h4, \$52, 0.7 miles> <h5, \$49, 1.0 miles> <h6, \$51, 0.7 miles> <h5, \$49, 1.0 miles> t = 3 β¦ Data set Window Temporary file output window at the end of the iteration β¦ iterate until EOF
39. 39. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Demonstration BNL-basic1. BNL-basic 2. BNL-sol 3. BNL-solrep <h1, \$50, 0.9 miles> <h2, \$50, 1.0 miles> <h3, \$55, 1.0 miles> <h4, \$52, 0.7 miles> <h5, \$49, 1.0 miles> <h6, \$51, 0.7 miles> <h5, \$49, 1.0 miles> t = 3 β¦ Data set Window Temporary file next iteration β¦
40. 40. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Basic Block-nested-loops Algorithm β’ It works well if the Skyline fits into the window. β’ The best case complexity is π(π). β’ The worst case complexity is π(π2). β’ It is better I/O behavior than the naive nested-loops algorithm(Haas, Carey, Livny and Shukla 1997). 1. BNL-basic 2. BNL-sol 3. BNL-solrep
41. 41. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Maintaining the Window as a Self-organizing List β’ To speed up comparison a tuple in the window β’ To move up a tuple in the window which dominates another tuple in input 1. BNL-basic 2. BNL-sol 3. BNL-solrep β¦ <h2, \$50, 0.8 miles> t = 2 <h5, \$49, 1.0 miles> t = 3 Window β¦ <h7, \$49, 1.2 miles> β¦ Data set dominates move up to the first line of the window
42. 42. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Maintaining the Window as a Self-organizing List β’ Attractive if the data is skewed (i.e. better performance if there are a couple of ππππππ tuples which dominate many other tuples, and better performance if there are many πππ’π‘πππ tuples in the Skyline.) 1. BNL-basic 2. BNL-sol 3. BNL-solrep killer tuple dominated by killer tuple neutral tuples neutral tuples
43. 43. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Replacing Tuples in the Window1. BNL-basic 2. BNL-sol 3. BNL-solrep <h1, \$50, 1.0 miles> t = 1 <h2, \$59, 0.9 miles> t = 2 Window β¦ <h3, \$60, 0.1 miles> β¦ Data set incomparable no memory
44. 44. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Replacing Tuples in the Window1. BNL-basic 2. BNL-sol 3. BNL-solrep <h1, \$50, 1.0 miles> t = 1 <h2, \$59, 0.9 miles> t = 2 Window β¦ <h3, \$60, 0.1 miles> β¦ Data set replacing 0 0.2 0.4 0.6 0.8 1 1.2 48 50 52 54 56 58 60 62 h1 h2 h3
45. 45. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Replacing Tuples in the Window1. BNL-basic 2. BNL-sol 3. BNL-solrep <h1, \$50, 1.0 miles> t = 1 <h3, \$60, 0.1 miles> t = 3 Window β¦ <h3, \$60, 0.1 miles> β¦ Data set replacing 0 0.2 0.4 0.6 0.8 1 1.2 48 50 52 54 56 58 60 62 h1 h2 h3
46. 46. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: BNL Algorithms Replacing Tuples in the Window β’ Replacing when new tuple can dominate more tuples β’ Many replacement policies; πππππ β πππ π‘ππππ β’ Additional CPU cost needed β’ Two tuples in the temporary file might be compared twice. 1. BNL-basic 2. BNL-sol 3. BNL-solrep <h1, \$50, 1.0 miles> t = 1 <h3, \$60, 0.1 miles> t = 3 Window β¦ <h3, \$60, 0.1 miles> β¦ Data set
47. 47. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm The worst case and best case complexity is π π β log π πβ2 + π(π β log π) where π is the number of input tuples and π is the number of dimensions (Kung, Luccio and Preparata 1975). (unlikely for the BNL, the best case is O π and the worst case is O(π2 )) 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk
48. 48. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm Basic Divide and Conquer Algorithm Steps: 1. Compute the approximate median π π of the input for some dimension π π. Divide the input two partitions by π π. 2. Compute the Skyline π1 of π1 and π2 of π2. π1 and π2 are recursively partitioned until a partition has one or few tuples. Then computing the Skyline is trivial. 3. Compute the overall Skyline as merging π1 and π2. 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk
49. 49. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm Basic Divide and Conquer Algorithm Steps: At the step 3, partition both π1 and π2 by approximate median π π for dimension π π(β  π π). Then we obtain partition π1,1, π1,2, π2,1 and π2,2 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk
50. 50. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm Pseudo-code1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π΄: input of the Skyline operation; a set of π- dimensional points πΉ: output of the Skyline operation; a set of π- dimensional points π βΊ π: point π is dominated by point π function SkylineBasic M, Dimension begin if π = 1 then return π πππ£ππ‘ β Median π π·πππππ πππ π β π π1, π2 β Partition π, π·πππππ πππ, πππ£ππ‘ π1 β SkylineBasic(π1, π·πππππ πππ) π2 β SkylineBasic π2, π·πππππ πππ return π1 β MergeBasic(π1, π2, π·πππππ πππ) end function MergeBasic(π1, π2, π·πππππ πππ) begin if π1 = {π} then π β π β π2 π β» π else if π2 = π then begin for each π β π1 do if π βΊ π then π β π end else if π·πππππ πππ = 2 then begin πππ β Minimum{π1|π β π1} π β π β π2 π1 < πππ end else begin πππ£ππ‘ β Median π π·πππππ πππβ1 π β π1 π1,1, π1,2 β Partition π1, π·πππππ πππ β 1, πππ£ππ‘ π2,1, π2,2 β Partition π2, π·πππππ πππ β 1, πππ£ππ‘ π1 β MergeBasic π1,1, π2,1, π·πππππ πππ π2 β MergeBasic π1,2, π2,2, π·πππππ πππ π3 β MergeBasic π1,1, π2, π·πππππ πππ β 1 π β π1 βͺ π3 end return R end See also Preparata et al. (1993), Computational Geometry, pp. 161-164, Springer.
51. 51. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm At the merge basic function:1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π1,1 π1,2 π2,1 π2,2 ππππππ π ππππππ π
52. 52. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm At the merge basic function:1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π1,1 π1,2 π2,1 π2,2 ππππππ π ππππππ π
53. 53. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm At the merge basic function:1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π1,1 π1,2 π2,1 π2,2 ππππππ π ππππππ π
54. 54. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm At the merge basic function:1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π1,1 π1,2 π2,1 π2,2 ππππππ π ππππππ π
55. 55. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm Pseudo-code1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π΄: input of the Skyline operation; a set of π-dimensional points πΉ: output of the Skyline operation; a set of π-dimensional points π βΊ π: point π is dominated by point π function SkylineBasic M, Dimension begin if π = 1 then return π πππ£ππ‘ β Median π π·πππππ πππ π β π π1, π2 β Partition π, π·πππππ πππ, πππ£ππ‘ π1 β SkylineBasic(π1, π·πππππ πππ) π2 β SkylineBasic π2, π·πππππ πππ return π1 β MergeBasic(π1, π2, π·πππππ πππ) end function MergeBasic(π1, π2, π·πππππ πππ) begin if π1 = {π} then π β π β π2 π β» π else if π2 = π then begin for each π β π1 do if π βΊ π then π β π end else if π·πππππ πππ = 2 then begin πππ β Minimum{π1|π β π1} π β π β π2 π1 < πππ end else begin πππ£ππ‘ β Median π π·πππππ πππβ1 π β π1 π1,1, π1,2 β Partition π1, π·πππππ πππ β 1, πππ£ππ‘ π2,1, π2,2 β Partition π2, π·πππππ πππ β 1, πππ£ππ‘ π1 β MergeBasic π1,1, π2,1, π·πππππ πππ π2 β MergeBasic π1,2, π2,2, π·πππππ πππ π3 β MergeBasic π1,1, π2, π·πππππ πππ β 1 π β π1 βͺ π3 end return R end See also Preparata et al. (1993), Computational Geometry, pp. 161-164, Springer.
56. 56. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm Pseudo-code1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π΄: input of the Skyline operation; a set of π-dimensional points πΉ: output of the Skyline operation; a set of π-dimensional points π βΊ π: point π is dominated by point π function SkylineBasic M, Dimension begin if π = 1 then return π πππ£ππ‘ β Median π π·πππππ πππ π β π π1, π2 β Partition π, π·πππππ πππ, πππ£ππ‘ π1 β SkylineBasic(π1, π·πππππ πππ) π2 β SkylineBasic π2, π·πππππ πππ return π1 β MergeBasic(π1, π2, π·πππππ πππ) end
57. 57. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm Pseudo-code1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π΄: input of the Skyline operation; a set of π-dimensional points πΉ: output of the Skyline operation; a set of π-dimensional points π βΊ π: point π is dominated by point π function SkylineBasic M, Dimension begin if π = 1 then return π πππ£ππ‘ β Median π π·πππππ πππ π β π π1, π2 β Partition π, π·πππππ πππ, πππ£ππ‘ π1 β SkylineBasic(π1, π·πππππ πππ) π2 β SkylineBasic π2, π·πππππ πππ return π1 β MergeBasic(π1, π2, π·πππππ πππ) end
58. 58. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm Pseudo-code1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π΄: input of the Skyline operation; a set of π-dimensional points πΉ: output of the Skyline operation; a set of π-dimensional points π βΊ π: point π is dominated by point π function SkylineBasic M, Dimension begin if π = 1 then return π πππ£ππ‘ β Median π π·πππππ πππ π β π π1, π2 β Partition π, π·πππππ πππ, πππ£ππ‘ π1 β SkylineBasic(π1, π·πππππ πππ) π2 β SkylineBasic π2, π·πππππ πππ return π1 β MergeBasic(π1, π2, π·πππππ πππ) end
59. 59. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm Pseudo-code1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π΄: input of the Skyline operation; a set of π-dimensional points πΉ: output of the Skyline operation; a set of π-dimensional points π βΊ π: point π is dominated by point π function SkylineBasic M, Dimension begin if π = 1 then return π πππ£ππ‘ β Median π π·πππππ πππ π β π π1, π2 β Partition π, π·πππππ πππ, πππ£ππ‘ π1 β SkylineBasic(π1, π·πππππ πππ) π2 β SkylineBasic π2, π·πππππ πππ return π1 β MergeBasic(π1, π2, π·πππππ πππ) end
60. 60. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm Pseudo-code1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π΄: input of the Skyline operation; a set of π-dimensional points πΉ: output of the Skyline operation; a set of π-dimensional points π βΊ π: point π is dominated by point π function SkylineBasic M, Dimension begin if π = 1 then return π πππ£ππ‘ β Median π π·πππππ πππ π β π π1, π2 β Partition π, π·πππππ πππ, πππ£ππ‘ π1 β SkylineBasic(π1, π·πππππ πππ) π2 β SkylineBasic π2, π·πππππ πππ return π1 β MergeBasic(π1, π2, π·πππππ πππ) end
61. 61. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm Pseudo-code1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π΄: input of the Skyline operation; a set of π-dimensional points πΉ: output of the Skyline operation; a set of π-dimensional points π βΊ π: point π is dominated by point π function SkylineBasic M, Dimension begin if π = 1 then return π πππ£ππ‘ β Median π π·πππππ πππ π β π π1, π2 β Partition π, π·πππππ πππ, πππ£ππ‘ π1 β SkylineBasic(π1, π·πππππ πππ) π2 β SkylineBasic π2, π·πππππ πππ return π1 β MergeBasic(π1, π2, π·πππππ πππ) end
62. 62. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm Pseudo-code1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π΄: input of the Skyline operation; a set of π-dimensional points πΉ: output of the Skyline operation; a set of π-dimensional points π βΊ π: point π is dominated by point π function SkylineBasic M, Dimension begin if π = 1 then return π πππ£ππ‘ β Median π π·πππππ πππ π β π π1, π2 β Partition π, π·πππππ πππ, πππ£ππ‘ π1 β SkylineBasic(π1, π·πππππ πππ) π2 β SkylineBasic π2, π·πππππ πππ return π1 β MergeBasic(π1, π2, π·πππππ πππ) end
63. 63. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm Pseudo-code1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π΄: input of the Skyline operation; a set of π-dimensional points πΉ: output of the Skyline operation; a set of π-dimensional points π βΊ π: point π is dominated by point π function SkylineBasic M, Dimension begin if π = 1 then return π πππ£ππ‘ β Median π π·πππππ πππ π β π π1, π2 β Partition π, π·πππππ πππ, πππ£ππ‘ π1 β SkylineBasic(π1, π·πππππ πππ) π2 β SkylineBasic π2, π·πππππ πππ return π1 β MergeBasic(π1, π2, π·πππππ πππ) end
64. 64. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk function MergeBasic(π1, π2, π·πππππ πππ) begin if π1 = {π} then π β π β π2 π β» π else if π2 = π then begin for each π β π1 do if π βΊ π then π β π end else if π·πππππ πππ = 2 then begin πππ β Minimum{π1|π β π1} π β π β π2 π1 < πππ end else begin πππ£ππ‘ β Median π π·πππππ πππβ1 π β π1 π1,1, π1,2 β Partition π1, π·πππππ πππ β 1, πππ£ππ‘ π2,1, π2,2 β Partition π2, π·πππππ πππ β 1, πππ£ππ‘ π1 β MergeBasic π1,1, π2,1, π·πππππ πππ π2 β MergeBasic π1,2, π2,2, π·πππππ πππ π3 β MergeBasic π1,1, π2, π·πππππ πππ β 1 π β π1 βͺ π3 end return R end See also Preparata et al. (1993), Computational Geometry, pp. 161-164, Springer.
65. 65. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk function MergeBasic(π1, π2, π·πππππ πππ) begin if π1 = {π} then π β π β π2 π β» π else if π2 = π then begin for each π β π1 do if π βΊ π then π β π end else if π·πππππ πππ = 2 then begin πππ β Minimum{π1|π β π1} π β π β π2 π1 < πππ end else begin πππ£ππ‘ β Median π π·πππππ πππβ1 π β π1 π1,1, π1,2 β Partition π1, π·πππππ πππ β 1, πππ£ππ‘ π2,1, π2,2 β Partition π2, π·πππππ πππ β 1, πππ£ππ‘ π1 β MergeBasic π1,1, π2,1, π·πππππ πππ π2 β MergeBasic π1,2, π2,2, π·πππππ πππ π3 β MergeBasic π1,1, π2, π·πππππ πππ β 1 π β π1 βͺ π3 end return R end See also Preparata et al. (1993), Computational Geometry, pp. 161-164, Springer.
66. 66. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk function MergeBasic(π1, π2, π·πππππ πππ) begin if π1 = {π} then π β π β π2 π β» π else if π2 = π then begin for each π β π1 do if π βΊ π then π β π end else if π·πππππ πππ = 2 then begin πππ β Minimum{π1|π β π1} π β π β π2 π1 < πππ end else begin πππ£ππ‘ β Median π π·πππππ πππβ1 π β π1 π1,1, π1,2 β Partition π1, π·πππππ πππ β 1, πππ£ππ‘ π2,1, π2,2 β Partition π2, π·πππππ πππ β 1, πππ£ππ‘ π1 β MergeBasic π1,1, π2,1, π·πππππ πππ π2 β MergeBasic π1,2, π2,2, π·πππππ πππ π3 β MergeBasic π1,1, π2, π·πππππ πππ β 1 π β π1 βͺ π3 end return R end See also Preparata et al. (1993), Computational Geometry, pp. 161-164, Springer.
67. 67. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk function MergeBasic(π1, π2, π·πππππ πππ) begin if π1 = {π} then π β π β π2 π β» π else if π2 = π then begin for each π β π1 do if π βΊ π then π β π end else if π·πππππ πππ = 2 then begin πππ β Minimum{π1|π β π1} π β π β π2 π1 < πππ end else begin πππ£ππ‘ β Median π π·πππππ πππβ1 π β π1 π1,1, π1,2 β Partition π1, π·πππππ πππ β 1, πππ£ππ‘ π2,1, π2,2 β Partition π2, π·πππππ πππ β 1, πππ£ππ‘ π1 β MergeBasic π1,1, π2,1, π·πππππ πππ π2 β MergeBasic π1,2, π2,2, π·πππππ πππ π3 β MergeBasic π1,1, π2, π·πππππ πππ β 1 π β π1 βͺ π3 end return R end See also Preparata et al. (1993), Computational Geometry, pp. 161-164, Springer.
68. 68. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk function MergeBasic(π1, π2, π·πππππ πππ) begin if π1 = {π} then π β π β π2 π β» π else if π2 = π then begin for each π β π1 do if π βΊ π then π β π end else if π·πππππ πππ = 2 then begin πππ β Minimum{π1|π β π1} π β π β π2 π1 < πππ end else begin πππ£ππ‘ β Median π π·πππππ πππβ1 π β π1 π1,1, π1,2 β Partition π1, π·πππππ πππ β 1, πππ£ππ‘ π2,1, π2,2 β Partition π2, π·πππππ πππ β 1, πππ£ππ‘ π1 β MergeBasic π1,1, π2,1, π·πππππ πππ π2 β MergeBasic π1,2, π2,2, π·πππππ πππ π3 β MergeBasic π1,1, π2, π·πππππ πππ β 1 π β π1 βͺ π3 end return R end See also Preparata et al. (1993), Computational Geometry, pp. 161-164, Springer.
69. 69. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk function MergeBasic(π1, π2, π·πππππ πππ) begin if π1 = {π} then π β π β π2 π β» π else if π2 = π then begin for each π β π1 do if π βΊ π then π β π end else if π·πππππ πππ = 2 then begin πππ β Minimum{π1|π β π1} π β π β π2 π1 < πππ end else begin πππ£ππ‘ β Median π π·πππππ πππβ1 π β π1 π1,1, π1,2 β Partition π1, π·πππππ πππ β 1, πππ£ππ‘ π2,1, π2,2 β Partition π2, π·πππππ πππ β 1, πππ£ππ‘ π1 β MergeBasic π1,1, π2,1, π·πππππ πππ π2 β MergeBasic π1,2, π2,2, π·πππππ πππ π3 β MergeBasic π1,1, π2, π·πππππ πππ β 1 π β π1 βͺ π3 end return R end See also Preparata et al. (1993), Computational Geometry, pp. 161-164, Springer.
70. 70. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk function MergeBasic(π1, π2, π·πππππ πππ) begin if π1 = {π} then π β π β π2 π β» π else if π2 = π then begin for each π β π1 do if π βΊ π then π β π end else if π·πππππ πππ = 2 then begin πππ β Minimum{π1|π β π1} π β π β π2 π1 < πππ end else begin πππ£ππ‘ β Median π π·πππππ πππβ1 π β π1 π1,1, π1,2 β Partition π1, π·πππππ πππ β 1, πππ£ππ‘ π2,1, π2,2 β Partition π2, π·πππππ πππ β 1, πππ£ππ‘ π1 β MergeBasic π1,1, π2,1, π·πππππ πππ π2 β MergeBasic π1,2, π2,2, π·πππππ πππ π3 β MergeBasic π1,1, π2, π·πππππ πππ β 1 π β π1 βͺ π3 end return R end See also Preparata et al. (1993), Computational Geometry, pp. 161-164, Springer.
71. 71. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk function MergeBasic(π1, π2, π·πππππ πππ) begin if π1 = {π} then π β π β π2 π β» π else if π2 = π then begin for each π β π1 do if π βΊ π then π β π end else if π·πππππ πππ = 2 then begin πππ β Minimum{π1|π β π1} π β π β π2 π1 < πππ end else begin πππ£ππ‘ β Median π π·πππππ πππβ1 π β π1 π1,1, π1,2 β Partition π1, π·πππππ πππ β 1, πππ£ππ‘ π2,1, π2,2 β Partition π2, π·πππππ πππ β 1, πππ£ππ‘ π1 β MergeBasic π1,1, π2,1, π·πππππ πππ π2 β MergeBasic π1,2, π2,2, π·πππππ πππ π3 β MergeBasic π1,1, π2, π·πππππ πππ β 1 π β π1 βͺ π3 end return R end See also Preparata et al. (1993), Computational Geometry, pp. 161-164, Springer.
72. 72. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk function MergeBasic(π1, π2, π·πππππ πππ) begin if π1 = {π} then π β π β π2 π β» π else if π2 = π then begin for each π β π1 do if π βΊ π then π β π end else if π·πππππ πππ = 2 then begin πππ β Minimum{π1|π β π1} π β π β π2 π1 < πππ end else begin πππ£ππ‘ β Median π π·πππππ πππβ1 π β π1 π1,1, π1,2 β Partition π1, π·πππππ πππ β 1, πππ£ππ‘ π2,1, π2,2 β Partition π2, π·πππππ πππ β 1, πππ£ππ‘ π1 β MergeBasic π1,1, π2,1, π·πππππ πππ π2 β MergeBasic π1,2, π2,2, π·πππππ πππ π3 β MergeBasic π1,1, π2, π·πππππ πππ β 1 π β π1 βͺ π3 end return R end See also Preparata et al. (1993), Computational Geometry, pp. 161-164, Springer.
73. 73. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk function MergeBasic(π1, π2, π·πππππ πππ) begin if π1 = {π} then π β π β π2 π β» π else if π2 = π then begin for each π β π1 do if π βΊ π then π β π end else if π·πππππ πππ = 2 then begin πππ β Minimum{π1|π β π1} π β π β π2 π1 < πππ end else begin πππ£ππ‘ β Median π π·πππππ πππβ1 π β π1 π1,1, π1,2 β Partition π1, π·πππππ πππ β 1, πππ£ππ‘ π2,1, π2,2 β Partition π2, π·πππππ πππ β 1, πππ£ππ‘ π1 β MergeBasic π1,1, π2,1, π·πππππ πππ π2 β MergeBasic π1,2, π2,2, π·πππππ πππ π3 β MergeBasic π1,1, π2, π·πππππ πππ β 1 π β π1 βͺ π3 end return R end See also Preparata et al. (1993), Computational Geometry, pp. 161-164, Springer.
74. 74. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk function MergeBasic(π1, π2, π·πππππ πππ) begin if π1 = {π} then π β π β π2 π β» π else if π2 = π then begin for each π β π1 do if π βΊ π then π β π end else if π·πππππ πππ = 2 then begin πππ β Minimum{π1|π β π1} π β π β π2 π1 < πππ end else begin πππ£ππ‘ β Median π π·πππππ πππβ1 π β π1 π1,1, π1,2 β Partition π1, π·πππππ πππ β 1, πππ£ππ‘ π2,1, π2,2 β Partition π2, π·πππππ πππ β 1, πππ£ππ‘ π1 β MergeBasic π1,1, π2,1, π·πππππ πππ π2 β MergeBasic π1,2, π2,2, π·πππππ πππ π3 β MergeBasic π1,1, π2, π·πππππ πππ β 1 π β π1 βͺ π3 end return R end See also Preparata et al. (1993), Computational Geometry, pp. 161-164, Springer.
75. 75. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk function MergeBasic(π1, π2, π·πππππ πππ) begin if π1 = {π} then π β π β π2 π β» π else if π2 = π then begin for each π β π1 do if π βΊ π then π β π end else if π·πππππ πππ = 2 then begin πππ β Minimum{π1|π β π1} π β π β π2 π1 < πππ end else begin πππ£ππ‘ β Median π π·πππππ πππβ1 π β π1 π1,1, π1,2 β Partition π1, π·πππππ πππ β 1, πππ£ππ‘ π2,1, π2,2 β Partition π2, π·πππππ πππ β 1, πππ£ππ‘ π1 β MergeBasic π1,1, π2,1, π·πππππ πππ π2 β MergeBasic π1,2, π2,2, π·πππππ πππ π3 β MergeBasic π1,1, π2, π·πππππ πππ β 1 π β π1 βͺ π3 end return R end See also Preparata et al. (1993), Computational Geometry, pp. 161-164, Springer.
76. 76. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk function MergeBasic(π1, π2, π·πππππ πππ) begin if π1 = {π} then π β π β π2 π β» π else if π2 = π then begin for each π β π1 do if π βΊ π then π β π end else if π·πππππ πππ = 2 then begin πππ β Minimum{π1|π β π1} π β π β π2 π1 < πππ end else begin πππ£ππ‘ β Median π π·πππππ πππβ1 π β π1 π1,1, π1,2 β Partition π1, π·πππππ πππ β 1, πππ£ππ‘ π2,1, π2,2 β Partition π2, π·πππππ πππ β 1, πππ£ππ‘ π1 β MergeBasic π1,1, π2,1, π·πππππ πππ π2 β MergeBasic π1,2, π2,2, π·πππππ πππ π3 β MergeBasic π1,1, π2, π·πππππ πππ β 1 π β π1 βͺ π3 end return R end See also Preparata et al. (1993), Computational Geometry, pp. 161-164, Springer.
77. 77. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk function MergeBasic(π1, π2, π·πππππ πππ) begin if π1 = {π} then π β π β π2 π β» π else if π2 = π then begin for each π β π1 do if π βΊ π then π β π end else if π·πππππ πππ = 2 then begin πππ β Minimum{π1|π β π1} π β π β π2 π1 < πππ end else begin πππ£ππ‘ β Median π π·πππππ πππβ1 π β π1 π1,1, π1,2 β Partition π1, π·πππππ πππ β 1, πππ£ππ‘ π2,1, π2,2 β Partition π2, π·πππππ πππ β 1, πππ£ππ‘ π1 β MergeBasic π1,1, π2,1, π·πππππ πππ π2 β MergeBasic π1,2, π2,2, π·πππππ πππ π3 β MergeBasic π1,1, π2, π·πππππ πππ β 1 π β π1 βͺ π3 end return R end See also Preparata et al. (1993), Computational Geometry, pp. 161-164, Springer.
78. 78. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk function MergeBasic(π1, π2, π·πππππ πππ) begin if π1 = {π} then π β π β π2 π β» π else if π2 = π then begin for each π β π1 do if π βΊ π then π β π end else if π·πππππ πππ = 2 then begin πππ β Minimum{π1|π β π1} π β π β π2 π1 < πππ end else begin πππ£ππ‘ β Median π π·πππππ πππβ1 π β π1 π1,1, π1,2 β Partition π1, π·πππππ πππ β 1, πππ£ππ‘ π2,1, π2,2 β Partition π2, π·πππππ πππ β 1, πππ£ππ‘ π1 β MergeBasic π1,1, π2,1, π·πππππ πππ π2 β MergeBasic π1,2, π2,2, π·πππππ πππ π3 β MergeBasic π1,1, π2, π·πππππ πππ β 1 π β π1 βͺ π3 end return R end See also Preparata et al. (1993), Computational Geometry, pp. 161-164, Springer.
79. 79. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk function MergeBasic(π1, π2, π·πππππ πππ) begin if π1 = {π} then π β π β π2 π β» π else if π2 = π then begin for each π β π1 do if π βΊ π then π β π end else if π·πππππ πππ = 2 then begin πππ β Minimum{π1|π β π1} π β π β π2 π1 < πππ end else begin πππ£ππ‘ β Median π π·πππππ πππβ1 π β π1 π1,1, π1,2 β Partition π1, π·πππππ πππ β 1, πππ£ππ‘ π2,1, π2,2 β Partition π2, π·πππππ πππ β 1, πππ£ππ‘ π1 β MergeBasic π1,1, π2,1, π·πππππ πππ π2 β MergeBasic π1,2, π2,2, π·πππππ πππ π3 β MergeBasic π1,1, π2, π·πππππ πππ β 1 π β π1 βͺ π3 end return R end See also Preparata et al. (1993), Computational Geometry, pp. 161-164, Springer.
80. 80. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk function MergeBasic(π1, π2, π·πππππ πππ) begin if π1 = {π} then π β π β π2 π β» π else if π2 = π then begin for each π β π1 do if π βΊ π then π β π end else if π·πππππ πππ = 2 then begin πππ β Minimum{π1|π β π1} π β π β π2 π1 < πππ end else begin πππ£ππ‘ β Median π π·πππππ πππβ1 π β π1 π1,1, π1,2 β Partition π1, π·πππππ πππ β 1, πππ£ππ‘ π2,1, π2,2 β Partition π2, π·πππππ πππ β 1, πππ£ππ‘ π1 β MergeBasic π1,1, π2,1, π·πππππ πππ π2 β MergeBasic π1,2, π2,2, π·πππππ πππ π3 β MergeBasic π1,1, π2, π·πππππ πππ β 1 π β π1 βͺ π3 end return R end See also Preparata et al. (1993), Computational Geometry, pp. 161-164, Springer.
81. 81. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π΄: input of the Skyline operation; a set of π-dimensional points πΉ: output of the Skyline operation; a set of π-dimensional points π βΊ π: point π is dominated by point π function SkylineBasic M, Dimension begin if π = 1 then return π πππ£ππ‘ β Median π π·πππππ πππ π β π π1, π2 β Partition π, π·πππππ πππ, πππ£ππ‘ π1 β SkylineBasic(π1, π·πππππ πππ) π2 β SkylineBasic π2, π·πππππ πππ return π1 β MergeBasic(π1, π2, π·πππππ πππ) end
82. 82. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm M-way Partitioning β’ To get better performance by I/O behavior than the basic algorithm β’ To divide into π partitions to fit into memory β’ To be used in the first step and third step of the basic algorithm β’ Partition by quantile rather than median 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk
83. 83. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm M-way Partitioning β’ To be applied the basic algorithm at the first step, π-way partitioning produces π partitions π1, β¦ , ππ to each ππ fits into memory. β’ At the third step of the basic algorithm, the π-way partitioning is applied. β’ All sub-partitions should occupy at most half of the memory. 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk
84. 84. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. function πππππππ€ππ¦ π1, π2, π·πππππ πππ begin if π1 = {π} then π β {π β π2|π β» π} else if π2 = {π} then begin foreach π β π1 do if π βΊ π then π β π end else if π1 + π2 < |π| then π β ππππππ΅ππ ππ(π1, π2, π·πππππ πππ) else if π·πππππ πππ = 2 then begin πππ β ππππππ’π π1 π β π1 π β π β π2 π1 < πππ end else begin ππππ‘ππ‘ππππ  β πππ₯πππ’π{ π1 π 2 , π2 π 2 } ππ’πππ‘ππππ  β πΌ β ππ’πππ‘ππππ (π1, π·πππππ πππ β 1, ππππ‘πππππ ) π1,1, β¦ , π1,ππππ‘ππ‘ππππ  β ππππ‘ππ‘ππππ (π1, π·πππππ πππ β 1, ππ’πππ‘ππππ ) π2,1, β¦ , π2,ππππ‘ππ‘ππππ  β ππππ‘ππ‘ππππ (π2, π·πππππ πππ β 1, ππ’πππ‘ππππ ) π β π for π β 1 to ππππ‘ππ‘ππππ  do begin for π β 1 to π do if π < π then π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ β 1 else π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ ππππππ(π, π2,π) end end return π end Implementation: D&C Algorithm Pseudo-code1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π΄: input of the Skyline operation; a set of π-dimensional points πΉ: output of the Skyline operation; a set of π-dimensional points π: main memory; a set of π-dimensional points π βΊ π: point π is dominated by point π function SkylineMway(π, π·πππππ πππ) begin ππππ‘ππ‘ππππ  β Minimum 2 π π β πβ π β 2 π > π ππ’πππ‘ππππ  β πΌ β Quantiles π, π·πππππ πππ, ππππ‘ππ‘ππππ  π1, β¦ , πππππ‘ππ‘ππππ  β Partition π, π·πππππ πππ, ππ’πππ‘ππππ  for π β 1 to ππππ‘ππ‘ππππ  do if ππ < |π| then ππ β SkylineBasic ππ, π·πππππ πππ else ππ β SkylineMway ππ, π·πππππ πππ while ππππ‘ππ‘ππππ  > 1 do begin for π β 1 to ππππ‘ππ‘ππππ  2 do ππ β ππ βͺ MergeMway π2πβ1, π2π, π·πππππ πππ ππππ‘ππ‘ππππ  β ππππ‘ππ‘ππππ  2 end return π1 end
85. 85. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π1,1 π2,1 π1,2 π2,2 π1,3 π2,3 π1,4 π2,4 π = 1, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,1 Partition to be fitted into the memory size ππ’πππ‘πππ πΌ ππ’πππ‘πππ πΌ1 ππ’πππ‘πππ πΌ2 ππ’πππ‘πππ πΌ3 for π β 1 to ππππ‘ππ‘ππππ  do begin for π β 1 to π do if π < π then π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ β 1 else π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ ππππππ(π, π2,π) end
86. 86. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π1,1 π2,1 π1,2 π2,2 π1,3 π2,3 π1,4 π2,4 π = 1, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,1 π = 2, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,2 ππ’πππ‘πππ πΌ ππ’πππ‘πππ πΌ1 ππ’πππ‘πππ πΌ2 ππ’πππ‘πππ πΌ3 for π β 1 to ππππ‘ππ‘ππππ  do begin for π β 1 to π do if π < π then π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ β 1 else π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ ππππππ(π, π2,π) end
87. 87. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π1,1 π2,1 π1,2 π2,2 π1,3 π2,3 π1,4 π2,4 π = 1, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,1 π = 2, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,2 π = 2 π‘βππ πππππππ€ππ¦ π1,2 π2,2 ππ’πππ‘πππ πΌ ππ’πππ‘πππ πΌ1 ππ’πππ‘πππ πΌ2 ππ’πππ‘πππ πΌ3 for π β 1 to ππππ‘ππ‘ππππ  do begin for π β 1 to π do if π < π then π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ β 1 else π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ ππππππ(π, π2,π) end
88. 88. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π1,1 π2,1 π1,2 π2,2 π1,3 π2,3 π1,4 π2,4 π = 1, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,1 π = 2, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,2 π = 2 π‘βππ πππππππ€ππ¦ π1,2 π2,2 π = 3, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,3 ππ’πππ‘πππ πΌ ππ’πππ‘πππ πΌ1 ππ’πππ‘πππ πΌ2 ππ’πππ‘πππ πΌ3 for π β 1 to ππππ‘ππ‘ππππ  do begin for π β 1 to π do if π < π then π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ β 1 else π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ ππππππ(π, π2,π) end
89. 89. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π1,1 π2,1 π1,2 π2,2 π1,3 π2,3 π1,4 π2,4 π = 1, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,1 π = 2, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,2 π = 2 π‘βππ πππππππ€ππ¦ π1,2 π2,2 π = 3, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,3 π = 2 π‘βππ πππππππ€ππ¦ π1,2 π2,3 ππ’πππ‘πππ πΌ ππ’πππ‘πππ πΌ1 ππ’πππ‘πππ πΌ2 ππ’πππ‘πππ πΌ3 for π β 1 to ππππ‘ππ‘ππππ  do begin for π β 1 to π do if π < π then π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ β 1 else π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ ππππππ(π, π2,π) end
90. 90. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π1,1 π2,1 π1,2 π2,2 π1,3 π2,3 π1,4 π2,4 π = 1, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,1 π = 2, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,2 π = 2 π‘βππ πππππππ€ππ¦ π1,2 π2,2 π = 3, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,3 π = 2 π‘βππ πππππππ€ππ¦ π1,2 π2,3 π = 3 π‘βππ πππππππ€ππ¦ π1,3 π2,3 ππ’πππ‘πππ πΌ ππ’πππ‘πππ πΌ1 ππ’πππ‘πππ πΌ2 ππ’πππ‘πππ πΌ3 for π β 1 to ππππ‘ππ‘ππππ  do begin for π β 1 to π do if π < π then π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ β 1 else π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ ππππππ(π, π2,π) end
91. 91. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π1,1 π2,1 π1,2 π2,2 π1,3 π2,3 π1,4 π2,4 π = 1, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,1 π = 2, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,2 π = 2 π‘βππ πππππππ€ππ¦ π1,2 π2,2 π = 3, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,3 π = 2 π‘βππ πππππππ€ππ¦ π1,2 π2,3 π = 3 π‘βππ πππππππ€ππ¦ π1,3 π2,3 π = 4, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,4 π = 2 π‘βππ πππππππ€ππ¦ π1,2 π2,3 π = 3 π‘βππ πππππππ€ππ¦ π1,3 π2,3 π = 3 π‘βππ πππππππ€ππ¦ π1,3 π2,3 ππ’πππ‘πππ πΌ ππ’πππ‘πππ πΌ1 ππ’πππ‘πππ πΌ2 ππ’πππ‘πππ πΌ3 for π β 1 to ππππ‘ππ‘ππππ  do begin for π β 1 to π do if π < π then π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ β 1 else π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ ππππππ(π, π2,π) end
92. 92. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π1,1 π2,1 π1,2 π2,2 π1,3 π2,3 π1,4 π2,4 π = 1, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,1 π = 2, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,2 π = 2 π‘βππ πππππππ€ππ¦ π1,2 π2,2 π = 3, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,3 π = 2 π‘βππ πππππππ€ππ¦ π1,2 π2,3 π = 3 π‘βππ πππππππ€ππ¦ π1,3 π2,3 π = 4, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,4 π = 2 π‘βππ πππππππ€ππ¦ π1,2 π2,4 π = 3 π‘βππ πππππππ€ππ¦ π1,3 π2,3 π = 3 π‘βππ πππππππ€ππ¦ π1,3 π2,3 ππ’πππ‘πππ πΌ ππ’πππ‘πππ πΌ1 ππ’πππ‘πππ πΌ2 ππ’πππ‘πππ πΌ3 for π β 1 to ππππ‘ππ‘ππππ  do begin for π β 1 to π do if π < π then π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ β 1 else π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ ππππππ(π, π2,π) end
93. 93. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π1,1 π2,1 π1,2 π2,2 π1,3 π2,3 π1,4 π2,4 π = 1, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,1 π = 2, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,2 π = 2 π‘βππ πππππππ€ππ¦ π1,2 π2,2 π = 3, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,3 π = 2 π‘βππ πππππππ€ππ¦ π1,2 π2,3 π = 3 π‘βππ πππππππ€ππ¦ π1,3 π2,3 π = 4, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,4 π = 2 π‘βππ πππππππ€ππ¦ π1,2 π2,4 π = 3 π‘βππ πππππππ€ππ¦ π1,3 π2,4 π = 3 π‘βππ πππππππ€ππ¦ π1,3 π2,3 ππ’πππ‘πππ πΌ ππ’πππ‘πππ πΌ1 ππ’πππ‘πππ πΌ2 ππ’πππ‘πππ πΌ3 for π β 1 to ππππ‘ππ‘ππππ  do begin for π β 1 to π do if π < π then π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ β 1 else π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ ππππππ(π, π2,π) end
94. 94. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk π1,1 π2,1 π1,2 π2,2 π1,3 π2,3 π1,4 π2,4 π = 1, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,1 π = 2, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,2 π = 2 π‘βππ πππππππ€ππ¦ π1,2 π2,2 π = 3, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,3 π = 2 π‘βππ πππππππ€ππ¦ π1,2 π2,3 π = 3 π‘βππ πππππππ€ππ¦ π1,3 π2,3 π = 4, π = 1 π‘βππ πππππππ€ππ¦ π1,1 π2,4 π = 2 π‘βππ πππππππ€ππ¦ π1,2 π2,4 π = 3 π‘βππ πππππππ€ππ¦ π1,3 π2,4 π = 3 π‘βππ πππππππ€ππ¦ π1,4 π2,4 ππ’πππ‘πππ πΌ ππ’πππ‘πππ πΌ1 ππ’πππ‘πππ πΌ2 ππ’πππ‘πππ πΌ3 for π β 1 to ππππ‘ππ‘ππππ  do begin for π β 1 to π do if π < π then π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ β 1 else π2,π β πππππππ€ππ¦ π1,π, π2,π, π·πππππ πππ ππππππ(π, π2,π) end
95. 95. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk To Propose Bushy Merge Tree β’ To minimize different merge steps β’ In the below figure the tuples of π1 are only involved in log π merge steps (where π is the number of the partitions)
96. 96. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk Early Skyline At the first step of the M-way partitioning; 1. Load as many tuples as fit into the available main- memory buffers. 2. Applying the basic divide-and-conquer algorithm in order to immediately eliminate the tuples which are dominated by others. 3. Partition the remaining tuples into π partitions.
97. 97. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Implementation: D&C Algorithm 1. D&C-basic 2. D&C-mpt 3. D&C-mptesk Early Skyline β’ incurs additional CPU. β’ saves I/O, because less tuples need to be written and reread in the partitioning steps. β’ is attractive if the Skyline is selective (i.e., if the Skyline is small).
98. 98. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Experiments and Results Experiments Environment β’ Processor: 333 MHz β’ Main memory: 128 MB β’ Operating system: Solaris 7 β’ Disk drive: 9GB Seagate with 7200 rpm and 512K disk cache
99. 99. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Experiments and Results Implemented C++ Algorithms β’ Sort: Only for two-dimensional Skylines β’ BNL-basic: the basic block-nested-loops algorithm β’ BNL-sol: BNL and the window is organized as a self-organizing list β’ BNL-solrep: BNL-sol and tuples in the window are replaced β’ D&C-basic: basic divide-and-conquer algorithm β’ D&C-mpt: D&C-basic with m-way partitioning β’ D&C-mptesk: D&C-mpt and βEarly Skyllineβ
100. 100. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Experiments and Results Generated Database Condition β’ Each benchmark database contains 100,000 tuples (10MB). β’ The values of doubles of a tuple are generated randomly in [0,1).
101. 101. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Experiments and Results Three Generated Database β’ indep: all attribute values are generated independently β’ corr: all attribute values have correlation with each dimension β’ anti: all attribute values have anti-correlation with each dimension indep corr anti
102. 102. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Experiments and Results indep corr anti
103. 103. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Experiments and Results Skyline Sizes
104. 104. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Experiments and Results 2-d Skylines running times (in seconds) and amount of disk I/O (in MB) β’ BNL is the winner. Because of large enough memory, BNL terminates after one iteration. β’ βEarly Skylineβ is the winner among D&C variants, because after applying βEarly Skylineβ, the partitions are very small and the rest of the algorithm can be completed very quickly.
105. 105. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Experiments and Results Multi-dimensional Skylines winner at the corr BNL is good up to 5-D D&C-mpt and D&C-mptesk outperform BNL after 5-D
106. 106. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Experiments and Results Multi-dimensional Skylines At the anti, BEP is earlier than the corr. Finally D&C outperforms BNL.
107. 107. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Experiments and Results Conclusion of the Experiments: BNL β’ The BNL variants are good if the size of the Skyline is small. β’ Performance of the BNLβs performance depends on the number of dimension and correlation. β’ BNL-sol is the winner among the BNL variants, but not great. β’ Replacement is bad if the Skyline is very large. It incurs additional overhead without benefits.
108. 108. Borzsony, S., The Skyline Operator, In proc, IEEE Conf. on Data Engineering, page 421-430, Heidelberg, Germany, Apr. 2001. Experiments and Results Conclusion of the Experiments: D&C β’ D&C variantsβ performance less depends on the number of dimension and correlation than BNL. β’ D&C-mptesk is winner among the D&C variants.
109. 109. Thank you for listening