Chap 5. Disk IO Distribution Chap 6. Index Architecture Written by Yong-soon Kwon Summerized By Sungchan IDS Lab. 2008-07-11.

Slides:



Advertisements
Similar presentations
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Advertisements

Tuning: overview Rewrite SQL (Leccotech)Leccotech Create Index Redefine Main memory structures (SGA in Oracle) Change the Block Size Materialized Views,
The Architecture of Oracle
5 Copyright © 2005, Oracle. All rights reserved. Managing Database Storage Structures.
©Silberschatz, Korth and Sudarshan12.1Database System Concepts Chapter 12: Part C Part A:  Index Definition in SQL  Ordered Indices  Index Sequential.
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Performance And Tuning – Lecture 7 Copyright System Managers LLC 2007 all rights reserved.
Primer on Structure& Storage Analysis Primer on Structure & Storage Analysis This presentation is supposed to give a simple and brief overview for storage.
12 Copyright © Oracle Corporation, All rights reserved. Managing Indexes.
IS 4420 Database Fundamentals Chapter 6: Physical Database Design and Performance Leon Chen.
Harvard University Oracle Database Administration Session 5 Data Storage.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 11 Database Performance Tuning and Query Optimization.
Chapter 4 Physical Database Layouts Database Processing Chapter 4.
Oracle Database Administration Database files Logical database structures.
Cloud Computing Lecture Column Store – alternative organization for big relational data.
Database Lecture # 1 By Ubaid Ullah.
Practical Database Design and Tuning. Outline  Practical Database Design and Tuning Physical Database Design in Relational Databases An Overview of Database.
IT The Relational DBMS Section 06. Relational Database Theory Physical Database Design.
Lecture 8 Index Organized Tables Clusters Index compression
Oracle Data Block Oracle Concepts Manual. Oracle Rows Oracle Concepts Manual.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
1 © Prentice Hall, 2002 Physical Database Design Dr. Bijoy Bordoloi.
Physical Database Design & Performance. Optimizing for Query Performance For DBs with high retrieval traffic as compared to maintenance traffic, optimizing.
7202ICT Database Administration Lecture 7 Managing Database Storage Part 2 Orale Concept Manuel Chapter 3 & 4.
TM 7-1 Copyright © 1999 Addison Wesley Longman, Inc. Physical Database Design.
Extents, segments and blocks in detail. Database structure Database Table spaces Segment Extent Oracle block O/S block Data file logical physical.
1 CG171 - Database Implementation and Development (Physical Database Design) – Lecture 7 Storage Allocation & Data Access Methods By Dr. Akhtar Ali.
Chapter 6 1 © Prentice Hall, 2002 The Physical Design Stage of SDLC (figures 2.4, 2.5 revisited) Project Identification and Selection Project Initiation.
School of Computing and Management Sciences © Sheffield Hallam University Finding Data –In a list of 700 composers, how do we find Berlioz? –The row with.
9 Storage Structure and Relationships. 9-2 Objectives Listing the different segment types and their uses Controlling the use of extents by segments Stating.
1 Chapter 14 DML Tuning. 2 DML Performance Fundamentals DML Performance is affected by: – Efficiency of WHERE clause – Amount of index maintenance – Referential.
Chapter 16 Practical Database Design and Tuning Copyright © 2004 Pearson Education, Inc.
File Storage Organization The majority of space on a device is reserved for the storage of files. When files are created and modified physical blocks are.
Database Management COP4540, SCS, FIU Physical Database Design (ch. 16 & ch. 3)
Oracle tuning: a tutorial Saikat Chakraborty. Introduction In this session we will try to learn how to write optimized SQL statements in Oracle 8i We.
Database Tuning Chap 8 : IOT Architecture Chap 9 : Cluster Factor Optimization Center for E-Business Technology Seoul National University Seoul, Korea.
Database structure and space Management. Segments The level of logical database storage above an extent is called a segment. A segment is a set of extents.
14 Copyright © 2006, Oracle. All rights reserved. Tuning Block Space Usage.
5 Copyright © 2005, Oracle. All rights reserved. Managing Database Storage Structures.
Indexes and Views Unit 7.
6 Copyright © 2007, Oracle. All rights reserved. Managing Database Storage Structures.
University of Sunderland COM 220 Lecture Ten Slide 1 Database Performance.
Database Indexing 1 After this lecture, you should be able to:  Understand why we need database indexing.  Define indexes for your tables in MySQL. 
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
Partition Architecture Yeon JongHeum
Managing Schema Objects
Chapter 5 Index and Clustering
Session 1 Module 1: Introduction to Data Integrity
IMS 4212: Database Implementation 1 Dr. Lawrence West, Management Dept., University of Central Florida Physical Database Implementation—Topics.
DB Tuning : Chapter 10. Optimizer Center for E-Business Technology Seoul National University Seoul, Korea 이상근 Intelligent Database Systems Lab School of.
CS 440 Database Management Systems Lecture 6: Data storage & access methods 1.
CS 540 Database Management Systems
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
3 Copyright © 2004, Oracle. All rights reserved. Database Architecture Comparison.
W4118 Operating Systems Instructor: Junfeng Yang.
Select Operation Strategies And Indexing (Chapter 8)
Oracle Database Architectural Components
1 Chapters 19 and 20  Ch. 19: By What Authority? Users Roles Grant and revoke Synonyms  Ch. 20: Changing the Oracle Surroundings Indexes Clusters Sequences.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
Practical Database Design and Tuning
Indexes By Adrienne Watt.
Index An index is a performance-tuning method of allowing faster retrieval of records. An index creates an entry for each value that appears in the indexed.
CS 540 Database Management Systems
Physical Database Design and Performance
Database Performance Tuning and Query Optimization
CHAPTER 5: PHYSICAL DATABASE DESIGN AND PERFORMANCE
Physical Database Design
Practical Database Design and Tuning
Chapter 11 Database Performance Tuning and Query Optimization
ISYS366, Oracle Disk Internals
DBMS Physical Design Physical design is concerned with the placement of data and selection of access methods for efficiency and ongoing maintenance.
Presentation transcript:

