materialized views

Attribution Non-Commercial (BY-NC)

9 views

materialized views

Attribution Non-Commercial (BY-NC)

- How to Export and Import a Query From One Client to the Other
- Oracle DBA Material Draft
- Dork Havij
- r8101-1.007.00.hardy
- Query Aware Determinization of Uncertain
- Oracle Database Health Check Scripts
- Task Description
- 100410
- SCIENTIA MAGNA, book series, Vol. 5, No. 2
- Materialized Views
- Important Tables in SAP BI
- T. Castle, Myfanwy E. Evans and S. T. Hyde- All toroidal embeddings of polyhedral graphs in 3-space are chiral
- sed
- IND4P1
- Paranoid Guide
- netapp syncmirror
- Nonseparable Graphs
- symacess
- Vedic Mathematics
- NewBFS

You are on page 1of 32

Nathan Folkert, Abhinav Gupta, Andrew Witkowski Sankar Subramanian, Srikanth Bellamkonda, Shrikanth Shankar Tolga Bozkaya, Lei Sheng

Oracle Corporation

CS632 Seminar

Roadmap

Typical Schema in data Warehouses [with windowing] [1] Motivating Example Conventional refresh PCT (Oracle9i) EPCT Refresh for a MV Managing refresh of a set of MVs

CS632 Seminar

Schema

Sales day city amt Times month quarter Geog state region Facts table.

day

year

city

CS632 Seminar

Schema: Sample MV

CREATE MATERIALIZED VIEW quart state MV AS PARTITION BY RANGE (quart) ( PARTITION VALUES LESS THAN Q1 03 PARTITION VALUES LESS THAN Q2 03 ... ) SELECT t.quart, g.state, sum(s.amt) amt FROM sales s, geog g, times t WHERE t.day = s.day and g.city = s.city GROUP BY t.quart, g.state

CS632 Seminar

Partitioning : Advantages

Each Partition is similar to separate relation Operations on different partitions can proceed concurrently Faster bulk operations TRUNCATE/DROP partition MULTI-TABLE INSERT SELECT

CS632 Seminar

INSERT ALL WHEN quart < Q1 03 INTO quart state MV PARTITION quart state MV part1 WHEN quart < Q2 03 INTO quart state MV PARTITION quart state MV part2 WHEN quart < Q3 03 INTO quart state MV PARTITION quart state MV part3 ... SELECT t.quart, g.state, sum(s.amt) amt FROM sales s, geog g, times t WHERE t.day = s.day and g.city = s.city GROUP BY t.quart, g.state

CS632 Seminar

Reusing locks Concurrent operations on partition If rst time populating the partition then minimal undo logging (mark new extents invalid) drop partition equivalent to drop relation Index updation considerations

CS632 Seminar

Motivating Example

CS632 Seminar

Motivating Example

8

CS632 Seminar

Deleted Jan03 data is in log le (as delta Sale) Compute delta{quart state M V } Update MV by taking its join with delta{quart state M V }

CS632 Seminar

{ SELECT t.quart, g.state, sum(s.amt) amt FROM delta sales s, geog g, times t WHERE t.day = s.day and g.city = s.city GROUP BY t.quart, g.state } AS delta

UPDATE quart state MV mv SET mv.amt = ( SELECT mv.amt - delta.amt FROM {....}AS delta WHERE mv.quart = delta.quart and mv.state=delta.state )

10

CS632 Seminar

PCT Refresh

1. ORACLE Specic Features : Partition Maintenace Operations (ADD/DROP/TRUNCATE) are cheaper than INSERT/DELETE INSERTS with Direct Path are much cheaper than Conventional INSERTS 2. PCT : Partition Change Tracking Refresh (ORACLE 9i) Uses partitioned views TRUNCATE affected partition Recompute truncated partition from base partition Use Direct Path INSERT

11

CS632 Seminar

PCT Refresh

Very efcient if MV and Base table partitioned on same eld

12

CS632 Seminar

PCT Refresh

Very efcient if MV and Base table partitioned on same eld Otherwise Given an affected base partition, how to nd out affected partition in MV.

13

CS632 Seminar

Implemented in ORACLE 10g Concept of Partition Join Dependent Expression Methods: EPCT with DELETE EPCT with TRUNCATE

14

CS632 Seminar

Denition: Columns (in the view) which are from tables directly/indirectly equi-joined with partioning key of T Value of Partioning key determines value of PJoin dependent expression

