Date post: | 31-Dec-2015 |
Category: |
Documents |
Upload: | jorden-guzman |
View: | 20 times |
Download: | 1 times |
Planning Warehouse Storage
Chapter 9
Data Partitioning
Breaking up a data into separate physical units that can be handled independently
Ease of: - Restructuring - Reorganization - Removal - Recovery - Monitoring - Management - Archiving - Indexing
Order table Order table
Drop
Other data is not affected
Add
Objects to Partition
Tables: - Fact - DimensionIndexes
Horizontal Partitioning
Table and index data are split by: - Time - Sales region or person - Geography - Organization - Line of businessCandidate columns appear in WHERE clauseAnalysis determines requirement
Vertical Partitioning
You may use vertical partitioning when:Speed of query and update actions is
improved by itUsers require access to specific columnsSome data is changed infrequentlyDescriptive dimension text may be
better moved away from the dimension itself
Partitioning Methods
Range partitioning (Oracle8 and Oracle8i)Hash partitioning (Oracle8i)Composite partitioning (Oracle8i)
Star Query Optimization
Optimum performance with star schema models
1. Dimensions are queried to create a 2. Cartesian product, computed against3. Smaller reference table.4. The result is joined to5. A fact table to produce a query result.
Star Transformation
Key 1 Key2 Key 3 Dollars1001 1002 1003 60002001 2002 2003 100003001 3002 3003 152004001 4002 4003 9526
Key 2 Stat1002 SF
Key 3 Year Month1003 1998 March
Key 1 Brand1001 ABC
Time_Table
Fact_Table
Product_Table
Market_Table
Indexing
Indexing is used because:It is huge cost saving, greatly
improving performance and scalabilityCan replace a full table scan by a
quick read of the index followed by a read of only those disk blocks that contain the rows needed
B-Tree Index
Most common type of indexingUsed for high cardinality columnsDesigned for few rows returned
Bitmap Indexes
Provide performance benefits and storage savings
Store values as 1s and 0sUse instead of B-tree indexes when: - Tables are large - Columns have relatively low
cardinality
Oracle8 and Oracle8i Index Enhancements
Oracle8 index enhancements: - Partitioned index
- Index-organized tablesOracle8i index enhancements: - Function-based index - New bitmap index improvements - Online index build and rebuild - Descending index - Statistics can be collected when an index is created
Protecting the Database
RAID is essential with large databasesRAID improves: - Reliability - Storage managementThere are different levels of RAIDYou can eliminate disk contention with
disk striping
RAID 0: Striping
The file is written to a four-drive disk array:Block 1 on Drive 1Block 2 on Drive 2…Block 5 in another sector on Drive 1
File A (a)File A (e)
File A (b)File A (f)
File A (c ) File A (d)
Disk array controller
RAID 0: Striping
Benefits: - Good for simultaneous reads and writes
- No redundancy - ScalableLimitations: - Not recommended for mission-critical systems - No recovery from data loss - One bad sector affects entire disk of data
RAID 1: Mirrored Disk
File A (a)File A (b)
File A (a)File A (b)
File B (c )File B (d)File B (e)
File B (c )File B (d)File B (e)
Disk array controller
Disk 1Disk 1Mirror
Disk 2Disk 2Mirror
Copy of files stored on mirror disk
RAID 1: Mirrored Disk
Benefits: - Complete data redundancy - No performance penalty - Improves reads - ScalabilityLimitations: - Highest cost of all RAID configurations
RAID 5: Independent Disk Array
File C (a)File C (d)File (h)P (i, j)
File C (b)File C (e)P(d,e,f,g,h)
File C (c )File C (f)File C (i)
P (a, b,c)File C (g)File C (j)
Disk array controller
Disk 1 Disk 2 Disk 3 Disk 4
Data striped with parity across array
RAID 5: Independent Disk Array
Benefits: - Efficient data integrity - Data reconstruction - Multiple concurrent seeks across array - ScalableLimitations: - Disk overhead - Data write rate
BackupPlan at the design stageUse hot backups for VLDBsBack up necessary components:
- Fact and dimension data - Warehouse schema - Metadata schema - MetadataExport/Import utility - Disk space - Time
Summary
This lesson discussed the following topics:Explaining vertical partitioning and
horizontal partitioningDistinguishing the different types of
partitioning methodsDistinguishing between B-tree index and
bitmap indexUnderstanding why warehouse typically
uses RAID 0, or 5 to protect the database