Chap 5. Disk IO Distribution Chap 6. Index Architecture Written by Yong-soon Kwon Summerized By Sungchan IDS Lab

Copyright  2008 by CEBT Overview  Chap 5. Disk IO Distribution Oracle Storage Architecture Tuning by Disk IO Distribution  Chap 6. Index Architecture Introduction to Index – B+-Tree Index – Bitmap Index – Reverse Key Index – Function Base Index Random Access Tuning Center for E-Business Technology

Chap 5. Disk IO Distribution

Copyright  2008 by CEBT Disk IO Distribution  Pros Improving Performance  Cons Probability of error increase – Problem on one disk affects whole table Hard to manage Center for E-Business Technology

Copyright  2008 by CEBT Disk IO Distribution Rule  Disk IO Distribution Rule We should increase the probability that all disks are accessed. – Data in each table should be distributed to all disks  How to satisfy the rule? 1.Optimizing Disk Organization 2.Segment Extent Striping 3.Applying Table Archtecture – Partition table, IOT table Center for E-Business Technology

Copyright  2008 by CEBT Optimizing Disk Organization: Volume Group  Volume Groups(VG) Groups of Physical Disks One physical disk cannot belong to multiple VG  Checking VG(HP UX) “vgdisplay –v vg01”  Important Info “Cur PV : 4” : This VG consists of four physical disks “Act PV : 4” : Four physical disks are active in this VG Center for E-Business Technology

Copyright  2008 by CEBT Optimizing Disk Organization: Logical Volume  Concept of Logical Volume Space for file system in VG  Logical Volume Usage File System Raw Device Center for E-Business Technology

Copyright  2008 by CEBT Optimizing Disk Organization: Logical Volume Striping  Logical Volume Striping Center for E-Business Technology

Copyright  2008 by CEBT Optimizing Disk Organization: Logical Volume Striping  Good Point of Logical Volume Striping Achieve Disk IO distribution rule for each VG  Checking Logical Volume “ldisplay –v /dev/vg01/lvol1”  Important Info “Stripes 4” : This logical volume is striped with 4 disks “Stripe Size(Kbytes) 64” : The striping size is 64KB Center for E-Business Technology

Copyright  2008 by CEBT Oracle Storage Architecture Center for E-Business Technology

Copyright  2008 by CEBT Oracle Storage Architecture  OS Block OS Level IO unit  DB Block n OS Block. DB IO unit  Extent Contiguous DB Blocks. Building unit of Segment  Segment Group of Extents(table, index)  Tablespace Group of Segments  Database Group of Tablespaces  Datafile Stores Segments. n Datafile make one Tablespace Center for E-Business Technology

Copyright  2008 by CEBT Segment Extent Striping: Create Tablespace Center for E-Business Technology

Copyright  2008 by CEBT Segment Extent Striping: Create Table on Tablespace Center for E-Business Technology

