SlideShare a Scribd company logo
1 of 24
Download to read offline
.
                          .
                                              .                                                      ¯
234322
 8                                                                                                               :
                                                                        .                                             .
                                                  .(                            )                                    ¯.
                                                                                    .                                ¯.
                                              .   ¯                                                                  ¯.

                 ¯    1                                                     ¯                                             2




                                                                            (                        )
             ,                    .                                     ¯                       ¯     ,
         .                                .(n-tuple)           -n               ,                                     ¯

                 ¯            ¯       ¯                    (                            )           : (domain)
                                                                    .                       ¯
                                                                                  20                         ¯
                                                                    (99999- 10000              ¯)
                                                                          (31.12.2999 -1.1.1900)
                 ¯–



                 ¯    3                                                     ¯                                             4
(                 ,                  )
                   (multiset, bag)               -   :(relation)                                                          prophets -                                    :
           .   ¯                                             ¯
                                                                                     {           ,           -        ,                    }-           :(attributes )          ¯

prophets                              -500                         52
                                                                             .               ,           ¯                                :(relation scheme)                        ¯
                                      -550                         66
                                                                                                                                                                            :
                                      -700                         55
                                                                            Prophets(chapters, birth_year, name)
                                      -200                         4        Branch(b_name, assets, b_city)
                                                                            Customer(c_name, street, c_city)
                                      -400                         48
                                                                            Deposit(b_name, account_number, customer_name, balance)
       prophets ⊆ string × date × integers                                  Borrow(b_name, loan_number, loan_number, c_name, amount)
                              ¯                                         5                                                             ¯                                                 6




                                                                                                                          (                                                         )
                                                           ,
                                       ¯,                                                                                         ¯                 ,                   ¯
                                                           .                     :SQL-               ,                        ¯
                                                               ,
                                                       .                    SELECT name
                                                                            FROM Prophets
                                                           ,                WHERE birth_year<-500;
                          (       ¯          )
                                                                                         .                                                                   ¯
                                                                                                                 .                                               SQL-

                                                                                                                 .(   ¯                    C    ¯                                       )
                              ¯                                         7                                                             ¯                                                 8
¯
                                                                                      .                             ¯            ¯,                          ,
                                   ¯ ,           ,     ,     –× ∩∪          •
                                                                                              )                              ,                                            ¯
                                                               – select      •
                                                – (projection)      –π       •
                                                                                                                                          .(                                   ¯
                                                                – π A→B      •                         .        -                                        ¯ ¯         ,
             (            ¯                    )                    –δ       •
                                                                 – join      •
    ¯                 ¯                                          – sort      •
                                                                                                                        ,
                                                                                                                                               (?       ¯)
                                          ¯
                                       – max, min, average, sum              •

                                                                   – count   •
                                         ¯                                   9                                                        ¯                                            10




                                                               ∪                                                                                                 ∩
        A1       A2           A3             R ∪ S = {r: r ∈ R or r ∈ S}          R ∩ S = {r: r ∈ R and r ∈ S}                                                            ¯

         a        b            c                      A1       A2      A3                 R                A1           A2       A3
                                                                                                                                          S              A1          A2       A3
R
         d        e            f                           a       b    c                                   a            b        c                          a        b        c
         c        b            d       R∪S                 d       e    f                                   a            b        c                          c        b        d
                                                           c       b    d                                   c            b        d                          a        c        e
        A1       A2           A3
S                                                          c       b    d         R∩S
         c        b            d                           d       a    f            A1           A2        A3
                                   ¯
         d        a            f                                                      a            b            c
                                                                                                                                                    ¯
                                         ¯
                                                                   ¯         11
                                                                                      c            b            d                     ¯                                            12
×                                          ¯
                                                                                                   R × S = {(r1,r2,…,rn,s1,…,sm): r ∈ R and s ∈ S}
R  S = {r: r ∈ R and r ∉ S}                                                         ¯
                                                                                                   R      A1        A2          A3                 A1        A2        A3       B1      B2
    R         A1        A2        A3        S            A1        A2           A3
                                                                                                           a            b        c                  a         b            c     a          b
               a         b         c                      a            b         c                                                                  a         b            c     a          b
                                                                                                           a            b        c
               a         b         c                      c            b         e                                                                  c         b            d     a          b
                                                                                                            c           b        d
               c         b         d                      a            c         e                                                                  a         b            c     c          b
                                                                                                   S      B1        B2
                                                                                                                                                    a         b            c     c          b
                   A1        A2        A3                                                                  a            b        R×S
RS                                                                                                                                                 c         b            d     c          b
                    a         b         c                                                                   c           b                                ,                 ¯        ¯
                    c         b         d                                                                                                    (R.a, S.a            )    ¯
                                                                   (                     )                          (R                   ) × (S                   ):
                                                ¯                                             13                                               ¯                                            14




                                            select σ                                                                                 π projection
                             .C                                                          select
σC(R) = {r ∈ R : r satisfies C}                                                                    πℓ1, ℓ2,…, ℓn(R)={(rℓ1,rℓ2,…rℓn) : (r1,…,rn) ∈ R}
         A1        A2        A3
                                                    σA2=b(R)
R                                                                                                                   R                    πA1,A3(R)                     πA2(R)
          a         b         c                     A1        A2           A3
                                                                                                           A1           A2       A3           A1         A3                    A2
          a         b         c                      a         b            c
                                                                                                                a           b        c             a         c                  b
          c         b         d                      a         b            c
                                                                                                                a           b        c             a         c                  b
          c         c         c                      c         b            d
                                                                                                                c           b        d             c         d                  b
        σa≤A2≤b(R)           " [a,b]
                                                ¯                                             15                                               ¯                                            16
join                                       (                     )                        join
       .                  ¯
                     ¯          ¯                                                  :A = attr(R) ∩ attr(S)      ¯ S ,R                                       join
                                                         .                  R    S = {r    s : r ∈ R, s ∈ S, πA(r) = πA(s) }
                                                               :
                                                                                                                                                                   :
Q(name, address, tel_no) = R(name, address)       S(name, tel_no)
                                                                                A     B        C                                              A        B      C        D
                                                                                                                 C               D
                                            :         join                       a     b        c                                              a        b     c        d1
            A                     ¯                S,R                                                               c           d1
                                                                                a1    b1        c                                             a1       b1     c        d1
                         r.A = s.A -    ¯       r ∈ R, s ∈ S                                                     c2              d2
                                                                                a1    b1       c1                                             a1        d    c2        d2
                     s- r                                 r        s                                             c2              d3
                        .A    ¯                                                 a1     d       c2                                             a1        d    c2        d3
   s = (Homer Simpson, 555-2121)
   r = (Homer Simpson, 123 Fake St. Springfield)
   r    s = (Homer Simpson, 123 Fake St. Springfield, 555-2121)
                                    ¯                                  17                                                    ¯                                          18




  (join)                                                                             join
                                                                                                    .                    ¯                '             ¯    ¯ R
                ¯             S R       ¯         s r
                                                                                                        .        ¯           ,        '            ¯         ¯ S
                                                         .A
                                            : ¯         R S
                                                                                 .         ¯    ,           ¯,           ,                             ¯    ¯ S         R

                R   S = πS∪(R/S) (σAR=A(ρA→AR(r) × s))




                                    ¯                                  19                                                    ¯                                          20
.(                   )                                                                          R
                                                                                               .R           (    )          = B(R)
                                               .                                                            .R              = T(R)
                                       .                                    .V(R)=T(δ(R)) " ,R                              = V(R)
                                   .                                             .        ¯                                 =   M
                 .                                                 .                       ¯

                                                                  ¯        (pipeline)                                , ¯-
                                                                                                                      .
                                                                                                             ,
                                                                                                        .                   ¯

                              ¯                            21                                       ¯                               22




                         .                 -
                                                                       .                       max, min, average
Union(relation R, relation S) {
  forall r ∈ R {                                                double average(relation R, column A) {
       read r;                                                    int count = 0;
       output r;                                                  value sum = 0;
  }                                                               forall r ∈ R {
  forall s ∈ S {                                                      read r;
       read s;                                                        sum = sum + r.A;
       output s;                                                      count = count + 1;
  }                                                               }
}                                                                 return sum / (double) count;
                             B(R) + B(S) :             ¯        }
                                   O(1) :              ¯                                            B(R)              :         ¯
                              ¯                            23                                       ¯                               24
δ
                                           B(δ(R)) ≤ M - 4                                                           .                     S
relation delta(relation R) {                                                                     B(δ (S) ) ≤ M           ¯
   search_structure = ∅;                      :                    -4
                                                                                                  (     ¯ R                                    )
   forall r ∈ R {
       read r;
       if (r ∉ search_structure) {                                                                                                      SR:
              insert r into search_structure;                                 .                             δ(S)              ¯
              output r;                                                                                                           .R
       }                                                                             .                            S-          r    ,R- r ¯
   }                                                                                     ,                       S           ¯
}                                                                                                                                   .
     .           ¯           ¯ search_structure
                                       ¯                                25                                       ¯                                 26




                                                 SR                                             SR
                                                                             relation Difference(relation R, relation S) {
S=(20, 11, 30, 20,11,11)                                                        search_structure = ∅;
R=(11,40,20,11, 20, 20, 50, 40)                                                 forall s ∈ S {
                                                                                     read s;
                          11:3, 20:2, 30:1              S                            if s ∉ search_structure {
                                                                                              insert s into search_structure;
                                                             R                                search_structure[s].count = 0;
                         11:2, 20:2, 30:1                        :11                 }
                                                                                     search_structure[s].count ++;
                         11:2, 20:2, 30:1                        :40            }
                                                                                forall r ∈ R {
                         11:2, 20:1, 30:1                        :20                 read r;
                                                                                     if (r ∈ search_structure) and (search_structure[r].count > 0)
                         11:1, 20:1, 30:1                        :11                          search_structure[r].count --;
                                                                                     }
                         11:1, 20:0, 30:1                        :20            forall s ∈ search_structure
                                                                                     repeat search_structure[s].count times
                         11:1, 20:0, 30:1                        :20                           output s;
                                       ¯                                27
                                                                             }                                     ¯                             28
¯ S           ¯                               ¯
   (                                       ¯) ¯                                    ¯                ¯ S               ¯
                                                               ,               S             ¯
                  :           ¯                                    .(A-    )                                                        ¯
B(S) + B(R)
              :               ¯                                                        .(           ¯         ¯) R       ¯
B(S)                                                                                            ,               r.A       R- r ¯
                                                                                       (r.A = s.A              ¯)      s       ¯
                                                                                                                  .   r s




                      ¯                                   29                                        ¯                               30




                                  R              S                                                        R                S
                              A       B         B    C                                                  A      B          B    C
                               a      b1         b   c1                                                  a    b1           b   c1
                              a2      b2        b1   c2        (a,b1,c2)                                a2    b2          b1   c2
                                                               (a,b1,c3)
                              a1      b1        b1   c3                                                 a1    b1          b1   c3
                              a6      b3        b3   c4                                                 a6    b3          b3   c4
                              a4      b3                                                                a4    b3
                                            (        ¯    )
                              a5      b3                                                                a5    b3

                          (           )
                      ¯                                   31                                        ¯                               32
R                 S                                                     R                 S
                                    A       B            B    C                                                A    B            B        C
                                        a   b1            b   c1                                                a   b1            b       c1
---                                 a2      b2           b1   c2        (a1,b1,c2)                             a2   b2           b1       c2
                                                                        (a1,b1,c3)
                                    a1      b1           b1   c3                                               a1   b1           b1       c3
                                    a6      b3           b3   c4                                               a6   b3           b3       c4
                                    a4      b3                                                                 a4   b3
                                                                          (a6,b3),(a4,b3),(a5,b3)
                                    a5      b3                                                                 a5   b3
                                                                                      (b3,c4)

                            ¯                                      33                                     ¯                                    34




      ¯             ¯ δ(S)                           ¯                                                                       : ¯
                                                                                                    ¯
                                :
              B(S) + B(R)                                                       B(R)                    O(1)             σ, π,

                                                                            B(R) + B(S)                 O(1)                 ∪
          .                         ¯            ¯
                                                                                B(R)                    δ(R)                          δ

                                                                            B(R) + B(S)                 δ(S)               ×∩


                                                                                          ¯         –

                            ¯                                      35                                     ¯                                    36
nested loops
                         .(                   )                          :
                                          .                for each tuple s in S {
                                                             read s;
                                  .                          for each tuple r in R {
                              .                                  read r;
              .                                                  process tuples r and s
                                                             }
                                                           }
                                                                                                                T(S)T(R) :            ¯
                                                                                 T(S)B(R)                         R               :


                         ¯                            37                                        ¯                                         38




                                                                             :
                       join           ¯                                               .S                ¯                   M-4           ¯
for each tuple s in S {
  read s;                                                                                                               :
  for each tuple r in R {                                                                                       S           M-4
                                                                                                    (       ¯            )R ¯
      read r;                                                                                                       R- r      ¯
      if s and r join to make a tuple t                              s            ¯         ¯           S
             output t;                                                                                      r.A = s.A :
  }                                                                                                            r   s
}
                                T(S)B(R) :        ¯                              (M-4) + B(R) :                     ¯
                                                                                  B(S)/(M-4)
                                                                                                                       :
                         ¯                            39                                        ¯                                         40
:
                                                    ¯
                    (M-4) + B(R)            :                         while (S is not exhausted) {
                     B(S)/(M-4)
                                                   :                   read the next M-4 blocks of S and put them in a
                                                                            search structure ordered by A;
                                        :                    ¯          forall blocks b of R {
                                                                            read block b;
B(S)/(M-4) ((M-4) + B(R)) = B(S) + B(S) B(R) /(M-4)                         forall tuples r in b {
                          ≅ B(S) B(R) / M                                          search r.A in the search structure;
                                                                                   forall tuple s found
                                                                                          output s    r;
      M >> 4                                                                }
                                                             ,          }
                                                        ?   .R        }
                             ¯                                   41                                       ¯                                  42




                             .(                         )                                         .                           ¯
                                                .                               ,(            )                       S- R
                                            .                                                                            .R            S
                                                                                .R       r- S         s                            ¯     ¯
                                    .                                                                             (               ) r >s
                .                                                                    .(           )S                   s
                                                                                      .R                      r         r <s
                                                                                           ,r=s
                                                                                     .                                  s          r

                                                                                                                  ?
                             ¯                                   43                                       ¯                                  44
‫היכן השתמשנו‬
?M ‫בהנחה על‬
                                                                                     ¯            :
S- R-                 ¯              ,A                       S- R-
             .|σA=a(S)| > M                       A       a
                                                         .R            S                 ¯
        .R     r- S     s                                          ¯       ¯
   S                  s               πA(r) >πA(s)                                  1                   B(R)                              δ
    R                   r              πA(r) <πA(s)
                                                                                    1                       1                        Min, Max
 πA(s’) =πA(s)       S                   ¯      ¯
            :πA(r’) =πA(s)            R     r’                         ¯            *2                B(S)+B(R)                 ∩ , ∪, / (                )
 r’    s’                               ¯ s’ ¯
                                                                                    *2                B(S)+B(R)
                                                      B(S) + B(R) :        ¯
    B(S      R) :            ¯                                                                ¯             ¯                       ¯,        ¯                   *
                                 ¯                                             45                                   ¯                                                 46




                                                                                                                        :
                              .(                               )
                                                                                                                :           ¯                                         ¯
                                                         .
                                              .                                                                        ¯
                                          .                                                             .           (hash)
                                                                                                                        ¯ ;                       ¯           ¯
                 .                                                                                                                   .                ¯

                                                                                                                            :       ¯ ,
                                                                                               ,                                      ¯
                                                                                             . ¯


                                 ¯                                             47                                   ¯                                                 48
δ
 53,42,73,81,22,53,91,61,53,11,92,91      :                                                                    ,                                      ¯
 .(                       )                 :                                     ,                                    ,
1: 81,91,61,11,91                                                                                .        k-                                    ¯
2: 42,22,92
3: 53,73,53,53                                                                        :   ,     ¯                                                     ¯
                    :       ¯ .    ¯          :
                         ¯       ¯                                                                         (               )           ¯    M
      :(     ¯                )     δ                                                                                                       k
1: 81,91,61,11,91
2: 42,22,92           ?‫למה צריך יותר ממעבר אחד‬                                                M ≥ 2k + 2                   :
3: 53,73,53,53        ‫למה לא לסלק את הכפולים‬                                                  k ≤ M/2 -1           "
                       ?‫כאשר מנסים להכניסם לדלי‬
                                         ¯                              49                            ¯                                               50




                                         :                             δ                             :                                                δ
               .                 (           )                  B(R)   ¯¯
                                                                                                  : ¯      ¯
           (            ¯,                              ) B(R) > M
                                                                                          ,     k= M/2-1 -
                             .                             :
                                                                                                ,    k-      ¯                     ,
                                     .           ¯           :                                                                                  ...
                                                 . ¯
                                                                             .M                       k-           ¯                   h-
                   .(        ¯                     ¯)         δ
                                                                                              h = logk(B(R)/M)
                                                                                                                              :
      M≥                ⇐    ¯    ¯        ¯
                                                                                                    (2h+1)B(R)                              :
                              ¯ ,B(R)/k ≤ M
                            M    M
                                       2
           B ( R ) ≤ kM = M  − 1 ≈
                             2     2

                                         ¯
                                                          3B(R) , ¯     51                            ¯                                               52
for all s ∈ S                                                                                                                       :
   write s to bucket BS[h(s)];
                                                                                        2B(S)                          S
for all r ∈ R
   write r to bucket BR[h(r)];                                                          2B(R)                          R
                                                                                         B(S)                  S
                          . ¯       ¯ BR[i]- BS[i]       ,i ¯
                                                                                         B(R)                  R

for i=1 to number_of_buckets {                                                3B(S) + 3B(R)                                ¯"
   find the intersection of Bs[i] and Br[i] using the single pass
   algorithm and produce the sub-relation Ti

    output Ti
}
                                    ¯                               53                          ¯                                       54




                                                                                                                                ¯
                                                     ¯          A                :                         B ≤ M2 / 2
                             h(s.A) " S1,…Sk       S                                      3B(R)                            δ
            2B(S)                  B(Si) ≤ M  :i ¯      ¯                      3B(S) + 3B(R)        '¯ ,           ,
            2B(R)             h(r.A) " R1,…Rk      R
                            (? ¯) Ri Si         i=1,..,k
Σi(B(Si)+B(Ri))                                                          (?    ) 5- 3                      ,               B

    3B(S)+3B(R)              ¯"



                                    ¯                               55                          ¯                                       56
.                                                               ¯
                          .(                     )
                                            .                                        a≤x≤b                         C(x)           ¯ σC               :
                                    .                                                                               .
                                .                                                         :R                                       S             ¯ :
              .                                                   .R-                                                    S-                  ¯

                                                                                                                       O(T(S)) :                 ¯
                                                                                                               .           R     ¯                       ¯

                                                                                                                   ¯          ,        S             :
                                                                                           .                                                 ,R
                           ¯                             57                                        ¯                                                             58




                                                                                               ¯
.Y     ,S                 S(X,Y)        R(Y,Z)                                                 ,       ¯
                                                                  .                                                                      ¯        ,
                                         r∈R         ¯                           ,                                       ¯                                   ¯
                                   S- r.Y                                                      .
              s.Y = r.Y          s∈S        ¯
                               .   s   r                                                           :   ¯

                                              ¯                                      .(' ¯ ,               ,       )
                                .B(R)    :R
     S       T(S)/V(S,Y)       r.Y      ¯                               :(                 ¯           )       ¯
     (S- Y             ¯            V(S,Y)    ¯)
                         T(R) T(S)/V(S,Y) :¯"                 .
                           ¯                             59                                        ¯                                                             60
:      ,   ¯                                                       ¯   ¯            π   name,addr(σ title =“Gone…”, gender = F(MovieStar                         StarsIn))
                                                                                     :
πname,addr(σtitle=“gone with the wind” and gender = F (MovieStar
                                                      StarsIn))
                                                            : ¯                                                πname,addr                                     πname,addr
MovieStar(name, addr, gender), StarsIn(title, year, name)
                                                                                                  σ title=“Gone…” and gender = F
                             "                    "                      ¯
                                                                     .               ¯
                                                                                                                                                σ gender = F            σ title=“Gone…”
                     SELECT name, addr
                     FROM MovieStar, StarsIn
                                                                                                  MovieStar                  StarsIn             MovieStar                  StarsIn
                     WHERE title=“gone with the wind” and
                            gender=F and
                            MovieStar.name=StarsIn.name;                                      π   name,addr   (σ       gender = F(MovieStar)           σ   title=“Gone…”   (StarsIn))
                                              ¯                                          61                                                 ¯                                             62




      :          ,
                                                             :                                                     ,
(R        S)         T=R          (S         T)                                                                                  .                     ¯                              ¯
                                                                 :                                                                     .
R         S= S         R
                                    :                                                         σ title =“Gone…”, gender = F(MovieStar       StarsIn)) =
 σC(R ∩ S) = σC(R) ∩ S = R ∩ σC(S) = σC(R) ∩ σC(S)                                            σ gender = F(MovieStar)         σ title=“Gone…” (StarsIn)
                                   :                                                                                                   (?          )               σ   gender = F
 σ C(R         S) = σC(R)              S=R            σC(S) = σC(R)              σC(S)                                                                         σ   title=“Gone…”
                                                                                                              .        ¯     ¯   ¯
                                              ¯                                          63                                                 ¯                                             64
: ¯
Movie(title, year, studio) , StarsIn(title, year, name)                                                                                                                      :
π name,studio (σ year = 1996(Movie) StarsIn)                                                                                            ,
                                                                                                              .                                 ¯                                       ¯
                  πname,studio                                    πname,studio

                                                                                                                                   ?                    π-                       ¯

                                                                                                                                                         ,                              ¯
       σ year=1996               StarsIn                σ year=1996           σ year=1996                                      .
                                                                                                                           .            ¯                            ,
         Movie                                             Movie                 StarsIn

π   name,studio   (σ   year = 1996(Movie)                  σ   year = 1996   (StarsIn))
                                                    ¯                                          65                                       ¯                                                   66




                                                                      δ                                                                                                      ¯
                                                ,                                     δ                 ...        ,
                                            .                ¯¯                       ¯ , ¯-
                                                                                                                                            ,                                           ¯
δ(R        S)      = δ (δ(R)    S)                                                                             ,
                                                                                                                                                                                 ¯
                   = δ (R    δ(S))
                                                                                                                                                                 .
                   = δ(R)    δ(S)
                                                                                                                       ,                                                     -   ,¯"
                                    ,                                            δ,            ¯                                            . ¯                                     ¯
                                        .           ¯                                          ¯
                                                                                                    ,    n         R               :π                                    ¯
                                                                                                         n⋅f           π(R)                         ,        f
                                                    ¯                                          67                                       ¯                                                   68
¯
                   σ                                                              ¯                                                                              σ
                                                                                                                                                               T(σA≤x(R))
               A ¯                                          ¯              :(      ¯        )                                               :
V(R,A) = T(δ(π A(R)))                                                                                    E(T(σA≤x(R))) = P(A ≤ x) T(R)

E(T(σA=x(R))) = T(R) / V(R,A)                                                                                                            :
                                                                                                                                        :A = [a,b]
x                                   ,R            ¯                                                      E(T(σA≤x(R))) = (x-a)/(b-a) T(R)
                            .(      )                                             σ-
           :           ( V(R,A) = 2) a,b                ¯          A      ¯             ,                    : a1< a2 < ⋅ ⋅ ⋅ <an   ¯ A= {a1,…,an}
P(π       (R) = a)= 0.9, P(π            (R) = b)= 0.1                                                    E(T(σA≤ai(R))) = (i / n) T(R)
      A                             A
                                                 ,a,b                                  x-
E(T(σA=x(R))) = ½ T(σA=a(R)) + ½ T(σA=b(R))
                                                                                                                     :                            ,        -
              = ½ (0.9 T(R)) + ½ (0.1 T(R)) = T(R) /2                                                    T(σA≤x(R)) = ⅓T(R)
              = T(R) / V(R,A)                                                                              T(σA>x(R)) = ⅔T(R)
                                                  ¯                                                 69                                  ¯                                70




                   2                                                              ¯                                          δ                                      ¯
                                                                ? T(σ   x≤A≤y     (R))                                                R(A1,…, An) ¯
σ   x≤A≤y      (R) = σ   x≤A   (σ   A≤y   (R))                                                                                    ,T(δ(R)) = V(R)
                                                                                                                                           .      V(R)              ¯-
               "                                        2/9-
                                                                              :        "        "                                V(R , Ai ) = V(π Ai (R ))
T(σ       x≤A≤y(R))    = ⅔ T(σ          A≤y   (R)) = ⅔ ⅓ T(R) = (2/9)T(R)
                                                                                                                                1 ≤ V(R ) ≤     ∏ V(R , A )
                                                                                                                                                1≤ i ≤ n
                                                                                                                                                                i

                                                                                                                                                                     :   ¯
                                                                                                                                                     1      
                                                                                                                           V(R ) = min  ∏ V(R , Ai ), T (R )
                                                                                                                                       1≤i ≤ n       2      
                                                  ¯                                                 71                                  ¯                                72
S(Y,Z)       R(X,Y)                                  ¯                  S(Y,Z)        R(X,Y)                                ¯
                                                           :                                                                  :
                                                 ¯         ¯ Y                                                          ¯    ¯ Y
                    p(y1)≥… ≥ p(yn) - ¯                   Y ¯               p(y1)≥… ≥ p(yn)                                Y ¯
                      y1,…,yn                            Y ¯                 y1,…,yn                                       Y ¯
            yi∈ V(Y,R) ⇐ yi+1∈ V(Y,R) ,              ¯                               yi∈ V(Y,R) ⇐ yi+1∈ V(Y,R) ,         ¯
                                                                                      πY(S) ⊆ πY(R)    V(S,Y) ≤ V(R,Y)          ¯
                                                               :                        πX(R     S) = πX(R)         : ¯
 e, t, a, o, …, q, z                                       ¯                                                  R       ¯     ¯
   (            z- ,                     e)      ¯                                                 S      ¯     ¯ ,
                  . "                         ¯ Y
     e,t,a ∈ V(Y,R)         o ∈ V(Y,R)

                             ¯                                     73                                    ¯                          74




S(Y,Z)       R(X,Y)                                  ¯
                          :¯       V(S,Y) ≤ V(R,Y)                                R(X,Y)        S(Y,Z)       U(Z,W)             :
       1/ V(R,Y)         r∈R, s∈S
                                                                                  R(X,Y)          S(Y,Z)          U(Z,W)
          R-       T(R)/ V(R,Y)         s        
               E(T(R    S)) = T(S)⋅T(R)/V(R,Y)                                    T(R)=1000       T(S)=2000       T(U)=5000

                                                                                  V(R,Y) = 20     V(S,Y) = 50
                                      ,V(S,Y)>V(R,Y)
                    E(T(R    S)) = T(S)⋅T(R)/V(S,Y)                                              V(S,Z) = 100    V(U,Z) = 500


                                            : ¯                                                           :R(X,Y)   S(Y,Z) ,
    E(T(R      S)) = T(S)⋅T(R)/max{V(S,Y),V(R,Y)}                       E(T(R   S))        = T(S) ⋅ T(R)/max{V(S,Y),V(R,Y)}
                                                                                           = 2,000 × 1,000 / 50 = 40,000

                             ¯                                     75                                    ¯                          76
T((R(X,Y)                           S(Y,Z)) U(Z,W)) ¯                                 T(R(X,Y)                   (S(Y,Z))                  U(Z,W))) ¯
T((R      S)         U)                                                                  T (S      U) = T(S) × T(U) / max{V(S, Z), V(U, Z) }
        = T (R        S) T(U) /max{V (R                       S, Z), V(U, Z) }                        = 2,000 × 5,000 / 500 = 20,000

                                                     ¯                                                                                          ¯
V (R        S, Z) = V(S,Z) = 100                                                         V (S      U, Y) = V(S,Y) = 50

             V(U, Z) = 500                                                               T(R      (S     U)) = T(R)×T(S U)/max{V(R,Y),V(S U,Y)}
               T(U) = 5,000                                                                                  = 1,000×20,000/max{20, 50} = 400,000
                                                                               :¯
T ((R       S)      U) = 40,000 × 5,000 / max{100, 500}                                    ¯                                 ,(R       S)     U=R           (S     U)            ¯
                       = 400,000

                                               ¯                                    77                                             ¯                                        78




                                                                       ¯                                                                                         ¯
                                             A={a1<…<an}                                                                    R(day, month, weather)
                       ai∈A                                                                         .T(πweather(σ month=Jan(R))           πweather( σ month=July(R)))
        ni =T(σR(A)=ai(R))
                                                                                                    "¯           31       π weather(σJuly(R))       πweather(σJan(R))
                                                         :(      )σ                                      .                T = 31 × 31 / 4 ≈ 240 ¯                       ¯
        σ R (A)<x (R ) =   ∑
                           ai ≤ x
                                    ni
                                                                                               Weather   Jan     July
                                                                                                 Snow     10          0
                                                                                                                                   ,
 .             ¯      ¯                               ¯          ,         :                      Rain    15          1                                      ¯
             . ¯                         "         , ¯                              ¯             Fair       5    10
                                                                                                sunny        1    20
                                                                                                                                       .T = 15 × 1 + 5 × 10 + 1 × 20 = 85
                                               ¯                                    79                                             ¯                                        80
¯,                                                                       ¯                                                                                              ¯
                                                               w0 < w1<…< wm                                                                           ,                           ¯                       ¯
ni = T(σwi<R(A)≤w(i+1)(R))                                                                                                        .(                       )                                       ¯
                                                                             :σ
                                   σ R(A)≤ x (R) =             ∑n
                                                               ai ≤ x
                                                                        i                                                                                      ?
                                                                                                                                       .
          : (percentile)                             ,                                  ,
        {x ∈ R : x ≤ a i }    i              :                 i    ¯            ¯ a1,…,a99                               .     ¯ R(X,Y)    S(Y,Z)                 U(Z,W)                      :
                           =                                                                                                 (R     S)    U)                                                           .
             T ( R)          100
                                                                                                                          E(T(R     S)) = 40,000                               :
                        m a x {i : x ≤ a i }                                      : ¯                                        R     (S    U)                                                            .
σ   R (A ) ≤ x (R ) =                                          T (R )                                                      E(T(S     U)) = 20,000                              :
                                   100                                                                                                                                     '
                                                 ¯                                                           81                                    ¯                                                       82




                                                                        Pipeling
                                                         ,(S            U)        R                  -                                                             :

                   R                                                     S         U                ¯ .                                                            ¯
                              .(R        )
    S        U
                                                                        :pipelining                      .
                                                                                                                              U
                                                                                                                                       =   R                           ≠       R

                                                                                 ¯                                R       S                    S               U                       U           S
                                     .                                                          ¯

                                                     .     ¯                      pipeline                            .
               .                                                    ¯        ,    ¯

                                                 ¯                                                           83                                    ¯                                                       84
,          ¯ :pipeline                                        R(X,Y)        S(Y,Z)               U(Z,W)
                                                                            T(R)=1000     T(S)=2000            T(U)=5000


                                Bushy

                                                                                                           E(T(R            S))         = T(S)T(R)/max{V(S,Y),V(R,Y)}
                                                                                                                                        = 2,000 × 1,000 / 50 = 40,000
                                                                                                   U                                                  R
(                           )            n                        !n
                                                        :                            R        S                                     S            U
                  ,                                                  •
                                                                                Estimated cost = 40,000                         Estimated cost = 20,000
                  .        ¯¯                                      ¯ •
                                ¯                                      85                                                   ¯                                       86




                                                  ¯                                     (1)                                 ¯ :                   ¯
        W(A,B)            X(B,C)         Y(C,D)        Z(D,E)                                                       .                           R1=W      X
    T         100           200                  300        400                                        .                                             R1
                                                                                                                :                   "             R2 = R1      Y
    V     A: 20            B: 50             C: 50      D: 40
                                                                                                           ;                            ¯             R1
    V     B: 60           C: 100             D: 50     E: 100                                                                       ;            Y
                           W        X        Y    Z                                            ;R1         Y
                                                                                                                                            .
        ((W         X)    Y)        Z:                                                                                  :               "                 R2   Z
                                 "                                                                                              ;           R2
                             333    :R1 = W   X                                                                                     ;        Z
                            1000 :R2 = (W    X)              Y                                ;R2          Z
                           333 + 1000 = 1333                  :                                                                         .
                                ¯                                      87                                                   ¯                                       88
(2)                             ¯ :           ¯                                         (3)                               ¯ :                   ¯
                                                                                                        ¯ ,       ¯           ¯               ,R2 = R1           Y
              . "¯                10            20 ¯      ¯       ¯                                                                                                  .
                                                                                                              ?           .                                 R1
               :                      R1=W      X                                                                     ¯               ,       8
                                                 .    100/10               W                                                                           .8/2 = 4
               .(                 )         X           ¯ W                ¯                                  .                  333/10 = 34     R1
                             .          20 – 10 - 2 = 8                                             .                           2×300/10 = 60 -        Y
.                             ¯         R1     Y-                                                                         ,Y- R1      ¯
                                                                                                                              .         34 + 30 = 64         ¯
                                  100/10 = 10    :W           :                                                                                .      158 :¯"
                                  200/10 = 20    :X                                                                             , ¯ Y
                                           30    :  ¯"                                                                                      .     (300/10)/4 = 8
                                                                                                         .R1                              ¯
                                         ¯                                     89                                                  ¯           .       10       —
                                                                                                                                                                90




        (4)                             ¯ :           ¯                                         (5)                               ¯ :               ¯
                              .               ,R2    Z                                                                                                                   ¯"
         .                  10-           ,    5- R2                                                                                           30                R1
                        .     1000/10 = 100                                ¯                                                                  158                R2
                    .     2×400/10 = 80 .   5 Z                                                                                               100                R2
                                                                                                                                               80                 Z
                                                      :Z    ¯                                                                                 140
                              .R2                    , ¯      ¯                                                               .               508
    .    ¯          ¯ ¯      ¯ ,             40/5 = 8 ¯ Z            ¯
                     .R2                                                                        ,                                         ¯             ¯
                                                                                                                                                    .                    ¯
                        .Z              R2 ¯
                                         .   40 + 100 = 140       ¯"                .   ¯   ¯             ¯"              ,                                          :

                                         ¯                                     91                                                 ¯                                           92
¯
                                                                                              ¯                          ¯
                        ,                                                                               .(           )
                                                                .
                                 ¯                                  query optimizer        ¯      " (            )
                                                        .                                 ¯        ,
  (           ,          ¯)                                                           ,                      ¯               ¯
                        (evaluation)                                      .
                            ¯                               .       ¯
        (?            ?            )       ¯
  (?                          )        ¯       ¯
?pipelining
                                                                              (                     )
                  ¯                                93                                     ¯                                      94

More Related Content

What's hot

קיבוץ ניר יצחק
 קיבוץ ניר יצחק קיבוץ ניר יצחק
קיבוץ ניר יצחקnir yitzhak
 
C:\Documents And Settings\User\שולחן העבודה\חומרים לפרסומים קטנים ברשת משפט...
C:\Documents And Settings\User\שולחן העבודה\חומרים לפרסומים קטנים ברשת   משפט...C:\Documents And Settings\User\שולחן העבודה\חומרים לפרסומים קטנים ברשת   משפט...
C:\Documents And Settings\User\שולחן העבודה\חומרים לפרסומים קטנים ברשת משפט...DvoraHarell
 
Position paper cars august 11, 2011
Position paper cars august 11, 2011Position paper cars august 11, 2011
Position paper cars august 11, 2011Anochi.com.
 
המורה במלכודת האינטימיות ברשת
המורה במלכודת האינטימיות ברשתהמורה במלכודת האינטימיות ברשת
המורה במלכודת האינטימיות ברשתeshnav
 
חוברת לבנה סופי ספטמבר 2008
חוברת לבנה סופי ספטמבר 2008חוברת לבנה סופי ספטמבר 2008
חוברת לבנה סופי ספטמבר 2008Jacob Gutman
 
פמיניזם לסבי והתנועה לזכויות הומואים
פמיניזם לסבי והתנועה לזכויות הומואים פמיניזם לסבי והתנועה לזכויות הומואים
פמיניזם לסבי והתנועה לזכויות הומואים noamiller
 
Library In ayalon Mall
Library In ayalon MallLibrary In ayalon Mall
Library In ayalon Mallerantamir
 
Sadarah Ab 015 جداول × نماذج
Sadarah Ab 015   جداول × نماذجSadarah Ab 015   جداول × نماذج
Sadarah Ab 015 جداول × نماذجAbdullah Ali
 
Calcalist ifrs
Calcalist ifrsCalcalist ifrs
Calcalist ifrsEhud Lurie
 
Library in a shopping Mall
Library in a shopping MallLibrary in a shopping Mall
Library in a shopping Mallerantamir
 
Thai Chinese English Translator
Thai Chinese English TranslatorThai Chinese English Translator
Thai Chinese English TranslatorCNX Translation
 
Sadarah Ab 001.. التدريب والتدوير
Sadarah Ab 001.. التدريب والتدويرSadarah Ab 001.. التدريب والتدوير
Sadarah Ab 001.. التدريب والتدويرAbdullah Ali
 
מסמך 12- Google Docs
מסמך 12- Google Docsמסמך 12- Google Docs
מסמך 12- Google DocsDganit Hartman
 
La fiscalía y el gobierno están en mora de proteger a las víctimas en los cas...
La fiscalía y el gobierno están en mora de proteger a las víctimas en los cas...La fiscalía y el gobierno están en mora de proteger a las víctimas en los cas...
La fiscalía y el gobierno están en mora de proteger a las víctimas en los cas...Comisión Colombiana de Juristas
 
תפקיד היועץ לשיתוף הציבור בתהליכי תכנון סטטוטוריים בישראל היום
תפקיד היועץ לשיתוף הציבור בתהליכי תכנון סטטוטוריים בישראל היוםתפקיד היועץ לשיתוף הציבור בתהליכי תכנון סטטוטוריים בישראל היום
תפקיד היועץ לשיתוף הציבור בתהליכי תכנון סטטוטוריים בישראל היוםJonathan Heyman
 
01/28/13 US Supreme Court Response (tamil)
01/28/13 US Supreme Court Response  (tamil)01/28/13 US Supreme Court Response  (tamil)
01/28/13 US Supreme Court Response (tamil)VogelDenise
 

What's hot (20)

פניה למינהל ולשר השיכון 24.12.09
פניה למינהל ולשר השיכון 24.12.09פניה למינהל ולשר השיכון 24.12.09
פניה למינהל ולשר השיכון 24.12.09
 
קיבוץ ניר יצחק
 קיבוץ ניר יצחק קיבוץ ניר יצחק
קיבוץ ניר יצחק
 
C:\Documents And Settings\User\שולחן העבודה\חומרים לפרסומים קטנים ברשת משפט...
C:\Documents And Settings\User\שולחן העבודה\חומרים לפרסומים קטנים ברשת   משפט...C:\Documents And Settings\User\שולחן העבודה\חומרים לפרסומים קטנים ברשת   משפט...
C:\Documents And Settings\User\שולחן העבודה\חומרים לפרסומים קטנים ברשת משפט...
 
Position paper cars august 11, 2011
Position paper cars august 11, 2011Position paper cars august 11, 2011
Position paper cars august 11, 2011
 
המורה במלכודת האינטימיות ברשת
המורה במלכודת האינטימיות ברשתהמורה במלכודת האינטימיות ברשת
המורה במלכודת האינטימיות ברשת
 
חוברת לבנה סופי ספטמבר 2008
חוברת לבנה סופי ספטמבר 2008חוברת לבנה סופי ספטמבר 2008
חוברת לבנה סופי ספטמבר 2008
 
פמיניזם לסבי והתנועה לזכויות הומואים
פמיניזם לסבי והתנועה לזכויות הומואים פמיניזם לסבי והתנועה לזכויות הומואים
פמיניזם לסבי והתנועה לזכויות הומואים
 
Library In ayalon Mall
Library In ayalon MallLibrary In ayalon Mall
Library In ayalon Mall
 
Sadarah Ab 015 جداول × نماذج
Sadarah Ab 015   جداول × نماذجSadarah Ab 015   جداول × نماذج
Sadarah Ab 015 جداول × نماذج
 
Car2go
Car2goCar2go
Car2go
 
Calcalist ifrs
Calcalist ifrsCalcalist ifrs
Calcalist ifrs
 
Library in a shopping Mall
Library in a shopping MallLibrary in a shopping Mall
Library in a shopping Mall
 
Thai Chinese English Translator
Thai Chinese English TranslatorThai Chinese English Translator
Thai Chinese English Translator
 
Y 7 eng_2_boys
Y 7 eng_2_boysY 7 eng_2_boys
Y 7 eng_2_boys
 
Sadarah Ab 001.. التدريب والتدوير
Sadarah Ab 001.. التدريب والتدويرSadarah Ab 001.. التدريب والتدوير
Sadarah Ab 001.. التدريب والتدوير
 
How to maket yourself ?
How to maket yourself ?How to maket yourself ?
How to maket yourself ?
 
מסמך 12- Google Docs
מסמך 12- Google Docsמסמך 12- Google Docs
מסמך 12- Google Docs
 
La fiscalía y el gobierno están en mora de proteger a las víctimas en los cas...
La fiscalía y el gobierno están en mora de proteger a las víctimas en los cas...La fiscalía y el gobierno están en mora de proteger a las víctimas en los cas...
La fiscalía y el gobierno están en mora de proteger a las víctimas en los cas...
 
תפקיד היועץ לשיתוף הציבור בתהליכי תכנון סטטוטוריים בישראל היום
תפקיד היועץ לשיתוף הציבור בתהליכי תכנון סטטוטוריים בישראל היוםתפקיד היועץ לשיתוף הציבור בתהליכי תכנון סטטוטוריים בישראל היום
תפקיד היועץ לשיתוף הציבור בתהליכי תכנון סטטוטוריים בישראל היום
 
01/28/13 US Supreme Court Response (tamil)
01/28/13 US Supreme Court Response  (tamil)01/28/13 US Supreme Court Response  (tamil)
01/28/13 US Supreme Court Response (tamil)
 

Similar to 08 relations-x4

Qa Measurements 2009 Comverse Upload
Qa Measurements 2009 Comverse UploadQa Measurements 2009 Comverse Upload
Qa Measurements 2009 Comverse UploadRam Yonish
 
Corporate Social Responsibility (CSR) in Israel’s Financial Sector
Corporate Social Responsibility (CSR) in Israel’s Financial SectorCorporate Social Responsibility (CSR) in Israel’s Financial Sector
Corporate Social Responsibility (CSR) in Israel’s Financial SectorYuvalBu
 
Position paper cars august 11, 2011
Position paper cars august 11, 2011Position paper cars august 11, 2011
Position paper cars august 11, 2011Anochi.com.
 
מדיניות עירונית ומהגרי עבודה
מדיניות עירונית ומהגרי עבודהמדיניות עירונית ומהגרי עבודה
מדיניות עירונית ומהגרי עבודהJonathan Heyman
 
Qiryat yam tender 1st page
Qiryat yam tender 1st pageQiryat yam tender 1st page
Qiryat yam tender 1st pageTashtiot media
 
שרותי הנדסה
 שרותי הנדסה  שרותי הנדסה
שרותי הנדסה tuli29
 
Lil riding hood safe path
Lil riding hood safe pathLil riding hood safe path
Lil riding hood safe pathYuval Esroni
 
שרותי הנדסה
שרותי הנדסה שרותי הנדסה
שרותי הנדסה tuli29
 
שרותי הנדסה
שרותי הנדסה שרותי הנדסה
שרותי הנדסה tuli29
 
הזמנה לאסיפה כללית 2009
הזמנה לאסיפה כללית 2009הזמנה לאסיפה כללית 2009
הזמנה לאסיפה כללית 2009roishlo
 
Near Shore Testing - Israel
Near Shore Testing - IsraelNear Shore Testing - Israel
Near Shore Testing - IsraelRam Yonish
 
עדכונים וחדשות לקראת קיץ לוהט
עדכונים וחדשות לקראת קיץ לוהטעדכונים וחדשות לקראת קיץ לוהט
עדכונים וחדשות לקראת קיץ לוהטEl HaLev
 
The International Judicial struggle against Sexual Trafficking of Women and C...
The International Judicial struggle against Sexual Trafficking of Women and C...The International Judicial struggle against Sexual Trafficking of Women and C...
The International Judicial struggle against Sexual Trafficking of Women and C...YuvalBu
 
חגיגת הוקרה לחברים של אל הלב
חגיגת הוקרה לחברים של אל הלבחגיגת הוקרה לחברים של אל הלב
חגיגת הוקרה לחברים של אל הלבEl HaLev
 

Similar to 08 relations-x4 (18)

Qa Measurements 2009 Comverse Upload
Qa Measurements 2009 Comverse UploadQa Measurements 2009 Comverse Upload
Qa Measurements 2009 Comverse Upload
 
Corporate Social Responsibility (CSR) in Israel’s Financial Sector
Corporate Social Responsibility (CSR) in Israel’s Financial SectorCorporate Social Responsibility (CSR) in Israel’s Financial Sector
Corporate Social Responsibility (CSR) in Israel’s Financial Sector
 
Position paper cars august 11, 2011
Position paper cars august 11, 2011Position paper cars august 11, 2011
Position paper cars august 11, 2011
 
מדיניות עירונית ומהגרי עבודה
מדיניות עירונית ומהגרי עבודהמדיניות עירונית ומהגרי עבודה
מדיניות עירונית ומהגרי עבודה
 
Qiryat yam tender 1st page
Qiryat yam tender 1st pageQiryat yam tender 1st page
Qiryat yam tender 1st page
 
שרותי הנדסה
 שרותי הנדסה  שרותי הנדסה
שרותי הנדסה
 
Lil riding hood safe path
Lil riding hood safe pathLil riding hood safe path
Lil riding hood safe path
 
שרותי הנדסה
שרותי הנדסה שרותי הנדסה
שרותי הנדסה
 
שרותי הנדסה
שרותי הנדסה שרותי הנדסה
שרותי הנדסה
 
הזמנה לאסיפה כללית 2009
הזמנה לאסיפה כללית 2009הזמנה לאסיפה כללית 2009
הזמנה לאסיפה כללית 2009
 
Near Shore Testing - Israel
Near Shore Testing - IsraelNear Shore Testing - Israel
Near Shore Testing - Israel
 
מכרזי ישן מול חדש ודיור בר השגה
מכרזי ישן מול חדש ודיור בר השגהמכרזי ישן מול חדש ודיור בר השגה
מכרזי ישן מול חדש ודיור בר השגה
 
עדכונים וחדשות לקראת קיץ לוהט
עדכונים וחדשות לקראת קיץ לוהטעדכונים וחדשות לקראת קיץ לוהט
עדכונים וחדשות לקראת קיץ לוהט
 
The International Judicial struggle against Sexual Trafficking of Women and C...
The International Judicial struggle against Sexual Trafficking of Women and C...The International Judicial struggle against Sexual Trafficking of Women and C...
The International Judicial struggle against Sexual Trafficking of Women and C...
 
חגיגת הוקרה לחברים של אל הלב
חגיגת הוקרה לחברים של אל הלבחגיגת הוקרה לחברים של אל הלב
חגיגת הוקרה לחברים של אל הלב
 
מצגת ציפוף עירוני בירושלים הקואלציה לשימור הרי ירושלים
מצגת ציפוף עירוני בירושלים   הקואלציה לשימור הרי ירושליםמצגת ציפוף עירוני בירושלים   הקואלציה לשימור הרי ירושלים
מצגת ציפוף עירוני בירושלים הקואלציה לשימור הרי ירושלים
 
Advocacy
AdvocacyAdvocacy
Advocacy
 
Mylife
MylifeMylife
Mylife
 

Recently uploaded

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 

Recently uploaded (20)

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

08 relations-x4

  • 1. . . . ¯ 234322 8 : . . .( ) ¯. . ¯. . ¯ ¯. ¯ 1 ¯ 2 ( ) , . ¯ ¯ , . .(n-tuple) -n , ¯ ¯ ¯ ¯ ( ) : (domain) . ¯ 20 ¯ (99999- 10000 ¯) (31.12.2999 -1.1.1900) ¯– ¯ 3 ¯ 4
  • 2. ( , ) (multiset, bag) - :(relation) prophets - : . ¯ ¯ { , - , }- :(attributes ) ¯ prophets -500 52 . , ¯ :(relation scheme) ¯ -550 66 : -700 55 Prophets(chapters, birth_year, name) -200 4 Branch(b_name, assets, b_city) Customer(c_name, street, c_city) -400 48 Deposit(b_name, account_number, customer_name, balance) prophets ⊆ string × date × integers Borrow(b_name, loan_number, loan_number, c_name, amount) ¯ 5 ¯ 6 ( ) , ¯, ¯ , ¯ . :SQL- , ¯ , . SELECT name FROM Prophets , WHERE birth_year<-500; ( ¯ ) . ¯ . SQL- .( ¯ C ¯ ) ¯ 7 ¯ 8
  • 3. ¯ . ¯ ¯, , ¯ , , , –× ∩∪ • ) , ¯ – select • – (projection) –π • .( ¯ – π A→B • . - ¯ ¯ , ( ¯ ) –δ • – join • ¯ ¯ – sort • , (? ¯) ¯ – max, min, average, sum • – count • ¯ 9 ¯ 10 ∪ ∩ A1 A2 A3 R ∪ S = {r: r ∈ R or r ∈ S} R ∩ S = {r: r ∈ R and r ∈ S} ¯ a b c A1 A2 A3 R A1 A2 A3 S A1 A2 A3 R d e f a b c a b c a b c c b d R∪S d e f a b c c b d c b d c b d a c e A1 A2 A3 S c b d R∩S c b d d a f A1 A2 A3 ¯ d a f a b c ¯ ¯ ¯ 11 c b d ¯ 12
  • 4. × ¯ R × S = {(r1,r2,…,rn,s1,…,sm): r ∈ R and s ∈ S} R S = {r: r ∈ R and r ∉ S} ¯ R A1 A2 A3 A1 A2 A3 B1 B2 R A1 A2 A3 S A1 A2 A3 a b c a b c a b a b c a b c a b c a b a b c a b c c b e c b d a b c b d c b d a c e a b c c b S B1 B2 a b c c b A1 A2 A3 a b R×S RS c b d c b a b c c b , ¯ ¯ c b d (R.a, S.a ) ¯ ( ) (R ) × (S ): ¯ 13 ¯ 14 select σ π projection .C select σC(R) = {r ∈ R : r satisfies C} πℓ1, ℓ2,…, ℓn(R)={(rℓ1,rℓ2,…rℓn) : (r1,…,rn) ∈ R} A1 A2 A3 σA2=b(R) R R πA1,A3(R) πA2(R) a b c A1 A2 A3 A1 A2 A3 A1 A3 A2 a b c a b c a b c a c b c b d a b c a b c a c b c c c c b d c b d c d b σa≤A2≤b(R) " [a,b] ¯ 15 ¯ 16
  • 5. join ( ) join . ¯ ¯ ¯ :A = attr(R) ∩ attr(S) ¯ S ,R join . R S = {r s : r ∈ R, s ∈ S, πA(r) = πA(s) } : : Q(name, address, tel_no) = R(name, address) S(name, tel_no) A B C A B C D C D : join a b c a b c d1 A ¯ S,R c d1 a1 b1 c a1 b1 c d1 r.A = s.A - ¯ r ∈ R, s ∈ S c2 d2 a1 b1 c1 a1 d c2 d2 s- r r s c2 d3 .A ¯ a1 d c2 a1 d c2 d3 s = (Homer Simpson, 555-2121) r = (Homer Simpson, 123 Fake St. Springfield) r s = (Homer Simpson, 123 Fake St. Springfield, 555-2121) ¯ 17 ¯ 18 (join) join . ¯ ' ¯ ¯ R ¯ S R ¯ s r . ¯ , ' ¯ ¯ S .A : ¯ R S . ¯ , ¯, , ¯ ¯ S R R S = πS∪(R/S) (σAR=A(ρA→AR(r) × s)) ¯ 19 ¯ 20
  • 6. .( ) R .R ( ) = B(R) . .R = T(R) . .V(R)=T(δ(R)) " ,R = V(R) . . ¯ = M . . ¯ ¯ (pipeline) , ¯- . , . ¯ ¯ 21 ¯ 22 . - . max, min, average Union(relation R, relation S) { forall r ∈ R { double average(relation R, column A) { read r; int count = 0; output r; value sum = 0; } forall r ∈ R { forall s ∈ S { read r; read s; sum = sum + r.A; output s; count = count + 1; } } } return sum / (double) count; B(R) + B(S) : ¯ } O(1) : ¯ B(R) : ¯ ¯ 23 ¯ 24
  • 7. δ B(δ(R)) ≤ M - 4 . S relation delta(relation R) { B(δ (S) ) ≤ M ¯ search_structure = ∅; : -4 ( ¯ R ) forall r ∈ R { read r; if (r ∉ search_structure) { SR: insert r into search_structure; . δ(S) ¯ output r; .R } . S- r ,R- r ¯ } , S ¯ } . . ¯ ¯ search_structure ¯ 25 ¯ 26 SR SR relation Difference(relation R, relation S) { S=(20, 11, 30, 20,11,11) search_structure = ∅; R=(11,40,20,11, 20, 20, 50, 40) forall s ∈ S { read s; 11:3, 20:2, 30:1 S if s ∉ search_structure { insert s into search_structure; R search_structure[s].count = 0; 11:2, 20:2, 30:1 :11 } search_structure[s].count ++; 11:2, 20:2, 30:1 :40 } forall r ∈ R { 11:2, 20:1, 30:1 :20 read r; if (r ∈ search_structure) and (search_structure[r].count > 0) 11:1, 20:1, 30:1 :11 search_structure[r].count --; } 11:1, 20:0, 30:1 :20 forall s ∈ search_structure repeat search_structure[s].count times 11:1, 20:0, 30:1 :20 output s; ¯ 27 } ¯ 28
  • 8. ¯ S ¯ ¯ ( ¯) ¯ ¯ ¯ S ¯ , S ¯ : ¯ .(A- ) ¯ B(S) + B(R) : ¯ .( ¯ ¯) R ¯ B(S) , r.A R- r ¯ (r.A = s.A ¯) s ¯ . r s ¯ 29 ¯ 30 R S R S A B B C A B B C a b1 b c1 a b1 b c1 a2 b2 b1 c2 (a,b1,c2) a2 b2 b1 c2 (a,b1,c3) a1 b1 b1 c3 a1 b1 b1 c3 a6 b3 b3 c4 a6 b3 b3 c4 a4 b3 a4 b3 ( ¯ ) a5 b3 a5 b3 ( ) ¯ 31 ¯ 32
  • 9. R S R S A B B C A B B C a b1 b c1 a b1 b c1 --- a2 b2 b1 c2 (a1,b1,c2) a2 b2 b1 c2 (a1,b1,c3) a1 b1 b1 c3 a1 b1 b1 c3 a6 b3 b3 c4 a6 b3 b3 c4 a4 b3 a4 b3 (a6,b3),(a4,b3),(a5,b3) a5 b3 a5 b3 (b3,c4) ¯ 33 ¯ 34 ¯ ¯ δ(S) ¯ : ¯ ¯ : B(S) + B(R) B(R) O(1) σ, π, B(R) + B(S) O(1) ∪ . ¯ ¯ B(R) δ(R) δ B(R) + B(S) δ(S) ×∩ ¯ – ¯ 35 ¯ 36
  • 10. nested loops .( ) : . for each tuple s in S { read s; . for each tuple r in R { . read r; . process tuples r and s } } T(S)T(R) : ¯ T(S)B(R) R : ¯ 37 ¯ 38 : join ¯ .S ¯ M-4 ¯ for each tuple s in S { read s; : for each tuple r in R { S M-4 ( ¯ )R ¯ read r; R- r ¯ if s and r join to make a tuple t s ¯ ¯ S output t; r.A = s.A : } r s } T(S)B(R) : ¯ (M-4) + B(R) : ¯ B(S)/(M-4)  : ¯ 39 ¯ 40
  • 11. : ¯ (M-4) + B(R) : while (S is not exhausted) { B(S)/(M-4)  : read the next M-4 blocks of S and put them in a search structure ordered by A; : ¯ forall blocks b of R { read block b; B(S)/(M-4) ((M-4) + B(R)) = B(S) + B(S) B(R) /(M-4) forall tuples r in b { ≅ B(S) B(R) / M search r.A in the search structure; forall tuple s found output s r; M >> 4 } , } ? .R } ¯ 41 ¯ 42 .( ) . ¯ . ,( ) S- R . .R S .R r- S s ¯ ¯ . ( ) r >s . .( )S s .R r r <s ,r=s . s r ? ¯ 43 ¯ 44
  • 12. ‫היכן השתמשנו‬ ?M ‫בהנחה על‬ ¯ : S- R- ¯ ,A S- R- .|σA=a(S)| > M A a .R S ¯ .R r- S s ¯ ¯ S s πA(r) >πA(s) 1 B(R) δ R r πA(r) <πA(s) 1 1 Min, Max πA(s’) =πA(s) S ¯ ¯ :πA(r’) =πA(s) R r’ ¯ *2 B(S)+B(R) ∩ , ∪, / ( ) r’ s’ ¯ s’ ¯ *2 B(S)+B(R) B(S) + B(R) : ¯ B(S R) : ¯ ¯ ¯ ¯, ¯ * ¯ 45 ¯ 46 : .( ) : ¯ ¯ . . ¯ . . (hash) ¯ ; ¯ ¯ . . ¯ : ¯ , , ¯ . ¯ ¯ 47 ¯ 48
  • 13. δ 53,42,73,81,22,53,91,61,53,11,92,91 : , ¯ .( ) : , , 1: 81,91,61,11,91 . k- ¯ 2: 42,22,92 3: 53,73,53,53 : , ¯ ¯ : ¯ . ¯ : ¯ ¯ ( ) ¯ M :( ¯ ) δ k 1: 81,91,61,11,91 2: 42,22,92 ?‫למה צריך יותר ממעבר אחד‬ M ≥ 2k + 2 : 3: 53,73,53,53 ‫למה לא לסלק את הכפולים‬ k ≤ M/2 -1 " ?‫כאשר מנסים להכניסם לדלי‬ ¯ 49 ¯ 50 : δ : δ . ( ) B(R) ¯¯ : ¯ ¯ ( ¯, ) B(R) > M , k= M/2-1 - . : , k- ¯ , . ¯ : ... . ¯ .M k- ¯ h- .( ¯ ¯) δ h = logk(B(R)/M)  : M≥ ⇐ ¯ ¯ ¯ (2h+1)B(R) : ¯ ,B(R)/k ≤ M M  M 2 B ( R ) ≤ kM = M  − 1 ≈  2  2 ¯ 3B(R) , ¯ 51 ¯ 52
  • 14. for all s ∈ S : write s to bucket BS[h(s)]; 2B(S) S for all r ∈ R write r to bucket BR[h(r)]; 2B(R) R B(S) S . ¯ ¯ BR[i]- BS[i] ,i ¯ B(R) R for i=1 to number_of_buckets { 3B(S) + 3B(R) ¯" find the intersection of Bs[i] and Br[i] using the single pass algorithm and produce the sub-relation Ti output Ti } ¯ 53 ¯ 54 ¯ ¯ A : B ≤ M2 / 2 h(s.A) " S1,…Sk S 3B(R) δ 2B(S) B(Si) ≤ M :i ¯ ¯ 3B(S) + 3B(R) '¯ , , 2B(R) h(r.A) " R1,…Rk R (? ¯) Ri Si i=1,..,k Σi(B(Si)+B(Ri)) (? ) 5- 3 , B 3B(S)+3B(R) ¯" ¯ 55 ¯ 56
  • 15. . ¯ .( ) . a≤x≤b C(x) ¯ σC : . . . :R S ¯ : . .R- S- ¯ O(T(S)) : ¯ . R ¯ ¯ ¯ , S : . ,R ¯ 57 ¯ 58 ¯ .Y ,S S(X,Y) R(Y,Z) , ¯ . ¯ , r∈R ¯ , ¯ ¯ S- r.Y . s.Y = r.Y s∈S ¯ . s r : ¯ ¯ .(' ¯ , , ) .B(R) :R S T(S)/V(S,Y) r.Y ¯ :( ¯ ) ¯ (S- Y ¯ V(S,Y) ¯) T(R) T(S)/V(S,Y) :¯" . ¯ 59 ¯ 60
  • 16. : , ¯ ¯ ¯ π name,addr(σ title =“Gone…”, gender = F(MovieStar StarsIn)) : πname,addr(σtitle=“gone with the wind” and gender = F (MovieStar StarsIn)) : ¯ πname,addr πname,addr MovieStar(name, addr, gender), StarsIn(title, year, name) σ title=“Gone…” and gender = F " " ¯ . ¯ σ gender = F σ title=“Gone…” SELECT name, addr FROM MovieStar, StarsIn MovieStar StarsIn MovieStar StarsIn WHERE title=“gone with the wind” and gender=F and MovieStar.name=StarsIn.name; π name,addr (σ gender = F(MovieStar) σ title=“Gone…” (StarsIn)) ¯ 61 ¯ 62 : , : , (R S) T=R (S T) . ¯ ¯ : . R S= S R : σ title =“Gone…”, gender = F(MovieStar StarsIn)) = σC(R ∩ S) = σC(R) ∩ S = R ∩ σC(S) = σC(R) ∩ σC(S) σ gender = F(MovieStar) σ title=“Gone…” (StarsIn) : (? ) σ gender = F σ C(R S) = σC(R) S=R σC(S) = σC(R) σC(S) σ title=“Gone…” . ¯ ¯ ¯ ¯ 63 ¯ 64
  • 17. : ¯ Movie(title, year, studio) , StarsIn(title, year, name) : π name,studio (σ year = 1996(Movie) StarsIn) , . ¯ ¯ πname,studio πname,studio ? π- ¯ , ¯ σ year=1996 StarsIn σ year=1996 σ year=1996 . . ¯ , Movie Movie StarsIn π name,studio (σ year = 1996(Movie) σ year = 1996 (StarsIn)) ¯ 65 ¯ 66 δ ¯ , δ ... , . ¯¯ ¯ , ¯- , ¯ δ(R S) = δ (δ(R) S) , ¯ = δ (R δ(S)) . = δ(R) δ(S) , - ,¯" , δ, ¯ . ¯ ¯ . ¯ ¯ , n R :π ¯ n⋅f π(R) , f ¯ 67 ¯ 68
  • 18. ¯ σ ¯ σ T(σA≤x(R)) A ¯ ¯ :( ¯ ) : V(R,A) = T(δ(π A(R))) E(T(σA≤x(R))) = P(A ≤ x) T(R) E(T(σA=x(R))) = T(R) / V(R,A) : :A = [a,b] x ,R ¯ E(T(σA≤x(R))) = (x-a)/(b-a) T(R) .( ) σ- : ( V(R,A) = 2) a,b ¯ A ¯ , : a1< a2 < ⋅ ⋅ ⋅ <an ¯ A= {a1,…,an} P(π (R) = a)= 0.9, P(π (R) = b)= 0.1 E(T(σA≤ai(R))) = (i / n) T(R) A A ,a,b x- E(T(σA=x(R))) = ½ T(σA=a(R)) + ½ T(σA=b(R)) : , - = ½ (0.9 T(R)) + ½ (0.1 T(R)) = T(R) /2 T(σA≤x(R)) = ⅓T(R) = T(R) / V(R,A) T(σA>x(R)) = ⅔T(R) ¯ 69 ¯ 70 2 ¯ δ ¯ ? T(σ x≤A≤y (R)) R(A1,…, An) ¯ σ x≤A≤y (R) = σ x≤A (σ A≤y (R)) ,T(δ(R)) = V(R) . V(R) ¯- " 2/9- : " " V(R , Ai ) = V(π Ai (R )) T(σ x≤A≤y(R)) = ⅔ T(σ A≤y (R)) = ⅔ ⅓ T(R) = (2/9)T(R) 1 ≤ V(R ) ≤ ∏ V(R , A ) 1≤ i ≤ n i : ¯  1  V(R ) = min  ∏ V(R , Ai ), T (R ) 1≤i ≤ n 2  ¯ 71 ¯ 72
  • 19. S(Y,Z) R(X,Y) ¯ S(Y,Z) R(X,Y) ¯ : : ¯ ¯ Y ¯ ¯ Y p(y1)≥… ≥ p(yn) - ¯ Y ¯ p(y1)≥… ≥ p(yn) Y ¯ y1,…,yn Y ¯ y1,…,yn Y ¯ yi∈ V(Y,R) ⇐ yi+1∈ V(Y,R) , ¯ yi∈ V(Y,R) ⇐ yi+1∈ V(Y,R) , ¯ πY(S) ⊆ πY(R) V(S,Y) ≤ V(R,Y) ¯ : πX(R S) = πX(R) : ¯ e, t, a, o, …, q, z ¯ R ¯ ¯ ( z- , e) ¯ S ¯ ¯ , . " ¯ Y e,t,a ∈ V(Y,R) o ∈ V(Y,R) ¯ 73 ¯ 74 S(Y,Z) R(X,Y) ¯ :¯ V(S,Y) ≤ V(R,Y) R(X,Y) S(Y,Z) U(Z,W) : 1/ V(R,Y) r∈R, s∈S R(X,Y) S(Y,Z) U(Z,W) R- T(R)/ V(R,Y) s  E(T(R S)) = T(S)⋅T(R)/V(R,Y)  T(R)=1000 T(S)=2000 T(U)=5000 V(R,Y) = 20 V(S,Y) = 50 ,V(S,Y)>V(R,Y) E(T(R S)) = T(S)⋅T(R)/V(S,Y) V(S,Z) = 100 V(U,Z) = 500 : ¯ :R(X,Y) S(Y,Z) , E(T(R S)) = T(S)⋅T(R)/max{V(S,Y),V(R,Y)} E(T(R S)) = T(S) ⋅ T(R)/max{V(S,Y),V(R,Y)} = 2,000 × 1,000 / 50 = 40,000 ¯ 75 ¯ 76
  • 20. T((R(X,Y) S(Y,Z)) U(Z,W)) ¯ T(R(X,Y) (S(Y,Z)) U(Z,W))) ¯ T((R S) U) T (S U) = T(S) × T(U) / max{V(S, Z), V(U, Z) } = T (R S) T(U) /max{V (R S, Z), V(U, Z) } = 2,000 × 5,000 / 500 = 20,000 ¯ ¯ V (R S, Z) = V(S,Z) = 100 V (S U, Y) = V(S,Y) = 50 V(U, Z) = 500 T(R (S U)) = T(R)×T(S U)/max{V(R,Y),V(S U,Y)} T(U) = 5,000 = 1,000×20,000/max{20, 50} = 400,000 :¯ T ((R S) U) = 40,000 × 5,000 / max{100, 500} ¯ ,(R S) U=R (S U) ¯ = 400,000 ¯ 77 ¯ 78 ¯ ¯ A={a1<…<an} R(day, month, weather) ai∈A .T(πweather(σ month=Jan(R)) πweather( σ month=July(R))) ni =T(σR(A)=ai(R)) "¯ 31 π weather(σJuly(R)) πweather(σJan(R)) :( )σ . T = 31 × 31 / 4 ≈ 240 ¯ ¯ σ R (A)<x (R ) = ∑ ai ≤ x ni Weather Jan July Snow 10 0 , . ¯ ¯ ¯ , : Rain 15 1 ¯ . ¯ " , ¯ ¯ Fair 5 10 sunny 1 20 .T = 15 × 1 + 5 × 10 + 1 × 20 = 85 ¯ 79 ¯ 80
  • 21. ¯, ¯ ¯ w0 < w1<…< wm , ¯ ¯ ni = T(σwi<R(A)≤w(i+1)(R)) .( ) ¯ :σ σ R(A)≤ x (R) = ∑n ai ≤ x i ? . : (percentile) , , {x ∈ R : x ≤ a i } i : i ¯ ¯ a1,…,a99 . ¯ R(X,Y) S(Y,Z) U(Z,W) : = (R S) U) . T ( R) 100 E(T(R S)) = 40,000 : m a x {i : x ≤ a i } : ¯ R (S U) . σ R (A ) ≤ x (R ) = T (R ) E(T(S U)) = 20,000 : 100 ' ¯ 81 ¯ 82 Pipeling ,(S U) R - : R S U ¯ . ¯ .(R ) S U :pipelining . U = R ≠ R ¯ R S S U U S . ¯ . ¯ pipeline . . ¯ , ¯ ¯ 83 ¯ 84
  • 22. , ¯ :pipeline R(X,Y) S(Y,Z) U(Z,W) T(R)=1000 T(S)=2000 T(U)=5000 Bushy E(T(R S)) = T(S)T(R)/max{V(S,Y),V(R,Y)} = 2,000 × 1,000 / 50 = 40,000 U R ( ) n !n : R S S U , • Estimated cost = 40,000 Estimated cost = 20,000 . ¯¯ ¯ • ¯ 85 ¯ 86 ¯ (1) ¯ : ¯ W(A,B) X(B,C) Y(C,D) Z(D,E) . R1=W X T 100 200 300 400 . R1 : " R2 = R1 Y V A: 20 B: 50 C: 50 D: 40 ; ¯ R1 V B: 60 C: 100 D: 50 E: 100 ; Y W X Y Z ;R1 Y . ((W X) Y) Z: : " R2 Z " ; R2 333 :R1 = W X ; Z 1000 :R2 = (W X) Y ;R2 Z 333 + 1000 = 1333 : . ¯ 87 ¯ 88
  • 23. (2) ¯ : ¯ (3) ¯ : ¯ ¯ , ¯ ¯ ,R2 = R1 Y . "¯ 10 20 ¯ ¯ ¯ . ? . R1 : R1=W X ¯ , 8 . 100/10 W .8/2 = 4 .( ) X ¯ W ¯ . 333/10 = 34 R1 . 20 – 10 - 2 = 8 . 2×300/10 = 60 - Y . ¯ R1 Y- ,Y- R1 ¯ . 34 + 30 = 64 ¯ 100/10 = 10 :W : . 158 :¯" 200/10 = 20 :X , ¯ Y 30 : ¯" . (300/10)/4 = 8 .R1 ¯ ¯ 89 ¯ . 10 — 90 (4) ¯ : ¯ (5) ¯ : ¯ . ,R2 Z ¯" . 10- , 5- R2 30 R1 . 1000/10 = 100 ¯ 158 R2 . 2×400/10 = 80 . 5 Z 100 R2 80 Z :Z ¯ 140 .R2 , ¯ ¯ . 508 . ¯ ¯ ¯ ¯ , 40/5 = 8 ¯ Z ¯ .R2 , ¯ ¯ . ¯ .Z R2 ¯ . 40 + 100 = 140 ¯" . ¯ ¯ ¯" , : ¯ 91 ¯ 92
  • 24. ¯ ¯ ¯ , .( ) . ¯ query optimizer ¯ " ( ) . ¯ , ( , ¯) , ¯ ¯ (evaluation) . ¯ . ¯ (? ? ) ¯ (? ) ¯ ¯ ?pipelining ( ) ¯ 93 ¯ 94