15

CS632 Seminar

Example:

SELECT t.quart, g.state, sum(s.amt) amt FROM sales s, geog g, times t WHERE t.day = s.day and g.city = s.city GROUP BY t.quart, g.state

Base table Sales partioned by day table equi-joined with sales.day = times Columns in view which are from times = quart

16

CS632 Seminar

1. Subquery Predicate:

pj dep exp list IN ( SELECT pj dep exp list FROM tab list WHERE join pred AND part pred )

2. Used to generate: DELETE statement INSERT statement 3. Avoids join with facts table within IN clause

17

CS632 Seminar

DELETE quart state M V WHERE quart IN( SELECT quart FROM times WHERE day >= 01 Jan 2003 AND day < 01 F eb 2003 ) INSERT INTO quart state M V SELECT t.quart, g.state, sum(s.amt) amt FROM sales s, geog g, times t WHERE quart IN( SELECT quart FROM times WHERE day >= 01 Jan 2003 AND day < 01 F eb 2003 ) GROUP BY t.quart, g.state

18

CS632 Seminar

1. P artition exp list = 2. P artition exp list = {P join dep exp list (partitioning columns of M V )} = 3. Subquery Predicate:

SELECT DISTINCT PARTNAME(mv name,P artition exp list) FROM ( SELECT DISTINCT P artition exp list FROM tab list WHERE join pred AND part pred )

19

CS632 Seminar

20

CS632 Seminar

Functional Dependency specication syntax Foreign Key / Primary Key Dimensions day month quart year

CREATE DIMENSION time dim LEVEL day IS times.day LEVEL month IS times.month LEVEL quart IS times.quarter LEVEL year IS times.year HIERARCHY calender (day CHILD OF month CHILD OF quart CHILD OF year);

21

CS632 Seminar

Creating best rewrite graph Finding an acyclic graph Executing refresh

22

CS632 Seminar

23

CS632 Seminar

24

CS632 Seminar

25

CS632 Seminar

Cycles can be present : eg. two views dened on same query Tarjans Algorithm to detect SCC Break cycles by removing edges (arbitrarily/heuristically) : no longer optimal

26

CS632 Seminar

Executing refresh

Consideration for resources required Find out threshold : cost at which node requires majority of system resources for each node in topological sort order if ( node|cost(node) > threshold) then schedule node otherwise schedule nodes in batches with number of processes cost(node)

27

CS632 Seminar

get source nodes if any source nodecost exceeds threshold refresh node MV with full parallelism return for each node 1 . . . n, ordered by cost nodecost if( runningsum processes) < 1 break runningsum+ = nodecost k++ for each node k . . . 1 nodecost p = ( runningsum processes) processes = p runningsum = nodecost refresh node MV with parallelism = p

28

CS632 Seminar

Conclusion

A new approach to refresh MV using partitioning of base tables and MVs Optimal Algorithm to schedule refresh of a set of MVs Performace Improvements

29

CS632 Seminar

References

VLDB Presentation:

http : //www.vldb2005.org/program/slides/tue/s1043 f olkert.ppt

http : //web.njit.edu/inf o/oracle/DOC/server.920/a96540/statements 913a.htm#2125349

30

CS632 Seminar

Questions?

31

- How to Export and Import a Query From One Client to the OtherUploaded byAnupa Wijesinghe
- Oracle DBA Material DraftUploaded bysgollavilli
- Dork HavijUploaded bySetiawan Leo
- r8101-1.007.00.hardyUploaded bydesouza85
- Query Aware Determinization of UncertainUploaded byshalini
- Oracle Database Health Check ScriptsUploaded byjmerejoc
- Task DescriptionUploaded byDavid Rothauser
- 100410Uploaded byvol2no4
- SCIENTIA MAGNA, book series, Vol. 5, No. 2Uploaded byAnonymous 0U9j6BLllB
- Materialized ViewsUploaded byRaghuveer Konda
- Important Tables in SAP BIUploaded byravikumar_ch
- T. Castle, Myfanwy E. Evans and S. T. Hyde- All toroidal embeddings of polyhedral graphs in 3-space are chiralUploaded byJupwe
- sedUploaded bywhiscard
- IND4P1Uploaded byVishal Rane
- Paranoid GuideUploaded bySean Major Payne
- netapp syncmirrorUploaded byajay2345
- Nonseparable GraphsUploaded byNatasha Chandra
- symacessUploaded byKumara Veera
- Vedic MathematicsUploaded byVishal Subhash Shinde
- NewBFSUploaded byAgus Yang
- min wang cdwa metadata scheme overviewUploaded byapi-253508813
- GraphsUploaded byRavi Raj
- Well SketchUploaded bygreg
- 3-SSH2673-Discrete_Mathematics.pdfUploaded byelijah
- Statue Macro ListUploaded byRaul Arbanies
- Operational Data Stores 01Uploaded byNed Thai
- Graph Theory NotesUploaded bynikadek

