Material View[1]

Embed Size (px)

Citation preview

  • 8/8/2019 Material View[1]

    1/16

    Database System

    New Materialized View

    .

    .5210421012 Com26

    52104210 Com26

    ..

    52104210 Com26..5210421035 Com26

    ..52104210 Com26

  • 8/8/2019 Material View[1]

    2/16

    Database System

    1/2553

    Material View View Database

    Algorithm Material View - Algorithm View

    Material View View Database

  • 8/8/2019 Material View[1]

    3/16

    1. Materialized View

    2. Materialized View View3. Materialized View4. Materialized View5. Materialized View6. New Material View

    7.

    New Material View8. - Material View

    4445661

    213

  • 8/8/2019 Material View[1]

    4/16

    1. Materialized View

    Materialized View Snapshot Table View query table query query Database table query Table View Table Snapshot

    MaterialView Update 2. Materialized View View

    Materialized View View Link Definition Base Table Table DBA Refresh Data User MaterialView Select Statement Base Table

    View Materialized view

    1. Statementbase table(logical representation of table)2. Select

    Insert, Update, Delete

    1. duplicate data base tableMview accessdata View2. Select

  • 8/8/2019 Material View[1]

    5/16

    view Insert,Update, Delete view

    3. Materialized View3.1 Materialized ViewCREATE MATERIALIZED VIEW jwt_game_mvas SELECT *FROM big_tablebtWHERE bt.branch = 'BANGKOK'

    AND bt.price> 1253.2 Update Materialized ViewALTER MATERIALIZED VIEW

    jwt_gamesalesbkk_mv REFRESH COMPLETE3.3 Materialized View Update

    CREATE MATERIALIZED VIEWjwt_foobar_mv REFRESH COMPLETE START WITHSYSDATE NEXT SYSDATE + 1 AS select bar from foo4. Materialized View 1. View

    2. MV

    MV

    3. MV Feature Query Rewrite MV MV

  • 8/8/2019 Material View[1]

    6/16

  • 8/8/2019 Material View[1]

    7/16

  • 8/8/2019 Material View[1]

    8/16

    wan Auepanwiriyakul Two-Phase Optimization for SelectingMaterializedViews in a Data Warehouse

    6.1 Query database Data

    Warehouse Material View

    Two Phase Optimized (2PO) Simulated Annealing (SA) algorithm Iterative Improvement(II) algorithm MULTIPLE VIEWPROCESSING PLAN (MVPP) 2PO

  • 8/8/2019 Material View[1]

    9/16

    MVPP Plan

    Material View Performance

    Query Query DataWarehousing Table Join Aggregate summary table summary query Summary Level Key

    1. Summary Table Link Base Table Summary Table SELECT statement summary table

    2. Summary table Refresh Update DBA Data Warehouse SummaryTable

  • 8/8/2019 Material View[1]

    10/16

    Query

  • 8/8/2019 Material View[1]

    11/16

  • 8/8/2019 Material View[1]

    12/16

    MULTIPLE VIEW PROCESSING PLAN

    (MVPP)

    6.2

    Iterative Improvement (II)

    Algorithm SimulatedAnnealing (SA) algorithm

    6.2.1 Iterative Improvement (II) Algorithm

    1. random starting point2. at the starting point, a random neighbor is selected3. if the neighbors cost is lower than currents cost

    then move is carried out and aneighbor is sought4. performs random series of move and accepts only

    downhill ones until it reachesa local minimum

  • 8/8/2019 Material View[1]

    13/16

    6.2.2 Simulated Annealing(SA) algorithm

    1. random starting point

    2. at the starting point, a random neighbor is selected3. compare neighbors cost and currents cost3.1 if the neighbors cost is lower than currents

    cost then move is carried out and a neighbor is sought3.2 otherwise moving to neighbors state or

    staying in currents state with probability4. performs random series of move and accepts both ofdownhill and uphill until it reaches a local minimum

    Two Phase Optimized (2PO) for SelectingMaterialized View II SA

    1. Input a MVPP represented by a DAG2. Use width-first searching method to search throughall of the nodes in the DAG and produce an orderedsequence of these nodes into a binary string3. Call Iterative Improvement algorithm4. Call Simulated Annealing algorithm5. Present set of views to materialized with minimum

    cost Cost Model Materialized View

    Selection

    Total query processingcost isTotal maintenance costTotal cost of thematerialized views

    Q Cost of queryM set of materialized views

  • 8/8/2019 Material View[1]

    14/16

  • 8/8/2019 Material View[1]

    15/16

  • 8/8/2019 Material View[1]

    16/16

    2 Query

    8. -Material View

    data query base table

    view view data base table