Professional Documents
Culture Documents
croSS- Preduct
as a
Cam be dettmed
A jotn
folloed by selecttoy a d projectto).
the follang
though
mplemented
Jotns can be
9ethcls
Algovithm
tuple e R do
do
for each
se S do
each tupe
for
the
and outPL
Se 5, he check R
fox each tupe
atuple 2i,s> for aualttving tupleso
s used anautpul
secome)
extra buffer page
The
buffOs
Algovithm
B -2 pages of R do
fov each bleck of
S do
foreach.page C
fov al.maichng
in-emoty tuNOS
Te R-bloce am SE S-
do
shile T+ec a G T
while s do
aftey 7a
Ta e 1t tudein R
while ;
Cas do
atler 9s
Gs-Deat tuple in S
T s
a0
kobiie T 9s;
is
a l e y cn ene ot the elatrcs5
thee
If
JOin athibutet6),
ttel6), we cor tCKe odvoytof*
on the
3mari9
toBENed Teatton bet e
the index by
er dNS
pos Ne have a Guitoble
AlgovitHm
each uple Ae R do
for
whee sS
each tuple s e S
fov
add A,6> to TeSu
Alacrithm:
on
atrdbu
be , Sostt .
7ot Sosted
If S at t
on
attrubU e J,
sorted
t S is t
fapao
a k o d u a )
ooholusa
nooV| 3aban
nuruDo
AaMÓuoq)
amoD
AanGQDO) a s n ) PaSno
posaasnD)
unou auhad) aA)
daao aamsno )
o R q u a u s h a l )
AeqLof uanboga d-a
estios
Quey optimi2attc)
frCCOSS 4
cverall
the
is
uesy ptimizatrem
T c a n S o e o l u t i r g
ase
ueTy Parsos
.QueTy Optcmi2Er
.3. ueY Plan Evatuatoo -
iOY
the gtven
Tt
Puesy pavses -
parses
cesmpcrS
tuo
comp+Ses of
It
-
uesy opttmizos
uesy plan GeTOTatos
EStJats
ccet Gee
uesy plan
the COBtef e a h
t o s t l n a t o s
t e yuOsy.
e x e t i o n plCDAL
8. ueTY Plan Evaluato
evaluartt9
the best plam teT
Tt select
the uOTY
ueTy
uesy Pase
Porsec uesy
u e T y optimicOO.
ueTY catalcg
Ques plaxnccest
Pam
Estimatoo|| maroggs
Generator
Evaluaticn pa)
u e r y Evaluation PlanD-
plam
cocmSists of a n extenmkd
e v a l Uaticn
A yueTy
amDotations
addittoal
a S ratirg >
bd tco
Samee
bid = tcOATattng>5
Relatioal
algebra-tKO
A (Sinple Nesled
sidsid tcopji
ScaTlor
Rese Ves
Sid 6 d
atig5
ReseveS SlorS
Sname
atim >S
Ilea esledtcops
Stl Sid
sotxsHashinreon
bid =1co
sid
PeseeS
Sum a} C otsS
COstS
Surr a
The ccet oi a
the
plan te
be
The Cost e a a plam coan
tmsee pasts
tades
Readtg the Imat
tobes
iate
. IteT ryed
3. Sosttmg tho tenal TOSU
Eauivalence Rules
t h a t exproS[ONs
Am eauivalence rule says
E)= (%,(¬))
E ) ) - (o,(E))
3 TT (TT Lo . CE))-) T(e)
LI
5 E ) =
E, D4E
E, E
(A E ) E E,M (ED4 E )
E, U E E0 E
E,0 E , 5, 1E
(E 0E ) VE
=
E, U(EUEz
DBMS Catalo
Stat+sttcal
The DEBMS catalog Stcres the followinq
relations
about database
infomation
A
The number ot tupleS in the r e l a t C
containing tuples
of relabio)
The number of bicckS
& in bybeS
Aa- Tthe size of a tuple ot relatton
that fit rto
relation s
The n m b e r of tuples of
+
one b l .
() LEquality predêcate
A a
unitorm
dtsbibution
of valuoS,the
assume
If We
estimated
t o ave
resut can
be
Selection
tupes
V(A4)
attribute A ot
value a aPPeas n
t h a t the
assuming
Some secod G .
A ) L Single Comparison preliccre
A
min(A,A)- lowest valuo of
max( A, A) -
hiqhest valuo A
tut
relos
numbox ot
T V min[ A, 4) then the
Satiefy E e
coelttto) is o
tatE
T e c o r d s
t h e number ofi
Tf V max( A,«) them
c o n d i t i o n is n
SatistY h e
T e s u l t tS
Then the selection
i o t O Y COSOs
V- min(A,A)
Conjunctive selection
is a selectton ci t h
Select+cn
A Coniunctive
fosm
A)
, AO, A - O
- -
s
Selectton .) s;
for each O;, the si2e of
tD tHe full
Selectton ts esttmatey
The number o tuples
as
Disjunctiye Selection:
vO,v -V,
tull Seloctton is esti0te
The umbey Of tuples in he
as
(S
- ()*(1-
5 Nogattor
-(
Join Si2e Estimatio0
be relations.
Let TR) and s(S)
estimatton
s s0O
k ' S
=9
then the joisn size
ie.
d6 C a t e s i a m pracduct
umber Of t
then tne
Tf ROS is a key tor R
tupleS in S5.
nRM S is tne nu mber
numberet
tuplS
hen the
is a key for S,
tRns
)*.
uplos
number of
RDA 5 is t h e
3
R ad s e).
to
a key for
ROS is neithe
8 nR DM S ts
tuplos
the
umbOr o
s
minimum
VCA,S vlA,K)
Roectio:
The b2e ofa pnejectiom T (4) s VA, ¢ )
A
Set cperat+ons:
is tne Sum 4
US
The estima bed si2e cf
ad s.
the s i z e s of s minimu
s is t h e
eStümated size of
The
t h e si20S of R ad s.
a toSi2e94
s eorial
The e6timated si2e o t - s
Size(A WS)
+ Szel1) t S2e Cs)
Siae (A I S)
u e y Optimiaatior
the
Quey optismiaation te the prece6s otchoosing
most efilient oyueTy evaluaticm plans for exeæuti9
the yuesy
8. Storage CoSSt
inbersediatottles
ekecution
Computatiomal Cc
tho 7emosY
t S the coet of pe7for ming
a e avaulable od
Ee Tecord otthia
operations t h a t hin
t h edata b4faS
Cosmuneat+on
coSt -
5.
Cost-based qptismizev-
Rule-basel optümcze
Cartesian paccUCt
Rule-3 : Avoid