- A Quick and Simple Guide to Crontab Usage - CrontabrocksUploaded bybaazigar
- Stotras.krishnasrikanth.in-shyamala Dandakam in TeluguUploaded byramanavg
- javaproject1Uploaded byramanavg
- aram Telugu MeaningUploaded bysagar_lal
- VowelSandhiExercise-3Uploaded byramanavg
- 00 Ha Do Op Welcome TranscriptUploaded byilayarajesh
- Netezza Database Users GuideUploaded byAnand Rao
- Infosphere StreamsUploaded byramanavg
- Hadoop 5 Day TrainingUploaded byramanavg
- IBMInfoSphereStreams-SPLIntroductoryTutorialUploaded byramanavg
- Pl Standard Toolkit ReferenceUploaded byramanavg
- Greenplum Reference ArchitectureUploaded byramanavg
- Greenplum Text AnalyticsUploaded byramanavg
- BGchapter2Uploaded byjpmahadev
- HillionUploaded byramanavg
- WaasUploaded byramanavg
- BV Lakshmana PurityUploaded byramanavg
- Ymca Swimming SchedulesUploaded byramanavg
- Sanskrit is the Most InterestingUploaded byramanavg
- Hadoop Installation GuideUploaded bySri Ram
- Info Sphere DataStage Parallel Framework Standard PracticesUploaded byAmad Junaid
- ascential_datastageXEUploaded byramanavg
- EarthUploaded byramanavg
- Oracle TuningUploaded byLingeswararao Battu
- KanakaDharaStotramUploaded bykotireddy835384

- Rotary Twin Screw Compressor Brochure 2014Uploaded byPrestoneK
- 4439Testing MultipleUploaded bySonny Ramos
- Chevron User GuideUploaded byMonitair
- Integrating IE in Your VFP AppsUploaded byMario Moyeda
- 2005 Connecticut State Building CodeUploaded byChristine A. Hobson
- Charge Controller Solar Power Battery ChUploaded byeky
- MODULE EASA 7Uploaded byRzVaan Arfi
- Adiwatt-structure-champs.pdfUploaded byErick De La RoSa
- Per Aage Brandt Spaces Domains and Meaning. Essays in CoUploaded byDan Balanescu
- AXE ERICSSONUploaded byBogdan Andrei Toma
- 204 spring 2011.pdfUploaded bycombatps1
- Anna University FormUploaded byJonathan Noble
- Embedded System Design ProjectsUploaded byamit_k25
- Ratan TataUploaded bybasrur1
- geometry syllabus 19-20Uploaded byapi-466054172
- 74LS164-SIPO_Shift_RegisterUploaded byappalaraju2010
- ECE-I-PROGRAMMING-IN-C-DATA-STRUCTURES-15PCD13-QUESTION-PAPER.pdfUploaded byChethana Narayan
- Abstracts OnlineUploaded by沈益
- Effects of Tapering on Performance a Meta-AnalysisUploaded byxcite4ever
- Damasio Minding the BodyUploaded byGregory Lobo
- RuinationUploaded byUmbraRat
- CA Cloud Base 2 j15 HelpUploaded byMade Sariyanta
- The+Shoreline%2714+April%2C+2014.pdfUploaded byAakash das
- E Waste Disposal Challenges and RemediesUploaded byRajan Ranjan
- Crash LogUploaded bydnangel12340
- Advances in Mechanical Engineering 2015 Garcia VilchezUploaded byKanniappan Raman Kannan
- DUNNING PROCEDUREUploaded byKarunesh Srivastava
- Barco InstallationManual R59770175 01 Xenon-lamp-DP1200DP1500DP2000Uploaded byAlex Jianu
- jetUploaded bySofiane Bellabiod
- En Switch v6 Ch03Uploaded byMohamed Anass El Atrach

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.