Tuning 360

download Tuning 360

of 29

Transcript of Tuning 360

  • 8/12/2019 Tuning 360

    1/29

    Tuning: overview Rewrite SQL ( Leccotech ) Create Index Redefine Main memory tructure (S!" in #rac$e) Change the %$oc& Si'e

    Materia$i'ed iew *enorma$i'ation +x,ort-Im,ort (dro, indexe ): defragment Chec& Loc& Se,arate data .y category in ,ro,er ta.$e ,ace /artition *ata.a e Redundant "rray of Inex,en ive *i & (R"I*) Redefining C$ient0Server "rchitecture

    %uy 1ardware

    http://www.orafaq.com/tools/leccotech/sqlexpert.htmhttp://www.orafaq.com/tools/leccotech/sqlexpert.htm
  • 8/12/2019 Tuning 360

    2/29

  • 8/12/2019 Tuning 360

    3/29

    *ifferent Ty,e of Indexe

    %0Tree (traditiona$) indexe 1a h0c$u ter %itma, indexe Index0#rgani'ed Ta.$e

    Rever e07ey Indexe

  • 8/12/2019 Tuning 360

    4/29

    Create Index command

    Create index 8i9ame on8tname (8co$;name )t &now what to do the .e to,tion i u ua$$y a %0Tree5 They are f$exi.$e

    and ,erform we$$ (not very we$$) in evera$cenario 5 It i rea$$y the %? tree or %@ tree

  • 8/12/2019 Tuning 360

    8/29

    %0Tree (continued) #ne node corre ,ond to one .$oc&-,age

    (minimum di & I0#)5

    9on0Leaf node (n &ey n?A ,ointer ) Leaf09ode (contain n entrie where each

    entry ha an index and a ,ointer to a data

    .$oc&)5 "$ o each node ha a ,ointer tonext node5

    "$$ $eave are at the ame height5

  • 8/12/2019 Tuning 360

    9/29

    !ood Indexing (%0Tree)

    Candidate Ta.$e mu t .e rea ona.$y $arge 4ie$d i 3ueried .y fre3uent$y 4ie$d ha a high cardina$ity (don>t index .y

    ex where the cardina$ity i 6BB)5 %ad$y .a$anced tree may inhi.it

    ,erformance5 *e troying and re0creatingindex may im,rove ,erformance5

  • 8/12/2019 Tuning 360

    10/29

    %itma, Index

    %itma, indexe contain the &ey va$ue and a .itma, $i ting the va$ue of or A (ye -no)

    for each row indicating whether the rowcontain that va$ue or not5

    May .e a good o,tion for indexing fie$dthat have $ow cardina$ity (o,,o ite of %0tree )5

  • 8/12/2019 Tuning 360

    11/29

    %itma, Index (cont5)

    Syntax: Create Bitmap index . %itma, index wor& .etter with e3ua$ity te t = or

    in (not with < or > ) %itma, index maintenance can .e ex,en ive< an

    individua$ .it may not .e $oc&ed< a ing$e u,date$oc& a $arge ,ortion of index5

    %itma, indexe are .e t in read0on$ydatawarehou e ituation

  • 8/12/2019 Tuning 360

    12/29

    1a h Indexing

    %0tree and %itma, index &ey are u ed tofind row re3uiring I-# to ,roce index

    1a h get row with a &ey .a ed a$gorithm Row are tored .a ed on a ha hed va$ue Index i'e hou$d .e &nown at index

    creation +xam,$e:

    D create index cidx on order (cid) ha hed