Copyright  2008 by CEBT Segment Extent Striping: Create Table on Tablespace Center for E-Business Technology

Copyright  2008 by CEBT Segment Extent Striping  Good Points Storing data evenly over all disks for all tables Disk IO distribution rule optimization  Checking Exntent Striping Center for E-Business Technology

Copyright  2008 by CEBT Partition Table  Example Data about 20~30 year old people is frequently accessed If we just store all data in a table, there can be some disks which do not contain any data about 20~30s – Data are not properly distributed!  Partition table  Create partition w.r.t. age! Center for E-Business Technology

Copyright  2008 by CEBT Partition Table: Example Center for E-Business Technology  Result Data about 20~30s are distributed to all 96 disks!

Copyright  2008 by CEBT Wrong IO Distrubution #1 Center for E-Business Technology

Copyright  2008 by CEBT Wrong IO Distribution #2  Incrementally adding datafile to tablespace Center for E-Business Technology

Chap 6. Index Architecture

Copyright  2008 by CEBT Pros. and Cons. of Indexing  Pros. Improving Retrieving Performance  Cons. Degrading Data Manipulation Performance – Insert, Delete, … Storage Center for E-Business Technology

Copyright  2008 by CEBT ROWID  ROWID ID given to all rows in database Center for E-Business Technology

Copyright  2008 by CEBT Example of ROWID Center for E-Business Technology

Copyright  2008 by CEBT Usage of ROWID  Index Creation  Data Access  SQL Tuning Center for E-Business Technology

Copyright  2008 by CEBT Index  B+-Tree Index  Bitmap Index  Reverse Key Index  Function Based Index Center for E-Business Technology

Copyright  2008 by CEBT B+-Tree Index  B+-Tree Index Support efficient search, delete, and insert Center for E-Business Technology

Copyright  2008 by CEBT B+-Tree Index Access Center for E-Business Technology

Copyright  2008 by CEBT B+-Tree Index: Pros. and Cons.  Pros. Balanced Range scan using linked list Good for OLTP small number row access  Cons. Bad for column with low cardinality – Index scanning 3%~5%of Table row: Worse than table full scan Possibility of full scan on OR operation Center for E-Business Technology

Copyright  2008 by CEBT Bitmap Index  Bitmap Index Good for column with low cardinality Center for E-Business Technology

Copyright  2008 by CEBT Bitmap Index structure Center for E-Business Technology

Copyright  2008 by CEBT Bitmap Index: Pros. and Cons.  Pros. Small space Good for column with low cardinality  Cons. Bad for table with frequent DML – Bitmap is need to be decompressed before DML operation – Need block level lock Bad for column with high cardinality Center for E-Business Technology

Copyright  2008 by CEBT Reversed Key Index  Reversed Key Index B+-Tree is bad for sequentially increasing index key column – All insert operation need to access left block – Competetion for left block occur! Reversed Key Index using reversed key to avoid above situation Center for E-Business Technology

Copyright  2008 by CEBT Reversed Key Index: Pros. and Cons.  Pros. Avoid competetion on left block  Cons. Range scan is impossible Center for E-Business Technology

Copyright  2008 by CEBT Function Based Index  Function Based Index Index for transformed value Example – SELECT employee_id, ceil(salary/12)*(grade-5) FROM emp WHERE mod(grade, 10)*1.2 > 10  Creating Function Based Index – SQL> CREATE INDEX bonus_index on emp(mod(grade, 10)*1.2); Center for E-Business Technology

Copyright  2008 by CEBT Function Based Index: Pros. and Cons.  Pros. Index scan for transformed value is possible  Cons. DML overhead Flexibility of index is low – Only used for where cluases in predefined form Center for E-Business Technology

Copyright  2008 by CEBT Random Access  Random Access IO single Block Should be reduced  Table Full Scan Multi Block IO – Not Random Access  Index Scan Random Access occurs Center for E-Business Technology

Copyright  2008 by CEBT Reducing Random Access  Reducing Random Access Optimizing Cluster Factor Using Optimized Index – Ex)SELECT name, date, item FROM trans WHERE id = ‘10’ AND date BETWEEN ‘200401’ AND ‘ ’ Center for E-Business Technology

Copyright  2008 by CEBT Random Access and Index Scan  Random Access and Index Scan Table Access via Index Scan is Random Access Index Scan itself is NOT Random Access Index Scan below 3% of data in table is effective – Over 3%, Full table Scan is effective Center for E-Business Technology