advance dbms 1

Upload: farhadcse30

Post on 23-Feb-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/24/2019 Advance DBMS 1

    1/12

    lnrlcxing

    rtrrcl

    I lashing

    lndcx

    A datat-rasc

    incicx

    is

    n

    clata

    s1r'uclurc that inrprovcs

    tltc

    spccd

    ol'data

    rctrieval

    opclations on

    lt

    databersc

    tablc

    at

    thc cost

    ol'slowcr

    writes

    ancl

    thc

    use

    of'more

    storage space.

    llasic Concepts

    N4auv clucrics rclcrcncc

    only

    a

    srlall

    proportion

    of

    thc rccorcls

    in

    a ljlc.

    Ior cxanrplc, a

    clLicrv

    lil

  • 7/24/2019 Advance DBMS 1

    2/12

    Inscrtion

    timc:

    'l'lrc

    tirnc

    il

    lalics

    to iuscrl n ncrv

    dala

    itcrl.'l'his

    vrlrrc

    inclrr'.le:

    iir,'

    tiurc

    it

    tulics

    to

    ljrtl

    thc

    corlcct

    place

    trl iuscrt tlrc

    ncw

    clata itcn-r, as

    wcll

    us tlre tirirc

    il

    tal

  • 7/24/2019 Advance DBMS 1

    3/12

    lSri.girtori

    Jtighton

    I-)or,r'niLrlvn

    liantrs

    L)o\v'nlo\,\'n

    edt".rrood

    lVlianrLs

    Pcrryrirlge

    Pcrrvri.ige

    Penyridge

    A-222

    |

    liercln'oor{

    Iioum.{ I{ill

    looking.

    We start

    at tlic

    t'ccord

    pointcd

    to

    by

    that indcx entry,

    in

    llrc

    fllc tnttil

    n,c

    lnttl

    thc

    tlcsil'ctl

    rccol'tl.

    and lbllow

    thc

    poinlcrs

    Irig.

    2: Sparsc

    lncicx

    Comparison:

    It

    is

    generaily i'astcr

    1o

    locate

    a rccord

    if

    we

    l-ravc

    a dense index rather

    than

    a sparsc

    incicx.

    I

    lowcvcr,

    sparsc

    indiccs

    havc

    advantagcs

    over

    dcnse

    indiccs in

    that

    they

    rcqr-rire

    lcss

    spacc

    and

    they impose

    less maintenance

    ovcrhcad

    lbr

    insertions

    ancl delctions.

    'l-hclc

    is

    a

    lraclc-olf

    that

    tl-ie

    systcr-r-r

    dcsigner

    uust n-iakc bctwcen acccss

    timc

    and

    spacc

    .',.:::,'*.:"

    .i.:i;.ri;:.;;.;,-'i.-ci-'io;r

    icgardin-u,

    this

    tradc-o11 depcnds ott

    thc

    sltccil-ic

    apllliclrttorl.

    a

    good compromise

    is

    to have a

    sparse

    index

    with

    one index entry

    per

    block.

    The

    rcason this

    dcsign

    is

    a

    good

    trade-off

    is

    tl"rat

    the

    dominant

    cost

    in

    processing

    a database

    reqllcst

    is

    thc

    tinrc that

    it

    tahes

    to

    bring

    a

    block

    liom

    clisi