Using Clusters and Index-Organized Tables

Slides:



Advertisements
Similar presentations
Tuning: overview Rewrite SQL (Leccotech)Leccotech Create Index Redefine Main memory structures (SGA in Oracle) Change the Block Size Materialized Views,
Advertisements

11 Copyright © Oracle Corporation, All rights reserved. Managing Tables.
13 Copyright © 2004, Oracle. All rights reserved. Monitoring and Managing Storage.
Fan Qi Database Lab 1, com1 #01-08 CS3223 Tutorial 8.
Tipos de Segmentos. B-Tree Index Index entry header Key column length Key column value ROWID Root Branch Leaf Index entry.
12 Copyright © Oracle Corporation, All rights reserved. Managing Indexes.
David Konopnicki Choosing Access Path ä The basic methods. ä The access paths and when they are available. ä How the optimizer chooses among the.
9/11/2015ISYS366 - Week051 ISYS366 – Week 5-6 Database Tuning - User and Rollback Data Spaces, Recovery, Backup.
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 6 Additional Database Objects
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 9 Index Management.
1 CG171 - Database Implementation and Development (Physical Database Design) – Lecture 7 Storage Allocation & Data Access Methods By Dr. Akhtar Ali.
Materialized Views. 2 Materialized Views – Agenda What is a Materialized View? – Advantages and Disadvantages How Materialized Views Work – Parameter.
Chapter 6 Additional Database Objects Oracle 10g: SQL.
9 Storage Structure and Relationships. 9-2 Objectives Listing the different segment types and their uses Controlling the use of extents by segments Stating.
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 7 Basic Table Management.
3 Copyright © 2005, Oracle. All rights reserved. Partitioning Basics.
10 Copyright © Oracle Corporation, All rights reserved. Including Constraints.
Oracle 10g Database Administrator: Implementation and Administration Chapter 7 Basic Table Management.
Database Tuning Chap 8 : IOT Architecture Chap 9 : Cluster Factor Optimization Center for E-Business Technology Seoul National University Seoul, Korea.
Week 5 Lecture 2 Data Integrity Constraints. Learning Objectives  Learn the types and the uses of constraints  Examine the syntax and options for creating.
Week 4 Lecture 2 Advanced Table Management. Learning Objectives  Create tables with large object (LOB) columns and tables that are index-organized 
Indexes and Views Unit 7.
13 Copyright © Oracle Corporation, All rights reserved. Maintaining Data Integrity.
Agenda for Class 2/02/2006 Finish discussing constraints generated with the CREATE TABLE statement. Discuss DROP statement. Discuss INSERT, COMMIT, DELETE,
Partition Architecture Yeon JongHeum
Managing Schema Objects
Chapter 5 Index and Clustering
Chapter 12 Additional Database Objects. Chapter Objectives  Define the purpose of a sequence and state how it can be used by an organization  Explain.
Altering Tables and Constraints Database Systems Objectives Add and modify columns. Add, enable, disable, or remove constraints. Drop a table. Remove.
Indexes … WHERE key = Table Index 22 Row pointer Key Indexes
Data Warehousing Seminar Chapter 13 Indexing the Warehouse
Chap 5. Disk IO Distribution Chap 6. Index Architecture Written by Yong-soon Kwon Summerized By Sungchan IDS Lab
Unit 6 Seminar. Indexed Organized Tables Definition: Index Organized Tables are tables that, unlike heap tables, are organized like B*Tree indexes.
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
Physical Database Structure .
8 Copyright © 2005, Oracle. All rights reserved. Managing Schema Objects.
Indexes 22 Index Table Key Row pointer … WHERE key = 22.
What is the Flashback Database? Improves a database’s availability Useful alternative to traditional restoration methods Contains Flashback logs Archived.
Last Updated : 27 th April 2004 Center of Excellence Data Warehousing Group Teradata Physical Database Design Considerations.
DATABASE PHYSICAL DESIGN Chandra S. Amaravadi 1. INTRODUCTION 2.
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.
Creating Indexes Database Systems Objectives Distinguish between the indexes that are created automatically and those that are created manually.
Practical Database Design and Tuning
CS SQL.
TABLES AND INDEXES Ashima Wadhwa.
Physical Database Design and Performance
Hashing - Hash Maps and Hash Functions
Choosing Access Path The basic methods.
Database Tuning - User and Rollback Data Spaces, Recovery, Backup
Database structure and space Management
Indexes … WHERE key = Table Index 22 Row pointer Key Indexes
Session #, Speaker Name Indexing Chapter 8 11/19/2018.
Chapter 4 Indexes.
CH 4 Indexes.
A Guide to SQL, Eighth Edition
CH 4 Indexes.
The Physical Design Stage of SDLC (figures 2.4, 2.5 revisited)
Managing Indexes.
Database Management System
Database Systems Summary and Overview
INDEXING.
Managing Tables.
Database Management System
Instructor: Samia arshad
Alternative Storage Techniques
Microsoft Access Date.
Reports Report builder meets the challenge by making it easy to design, publish, and distribute professional, production-quality reports in a variety of.
Presentation transcript:

Using Clusters and Index-Organized Tables

Objectives Creating and maintaining clusters Using index-organized tables Retrieving information about clusters and tables from the data dictionary

Distribution of Rows Within a Table Cluster Index-organized table Ordering of Rows Random Grouped Ordered

Clusters Unclustered ORD and ITEM tables Clustered ORD and ITEM tables ORD_NO PROD QTY ... ----- ------ ------ 101 A4102 20 102 A2091 11 102 G7830 20 102 N9587 26 101 A5675 19 101 W0824 10 ORD_NO ORD_DT CUST_CD ------ ------ ------ 101 05-JAN-97 R01 102 07-JAN-97 N45 Cluster Key (ORD_NO) 101 ORD_DT CUST_CD 05-JAN-97 R01 PROD QTY A4102 20 A5675 19 W0824 10 102 ORD_DT CUST_CD 07-JAN-97 N45 A2091 11 G7830 20 N9587 26 Unclustered ORD and ITEM tables Clustered ORD and ITEM tables

Cluster Types Index cluster Hash cluster Hash function

Creating Index Clusters . Create a cluster. . Create a cluster index. CREATE CLUSTER scott.ord_clu (ord_no NUMBER(3)) SIZE 200 TABLESPACE DATA01 STORAGE(INITIAL 5M NEXT 5M PCTINCREASE 0); CREATE INDEX scott.ord_clu_idx ON CLUSTER scott.ord_clu TABLESPACE INDX01 STORAGE(INITIAL 1M NEXT 1M PCTINCREASE 0);

Creating Index Clusters . Create tables in the cluster. CREATE TABLE scott.ord (ord_no NUMBER(3) CONSTRAINT ord_pk PRIMARY KEY, ord_dt DATE, cust_cd VARCHAR2(3)) CLUSTER scott.ord_clu(ord_no); CREATE TABLE scott.item (ord_no NUMBER(3) CONSTRAINT item_ord_fk REFERENCES scott.ord, prod VARCHAR2(5), qty NUMBER(3), CONSTRAINT item_pk PRIMARY KEY(ord_no,prod)) CLUSTER scott.ord_clu(ord_no);

Creating Hash Clusters . Create a cluster. . Create tables in a cluster. CREATE CLUSTER scott.off_clu (country VARCHAR2(2),postcode VARCHAR2(8)) SIZE 500 HASHKEYS 1000 TABLESPACE DATA01 STORAGE(INITIAL 5M NEXT 5M PCTINCREASE 0); CREATE TABLE scott.office( office_cd NUMBER(3), cost_ctr NUMBER(3), country VARCHAR2(2), postcode VARCHAR2(8)) CLUSTER scott.off_clu(country,postcode);

Parameters Specific to Hash Clusters HASHKEYS: Number of key values HASH IS: Optional user-defined hash function Key 21 Key 12 Key 11 Key 1 Key 2 Key 3 Key 22 Overflow block Preallocated blocks

Dropping Clusters Use INCLUDING TABLES to drop tables and cluster or drop tables before dropping cluster. DROP CLUSTER scott.ord_clu INCLUDING TABLES; DROP TABLE scott.ord; DROP TABLE scott.item; DROP CLUSTER scott.ord_clu;

Index-Organized Tables Indexed access on table Accessing index- organized table ROWID Non-key columns Key column Row header

Creating Index-Organized Tables CREATE TABLE scott.sales ( office_cd NUMBER(3), qtr_end DATE, revenue NUMBER(10,2), review VARCHAR2(1000), CONSTRAINT sales_pk PRIMARY KEY(office_code, qtr_end)) ORGANIZATION INDEX TABLESPACE data01 PCTTHRESHOLD 20 OVERFLOW TABLESPACE data02;

Summary Identifying situations where clusters are useful Using index-organized tables