Download presentation
Presentation is loading. Please wait.
Published byὙπατια Παπαϊωάννου Modified over 5 years ago
1
MIS 451 Building Business Intelligence Systems
Physical Design
2
Project Planning Requirements Analysis Logical Design Physical Design Data Staging Data Analysis (OLAP)
3
The Storage Hierarchy CPU Small Fast Cache Access Speed
MIPS Small Fast Cache 10-8 second Access Speed Storage Capacity Memory 10-7 second Disk 10-2 second Large Slow
4
The Storage Hierarchy CPU Memory Disk
5
The Storage Hierarchy Logical unit of data transferred between disk and memory is block (4k bytes) Physical unit on disk is cylinder, tract, sector There is a mapping between block and sector.
7
Performance Improvement
List total amount of sales for product ’17’ Select sum(SALES_AMT) From SALESFACT S, PRODUCT P Where S.Product_key = P. Product_key and P.PNAME=‘17’
8
Performance Improvement
Consider a simpler query: List product_key for product ’17’ Select product_key From PRODUCT Where PNAME=‘17’
9
Performance Improvement
Product table 1M records, each record 200 bytes long Block is 4k size, block access time is 0.01s 4k/200=20 records per block Number of blocks: 1M/20=50K Sequential search Time: 25K*0.01s=250s=4min.
10
Performance Improvement
Binary search Time: lg(50K)*0.01s=16*0.01s=0.16s B+ tree index Create index pn on product(pname); If each node in B+ tree has 117 keys, then Seek: lg117(1M)=3 Read the block from main file: 1 Total time = 4*0.01 = 0.04s
11
Performance Improvement
List total amount of sales for product category ‘c1’ Select sum(SALES_AMT) From SALESFACT S, PRODUCT P Where S.Product_key = P. Product_key and P.PCNAME=‘C1’
12
Performance Improvement
Consider a simpler query: List all product_keys for product category ‘c1’ Select product_key From PRODUCT Where PCNAME=‘c1’
13
Performance Improvement
Suppose there are only 4 product categories for 1M products Create a B+ tree index??? Suppose the size of product category and block ID is 10 bytes Size of index = 1M * 10 = 10 M bytes
14
Performance Improvement
A bitmap index for an attribute A is a collection of bit vectors, one for each possible value of A. The vector for value v has 1 in position i if the ith record has v for attribute A. CREATE BITMAP INDEX bitpc ON PRODUCT (PCNAME); Size of bitmap index 1M*4/8=500K bytes
15
Performance Improvement
Bitmap index is suitable for low cardinality attribute. Cardinality(A) = # of possible values for A/#of records Compared with B+ tree index, bitmap index has the following advantages for low cardinality attributes Storage space saving Efficient for boolean operations
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.