{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

aquery - Motivation The need for ordered data AQuery A...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
&4uery & )atabase 6ystem for 2rder )ennis 6hasha -oint work with &lberto /erner lerner%cs±nyu±edu shasha%cs±nyu±edu 0otivation 7he need for ordered data ● 4ueries in )inance² 'iology² and 1etwork 0anagement depend on order± ● 64/ "" has extensions – the 2/&3 amendment – that incorporate order to the language but they are clumsy to use± ³´month moving average# the wrong way sale s µ¶¶ µ·¶ µ¸¶ µ¸¶ µ³¶ ³´ avg µ¶¶ µµ¶ µ·¶ µ³³ µ³¹ mont h µ · ³ ¸ º 6(/((7 tµ±month²tµ±sales² »tµ±sales¼t·±sales¼t³±sales½¾³ )520 6ales tµ² 6ales t·² 6ales t³ :+(5( tµ±month – µ &" t·±month &1) tµ±month – · &" t³±month 65WWVTHGISQKJLTRXX $ ● -oin eliminates first two months¿ ● )o we really need a three´way join$ ● (an the optimizer make it linear´time$ ³´month moving average# the hard way sale s µ¶¶ µ·¶ µ¸¶ µ¸¶ µ³¶ ³´ avg µ¶¶ µµ¶ µ·¶ µ³³ µ³¹ mont h µ · ³ ¸ º 6(/((7 tµ±month²tµ±sales² »tµ±sales¼ (&6( :+(1 t·±sales is null &1) t³±sales is null 7+(1 ·Àtµ±sales :+(1 t·±sales is not null &1) t³±sales is null 7+(1 t·±sales ¼»tµ±sales¼t·±sales½¾· (/6( t·±sales ¼ t³±sales (1)½ ¾ ³ )520 6ales tµ /()7 287(5 -2,1 6ales t· 21 tµ±month – µ &" t·±month /()7 287(5 -2,1 6ales t³ 21 tµ±month – · &" t³±month 65WWVTHGISQKJLTRXX $ ● “:rite´once” query ● 7hree way join ³´month moving average# the 2/&3 way sale s µ¶¶ µ·¶ µ¸¶ µ¸¶ µ³¶ ³´ avg µ¶¶ µµ¶ µ·¶ µ³³ µ³¹ mont h µ · ³ ¸ º 6(/((7 month²sales² avg»sales½ 29(5 »25)(5 '> month 52:6 '(7:((1 · 35(((),1* &1) (855(17 52:½ )520 6ales 65WWVTHGISQKJLTRXX $ ● 29(5 construct is confined to the 6(/((7 clause ● &wkward syntax 1etwork 0anagement 4uery ● )ind duration and average length of packets of src´ dst flows± & flow from src to dest ends after a ·´ minute silence YYNPNTR KJL µ ·¶ ¸ µ¸µ µº¶ µºº JIKXX YY XXWW IHJ 65GFHIHJRPKJL YYXX SQKJL US ·º · ³³ ·³ º ·! :,7+ 3rec &6 »src²dst²len²time²ptime½ »6(/((7 src²dst²len²time²min»time½ 29(5 w )520 3ackets :,1)2: w &6 »3&57,7,21 '> src²dst 25)(5 '> time 52:6 '(7:((1 µ 35(((),1* &1) µ 35((((),1*½½² )low &6 »src²dst²len²time²flag½ »6(/((7 src²dst²len²time² (&6( :+(1 time´ptime # µ·¶ 7+(1 µ (/6( ¶ )520 3rec½² )low,) &6 »src²dst²len²time²f,)½ »6(/((7 src²dst²len²time²sum»flag½ 29(5 w )520 )low :,1)2: w &6 »25)(5 '> src²dst² time 52:6 81'281)() 35(((),1*½½ 6(/((7 src²dst²count»À½²avg»len½ )520 )low,) *5283 '> src²dst²f,)
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
● ,nter´tuple operations require joins or additional query constructs ´ or both¿ ● 2rdering can only be obtained in specific clauses »e±g±² 6(/((7½ 'ottom line# ● 4ueries become difficult to read ● (ost of execution is larger than necessary »optimization of nested queries is still an open problem½ 2rder in 64/#µ""" ,dea ● 5eplace ordered tables » arrables ½ for tables in the data model »inspiration from .64/ by .; systems½ ○ :hatever can be done on a table can be done on an arrable ± 1ot vice´versa± ● )efine order on a per´query basis
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern