Optimizing Data Warehouse Ad-Hoc Queries against "Star Schemas " By Bert Scalzo, Ph.D.

Slides:



Advertisements
Similar presentations
Tuning Oracle SQL The Basics of Efficient SQLThe Basics of Efficient SQL Common Sense Indexing The Optimizer –Making SQL Efficient Finding Problem Queries.
Advertisements

Tuning: overview Rewrite SQL (Leccotech)Leccotech Create Index Redefine Main memory structures (SGA in Oracle) Change the Block Size Materialized Views,
Supervisor : Prof . Abbdolahzadeh
What Happens when a SQL statement is issued?
OLAP Tuning. Outline OLAP 101 – Data warehouse architecture – ROLAP, MOLAP and HOLAP Data Cube – Star Schema and operations – The CUBE operator – Tuning.
1 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Database Management3-1 L3 Database Management Santa R. Susarapu Ph.D. Student Virginia Commonwealth University.
Big Data Working with Terabytes in SQL Server Andrew Novick
Outline What is a data warehouse? A multi-dimensional data model Data warehouse architecture Data warehouse implementation Further development of data.
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Performance And Tuning – Lecture 7 Copyright System Managers LLC 2007 all rights reserved.
Data Modeling on Steroids: Patterns and Reusability Presented by Bert Scalzo, PhD
Chapter Physical Database Design Methodology Software & Hardware Mapping Logical Design to DBMS Physical Implementation Security Implementation Monitoring.
David Konopnicki Choosing Access Path ä The basic methods. ä The access paths and when they are available. ä How the optimizer chooses among the.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 11 Database Performance Tuning and Query Optimization.
Data Warehousing - 3 ISYS 650. Snowflake Schema one or more dimension tables do not join directly to the fact table but must join through other dimension.
Alternative: Bitmap Indexing Imagine the following query in huge table Find customers living in London, with 2 cars and 3 children occupying a 4 bed house.
Copyright © 2006 Quest Software Data Modeling: It’s All About the Relationships Presenter: Bert Scalzo, Oracle Domain Expert AUDIO.
© 2008 Quest Software, Inc. ALL RIGHTS RESERVED. Managing Database Change with Data Modeling Bert Scalzo, PhD
Designing a Data Warehouse
Successful Dimensional Modeling of Very Large Data Warehouses By Bert Scalzo, Ph.D.
Fast Track, Microsoft SQL Server 2008 Parallel Data Warehouse and Traditional Data Warehouse Design BI Best Practices and Tuning for Scaling SQL Server.
Optimizing Data Warehouse Loads via Parallel Pro-C and Parallel/Direct-Mode SQL Bert Scalzo, Ph.D.
Relational Database Performance CSCI 6442 Copyright 2013, David C. Roberts, all rights reserved.
Designing a Data Warehouse Issues in DW design. Three Fundamental Processes Data Acquisition Data Storage Data a Access.
Systems analysis and design, 6th edition Dennis, wixom, and roth
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 11 Database Performance Tuning and Query Optimization.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Database Performance Tuning and Query Optimization.
Lecture 8 Index Organized Tables Clusters Index compression
IBM Start Now Business Intelligence Solutions. Agenda Overview of BI Who will buy and why Start Now BI solution Benefit to customer.
CS 345: Topics in Data Warehousing Tuesday, October 19, 2004.
Chapter 6: Foundations of Business Intelligence - Databases and Information Management Dr. Andrew P. Ciganek, Ph.D.
Oracle Database Administration Lecture 6 Indexes, Optimizer, Hints.
Physical Database Design & Performance. Optimizing for Query Performance For DBs with high retrieval traffic as compared to maintenance traffic, optimizing.
Oracle Index study for Event TAG DB M. Boschini S. Della Torre
1 Cube Computation and Indexes for Data Warehouses CPS Notes 7.
1 Chapter 7 Optimizing the Optimizer. 2 The Oracle Optimizer is… About query optimization Is a sophisticated set of algorithms Choosing the fastest approach.
11-1 Improve response time of interactive programs. Improve batch throughput. To ensure scalability of applications load vs. performance. Reduce system.
Data Warehouse Design Xintao Wu University of North Carolina at Charlotte Nov 10, 2008.
Advanced SQL Application Tuning: Find the Proverbial Needle in the Haystack Bert Scalzo, Ph.D.
Star Transformations Tony Hasler, UKOUG Birmingham 2012 Tony Hasler, Anvil Computer Services Ltd.
Building and Optimizing Data Warehouse "Star Schemas" with MySQL Bert Scalzo, Ph.D.
MIS2502: Data Analytics The Information Architecture of an Organization.
SQL Performance and Optimization l SQL Overview l Performance Tuning Process l SQL-Tuning –EXPLAIN PLANs –Tuning Tools –Optimizing Table Scans –Optimizing.
MANAGING DATA RESOURCES ~ pertemuan 7 ~ Oleh: Ir. Abdul Hayat, MTI.
1 Chapter 10 Joins and Subqueries. 2 Joins & Subqueries Joins – Methods to combine data from multiple tables – Optimizer information can be limited based.
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.
SQL/Lesson 7/Slide 1 of 32 Implementing Indexes Objectives In this lesson, you will learn to: * Create a clustered index * Create a nonclustered index.
1 Chapter 13 Parallel SQL. 2 Understanding Parallel SQL Enables a SQL statement to be: – Split into multiple threads – Each thread processed simultaneously.
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
Chapter 5 Index and Clustering
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.
1 Copyright © 2009, Oracle. All rights reserved. Oracle Business Intelligence Enterprise Edition: Overview.
Copyright © 2006 Quest Software Quest RAC Tools Bert Scalzo, Domain Expert, Oracle Solutions
4 Copyright © Oracle Corporation, All rights reserved. Modeling the Data Warehouse.
SQL Server Statistics DEMO SQL Server Statistics SREENI JULAKANTI,MCTS.MCITP,MCP. SQL SERVER Database Administration.
IT 5433 LM4 Physical Design. Learning Objectives: Describe the physical database design process Explain how attributes transpose from the logical to physical.
Tuning Oracle SQL The Basics of Efficient SQL Common Sense Indexing
Supervisor : Prof . Abbdolahzadeh
Scaling SQL with different approaches
Database Performance Tuning and Query Optimization
Unidad II Data Warehousing Interview Questions
Four Rules For Columnstore Query Performance
Chapter 11 Database Performance Tuning and Query Optimization
Applying Data Warehouse Techniques
Performance And Scalability In Oracle9i And SQL Server 2000
Introduction to the Optimizer
Applying Data Warehouse Techniques
Presentation transcript:

Optimizing Data Warehouse Ad-Hoc Queries against "Star Schemas " By Bert Scalzo, Ph.D.

Learning Objectives Just one major objective – to make the majority of unknown/unplanned ad-hoc end-user queries (e.g. BI tool reports’ many “SELECT” statements) execute as fast as is possible – and very efficiently, thus using the least amount of database server resources We cannot allow big databases to have queries that simply take too long …

Speaker’s Qualifications Oracle Solutions Product Architect for Quest Software Chief architect for Quest’s popular “TOAD” product Oracle DBA for 20+ years, versions 4 through 10g Worked for Oracle Education & Consulting Holds several Oracle Masters (DBA & CASE) BS, MS, PhD in Computer Science and also an MBA LOMA insurance industry designations: FLMI and ACS Books –The TOAD Handbook (Feb 2003) –Oracle DBA Guide to Data Warehousing and Star Schemas (Mar 2003) –The TOAD Pocket Reference 2 nd edition (June 2005) Articles –Oracle Magazine –Oracle Technology Network (OTN) –Oracle Informant –PC Week (now E-Magazine) –Linux Journal –

New 2 nd Edition – June 2005

About Quest Software Quest Software (NASDAQ: QSFT) Founded: 1987 More than 2000 employees in 40 offices: North America, South America, Europe, Asia, Australia Application management leader: 75% of Fortune 500 Develop, deploy, manage and maintain enterprise applications without downtime or business interruption Best known in the Oracle community for TOAD, Spotlight, Quest Central, Shareplex, etc.

Know Your Application … What type of application are you building: On Line Transaction Processing (OLTP) Operational Data Store (ODS) On Line Analytical Processing (OLAP) Data Mart / Data Warehouse (DM/DW)

OLTPODSOLAPDM/DW Business FocusOperationalOperational Tactical TacticalTactical Strategic End User ToolsClient Server Web Client ServerClient Server Web DB TechnologyRelational CubicRelational Trans CountLargeMediumSmall Trans SizeSmallMedium Large Trans TimeShortMediumLong Size in Gigs10 – – Normalization3NF N/A0NF Data Modeling Traditional ER N/ADimensional Application Natures…

Embrace New Concepts “Teach Old Dog New Tricks” Throw out any OLTP baggage Forget OLTP “Golden Rules” X

Star Schema Design “Star schema” approach to dimensional data modeling was pioneered by Ralph Kimball Dimensions: smaller, de-normalized tables containing business descriptive columns that end-users query on Facts: very large tables with primary keys formed from the concatenation of related dimension table foreign key columns, and possessing numerically additive, non-key columns used for calculations during end-user queries

Dimensions Facts

10 8th th 10 3rd -10 5th

The Ad-Hoc Challenge How much data would a data miner mine, if a data miner could mine data? Dimensions: generally queried selectively to find lookup value matches that are used to query against the fact table Facts: must be selectively queried, since they generally have hundreds of millions to billions of rows – even full table scans utilizing parallel are too big for most systems

Hardware Not Compensate Often, people have expectation that using expensive hardware is only way to obtain optimal performance for a data warehouse CPU SMP MPP Disk 15,000 RPM RAID (EMC) OS UNIX 64-bit Oracle OPS / PQO 64-bit

DB Design Paramount In reality, the database design is the key factor to optimal query performance for a data warehouse built as a “Star Schema” There are certain minimum hardware and software requirements that once met, play a very subordinate role to tuning the database Golden Rule: get the serial explain plan correct before doing partitioning or PQ

Key Tuning Requirements 1.Right version of Oracle 2.Properly tuned Init.Ora 3.Lots of Bitmap Indexes!!! 4.Cost Based Optimizer 5.Statistics and Histograms 6.“Star Transformation” explain plan

Oracle Version Problems Oracle 7.X lacks: True Partitioning of Tables and Indexes Reliable and Efficient Bitmap Indexes Histograms for Cost-Based Optimization “Star Transformation” explain plan Oracle 8.X lacks: List Partitioning Scalable Bitmap Indexes (500+ million) Scalable Histograms (500+ million) Bitmap Join Index Numerous new GORUP & OLAP Functions ANSI Syntax Support (e.g. ANSI 99 Join)

Oracle 8.X Init.Ora always_anti_join=HASH always_semi_join=HASH bitmap_merge_area_size=>16M buffer_pool_keep=xM (for bitmap indexes) buffer_pool_recycle=xM (for fact tables) compatible= create_bitmap_area_size>=16M db_block_buffers= (1.7G / DB_BLOCK_SIZE) – shared_pool_size db_block_size>=16K db_file_direct_io_count= MAX_IO_SIZE / DB_BLOCK_SIZE db_file_multiblock_read_count= MAX_IO_SIZE / DB_BLOCK_SIZE db_writer_processes=10 disk_asynch_io=TRUE hash_area_size>=16M hash_join_enabled=TRUE hash_multiblock_io_count= MAX_IO_SIZE / DB_BLOCK_SIZE optimizer_features_enable=8.1.7 optimizer_percent_paralell=0 (favor best serial plan – explained later) parallel_automatic_tuning=TRUE parallel_broadcast_enabled=TRUE parallel_max_servers=4 * CPU_COUNT if you have fast disks parallel_min_percent=0 query_rewrite_enabled=TRUE sort_area_size>=4M sort_multiblock_read_count= MAX_IO_SIZE / DB_BLOCK_SIZE star_transformation_enabled=TEMP_DISABLE

Oracle 9.X Init.Ora compatible= db_block_size>=16K db_cache_size=(1.7G / DB_BLOCK_SIZE) – shared_pool_size db_file_multiblock_read_count= MAX_IO_SIZE / DB_BLOCK_SIZE db_keep_cache_size=xM (for bitmap indexes) db_recycle_cache_size=xM (for fact tables) db_writer_processes=20 disk_asynch_io=TRUE filesystemio_options=SETALL (directIO + asynch) hash_join_enabled=TRUE log_parallelism=8 optimizer_features_enable=9.2.0 parallel_automatic_tuning=TRUE parallel_max_servers=4 * CPU_COUNT if you have fast disks parallel_min_percent=0 pga_aggregate_size>=64M query_rewrite_enabled=TRUE star_transformation_enabled=TRUE or TEMP_DISABLE undo_management=AUTO workarea_size_policy=AUTO

Oracle 10.X Init.Ora compatible= db_block_size>=16K db_file_multiblock_read_count= MAX_IO_SIZE / DB_BLOCK_SIZE db_keep_cache_size=xM (for bitmap indexes) db_recycle_cache_size=xM (for fact tables) db_writer_processes=20 disk_asynch_io=TRUE filesystemio_options=SETALL (directIO + asynch) optimizer_features_enable= parallel_automatic_tuning=TRUE parallel_max_servers=4 * CPU_COUNT if you have fast disks parallel_min_percent=0 pga_aggregate_size>=64M query_rewrite_enabled=TRUE sga_target_size=1.7G (for 32-bit systems) star_transformation_enabled=TRUE or TEMP_DISABLE undo_management=AUTO workarea_size_policy=AUTO

Bitmap Indexes All fact table, foreign key columns must have individual bitmap indexes on them If using Oracle 8.1, then ALTER TABLE MINIMIZE RECORDS_PER_BLOCK to optimize the mapping of bitmaps to rowids All dimension table, non-key columns should have individual bitmap indexes

Nighttime - 10 B-Tree Indexes

Daytime - 48 Bitmap Indexes!!!

Bit-map indexes –Contrary to widespread belief, can be effective when there are many distinct column values –Not suitable for OLTP however

Fact Table Indexes Table Index Type Uniq Column Null DW_ORDER DW_POS_DAY_B1 BITMAP N PERIOD_ID N DW_POS_DAY_B2 BITMAP N LOCATION_ID N DW_POS_DAY_B3 BITMAP N PRODUCT_ID N DW_POS_DAY_B4 BITMAP N VENDOR_ID N DW_POS_DAY_PK NORMAL Y PERIOD_ID N NORMAL Y LOCATION_ID N NORMAL Y PRODUCT_ID N NORMAL Y VENDOR_ID N NORMAL Y RECMD_FLAG N NORMAL Y NEW_ITEM_FLAG N

Dimension Table Indexes Table Index Type Uniq Column Null DW_VENDOR DW_VENDOR_B02 BITMAP N LEVELX N DW_VENDOR_B03 BITMAP N VENDOR_CODE N DW_VENDOR_B05 BITMAP N CITY Y DW_VENDOR_B06 BITMAP N STATE Y DW_VENDOR_B07 BITMAP N ZIP N DW_VENDOR_PK NORMAL Y VENDOR_ID N DW_VENDOR_U1 NORMAL Y VENDOR_NAME N

Cost Based Optimizer Statistics and Histograms: 1.First, analyze table delete statistics 2.For dimension tables, estimate statistics for table for all indexes 3.For fact tables, estimate statistics for table for all indexes for all indexed columns size 254 sample rows

Ready to Rock and Roll With all our database tuning pre-requisites addressed, we can now rely on Oracle to formulate reasonable explain plans for “Star Schema” data warehouse queries In fact if we’ve done everything correctly, then table/index partitioning and parallel query will merely eliminate partitions or perform parallel operations on our serial explain plans (i.e. 95%+ identical plans)

Sample Tuning Cases Oracle / HP-UX HP-9000, V2200, 16 CPU, 16 GB RAM Avg Fact table row count = 600 million Oracle / HP-UX HP-9000, K460, 4 CPU, 4 GB RAM Avg Fact table row count = 3 million Oracle / Windows 2003 Server Quad Xeon, 4 GB RAM Avg Fact table row count = 3 million Oracle / Redhat Linux AS 4.0 Quad Xeon, 4 GB RAM Avg Fact table row count = 3 million Same Explain Plans!!!

Query: beer and coffee sales for November of 98 in Dallas

Star Transformation

Star join performance 3 orders of magnitude difference between best and worst plan

| Operation | Name | Rows | Bytes| Cost | Pstart| Pstop | | SELECT STATEMENT | | 1 | 154 | 34 | | | | SORT GROUP BY | | 1 | 154 | 34 | | | | HASH JOIN | | 1 | 154 | 29 | | | | TABLE ACCESS BY INDEX ROWID | DW_ORDER | 1 | 95 | 17 | | | | BITMAP CONVERSION TO ROWIDS | | | | | | | | BITMAP AND | | | | | | | | BITMAP MERGE | | | | | | | | BITMAP KEY ITERATION | | | | | | | | TABLE ACCESS BY INDEX ROWID | DW_PERIOD | 1 | 51 | 2 | | | | BITMAP CONVERSION TO ROWIDS | | | | | | | | BITMAP AND | | | | | | | | BITMAP INDEX SINGLE VALUE | DW_PERIOD_B03 | | | | | | | BITMAP INDEX SINGLE VALUE | DW_PERIOD_B12 | | | | | | | BITMAP INDEX RANGE SCAN | DW_ORDER_B1 | | | | | | | BITMAP MERGE | | | | | | | | BITMAP KEY ITERATION | | | | | | | | TABLE ACCESS BY INDEX ROWID | DW_LOCATION | 1 | 46 | 2 | | | | BITMAP CONVERSION TO ROWIDS | | | | | | | | BITMAP AND | | | | | | | | BITMAP INDEX SINGLE VALUE | DW_LOCATION_B03 | | | | | | | BITMAP INDEX SINGLE VALUE | DW_LOCATION_B41 | | | | | | | BITMAP INDEX RANGE SCAN | DW_ORDER_B2 | | | | | | | BITMAP MERGE | | | | | | | | BITMAP KEY ITERATION | | | | | | | | TABLE ACCESS BY INDEX ROWID | DW_PRODUCT | 17 | 1K| 10 | | | | BITMAP CONVERSION TO ROWIDS | | | | | | | | BITMAP AND | | | | | | | | BITMAP INDEX SINGLE VALUE | DW_PRODUCT_B03 | | | | | | | BITMAP OR | | | | | | | | BITMAP INDEX SINGLE VALUE | DW_PRODUCT_B14 | | | | | | | BITMAP INDEX RANGE SCAN | DW_ORDER_B3 | | | | | | | TABLE ACCESS BY INDEX ROWID | DW_PRODUCT | 17 | 1K| 10 | | | | BITMAP CONVERSION TO ROWIDS | | | | | | | | BITMAP AND | | | | | | | | BITMAP INDEX SINGLE VALUE | DW_PRODUCT_B03 | | | | | | | BITMAP OR | | | | | | | | BITMAP INDEX SINGLE VALUE | DW_PRODUCT_B14 | | | | | | UTLXPLS: Serial Plan, No Partitioning

| Operation | Name | Rows | Bytes| Cost | Pstart| Pstop | | SELECT STATEMENT | | 1 | 154 | 35 | | | | SORT GROUP BY | | 1 | 154 | 35 | | | | HASH JOIN | | 1 | 154 | 30 | | | | PARTITION RANGE ALL | | | | | 1 | 10 | | TABLE ACCESS BY LOCAL INDEX ROWID| DW_ORDER_PART | 0 | 20 | 18 | 1 | 10 | | BITMAP CONVERSION TO ROWIDS | | | | | | | | BITMAP AND | | | | | | | | BITMAP MERGE | | | | | | | | BITMAP KEY ITERATION | | | | | | | | SORT BUFFER | | | | | | | | TABLE ACCESS BY INDEX ROWID| DW_PERIOD | 1 | 51 | 2 | | | | BITMAP CONVERSION TO ROWID| | | | | | | | BITMAP AND | | | | | | | | BITMAP INDEX SINGLE VALU| DW_PERIOD_B03 | | | | | | | BITMAP INDEX SINGLE VALU| DW_PERIOD_B12 | | | | | | | BITMAP INDEX RANGE SCAN | DW_ORDER_PART_B1 | | | | 1 | 10 | | BITMAP MERGE | | | | | | | | BITMAP KEY ITERATION | | | | | | | | SORT BUFFER | | | | | | | | TABLE ACCESS BY INDEX ROWID| DW_LOCATION | 1 | 46 | 2 | | | | BITMAP CONVERSION TO ROWID| | | | | | | | BITMAP AND | | | | | | | | BITMAP INDEX SINGLE VALU| DW_LOCATION_B03 | | | | | | | BITMAP INDEX SINGLE VALU| DW_LOCATION_B41 | | | | | | | BITMAP INDEX RANGE SCAN | DW_ORDER_PART_B2 | | | | 1 | 10 | | BITMAP MERGE | | | | | | | | BITMAP KEY ITERATION | | | | | | | | SORT BUFFER | | | | | | | | TABLE ACCESS BY INDEX ROWID| DW_PRODUCT | 17 | 1K| 10 | | | | BITMAP CONVERSION TO ROWID| | | | | | | | BITMAP AND | | | | | | | | BITMAP INDEX SINGLE VALU| DW_PRODUCT_B03 | | | | | | | BITMAP OR | | | | | | | | BITMAP INDEX SINGLE VAL| DW_PRODUCT_B14 | | | | | | | BITMAP INDEX RANGE SCAN | DW_ORDER_PART_B3 | | | | 1 | 10 | | TABLE ACCESS BY INDEX ROWID | DW_PRODUCT | 17 | 1K| 10 | | | | BITMAP CONVERSION TO ROWIDS | | | | | | | | BITMAP AND | | | | | | | | BITMAP INDEX SINGLE VALUE | DW_PRODUCT_B03 | | | | | | | BITMAP OR | | | | | | | | BITMAP INDEX SINGLE VALUE | DW_PRODUCT_B14 | | | | | | UTLXPLS: Serial Plan, with Partitioning

| Operation | Name | Rows | Bytes| Cost | TQ |IN-OUT| PQ Distrib | Pstart| Pstop | | SELECT STATEMENT | | 1 | 154 | 34 | | | | | | | SORT GROUP BY | | 1 | 154 | 34 | 2,03 | P->S | QC (RANDOM)| | | | SORT GROUP BY | | 1 | 154 | 34 | 2,02 | P->P | HASH | | | | HASH JOIN | | 1 | 154 | 29 | 2,02 | PCWP | | | | | TABLE ACCESS BY INDEX ROWID | DW_ORDER | 1 | 95 | 17 | 2,01 | P->P | HASH | | | | BITMAP CONVERSION TO ROWIDS | | | | | | | | | | | BITMAP AND | | | | | | | | | | | BITMAP MERGE | | | | | | | | | | | BITMAP KEY ITERATION | | | | | | | | | | | TABLE ACCESS BY INDEX ROWID | DW_PERIOD | 1 | 51 | 2 | | | | | | | BITMAP CONVERSION TO ROWIDS | | | | | | | | | | | BITMAP AND | | | | | | | | | | | BITMAP INDEX SINGLE VALUE | DW_PERIOD_B03 | | | | | | | | | | BITMAP INDEX SINGLE VALUE | DW_PERIOD_B12 | | | | | | | | | | BITMAP INDEX RANGE SCAN | DW_ORDER_B1 | | | | | | | | | | BITMAP MERGE | | | | | | | | | | | BITMAP KEY ITERATION | | | | | | | | | | | TABLE ACCESS BY INDEX ROWID | DW_LOCATION | 1 | 46 | 2 | | | | | | | BITMAP CONVERSION TO ROWIDS | | | | | | | | | | | BITMAP AND | | | | | | | | | | | BITMAP INDEX SINGLE VALUE | DW_LOCATION_B03 | | | | | | | | | | BITMAP INDEX SINGLE VALUE | DW_LOCATION_B41 | | | | | | | | | | BITMAP INDEX RANGE SCAN | DW_ORDER_B2 | | | | | | | | | | BITMAP MERGE | | | | | | | | | | | BITMAP KEY ITERATION | | | | | | | | | | | TABLE ACCESS BY INDEX ROWID | DW_PRODUCT | 17 | 1K| 10 | | | | | | | BITMAP CONVERSION TO ROWIDS | | | | | | | | | | | BITMAP AND | | | | | | | | | | | BITMAP INDEX SINGLE VALUE | DW_PRODUCT_B03 | | | | | | | | | | BITMAP OR | | | | | | | | | | | BITMAP INDEX SINGLE VALUE| DW_PRODUCT_B14 | | | | | | | | | | BITMAP INDEX RANGE SCAN | DW_ORDER_B3 | | | | | | | | | | TABLE ACCESS BY INDEX ROWID | DW_PRODUCT | 17 | 1K| 10 | 2,00 | S->P | HASH | | | | BITMAP CONVERSION TO ROWIDS | | | | | | | | | | | BITMAP AND | | | | | | | | | | | BITMAP INDEX SINGLE VALUE | DW_PRODUCT_B03 | | | | | | | | | | BITMAP OR | | | | | | | | | | | BITMAP INDEX SINGLE VALUE | DW_PRODUCT_B14 | | | | | | | | | UTLXPLP: Parallel Plan, No Partitioning

| Operation | Name | Rows | Bytes| Cost | TQ |IN-OUT| PQ Distrib | Pstart| Pstop | | SELECT STATEMENT | | 1 | 154 | 34 | | | | | | | SORT GROUP BY | | 1 | 154 | 34 | 5,03 | P->S | QC (RANDOM)| | | | SORT GROUP BY | | 1 | 154 | 34 | 5,02 | P->P | HASH | | | | HASH JOIN | | 1 | 154 | 29 | 5,02 | PCWP | | | | | PARTITION RANGE ALL | | | | | 5,02 | PCWP | | 1 | 10 | | TABLE ACCESS BY LOCAL INDEX ROWID| DW_ORDER_PART | 0 | 20 | 18 | 5,01 | P->P | HASH | 1 | 10 | | BITMAP CONVERSION TO ROWIDS | | | | | | | | | | | BITMAP AND | | | | | | | | | | | BITMAP MERGE | | | | | | | | | | | BITMAP KEY ITERATION | | | | | | | | | | | SORT BUFFER | | | | | | | | | | | TABLE ACCESS BY INDEX ROWID| DW_PERIOD | 1 | 51 | 2 | | | | | | | BITMAP CONVERSION TO ROWID| | | | | | | | | | | BITMAP AND | | | | | | | | | | | BITMAP INDEX SINGLE VALU| DW_PERIOD_B03 | | | | | | | | | | BITMAP INDEX SINGLE VALU| DW_PERIOD_B12 | | | | | | | | | | BITMAP INDEX RANGE SCAN | DW_ORDER_PART_B1 | | | | | | | 1 | 10 | | BITMAP MERGE | | | | | | | | | | | BITMAP KEY ITERATION | | | | | | | | | | | SORT BUFFER | | | | | | | | | | | TABLE ACCESS BY INDEX ROWID| DW_LOCATION | 1 | 46 | 2 | | | | | | | BITMAP CONVERSION TO ROWID| | | | | | | | | | | BITMAP AND | | | | | | | | | | | BITMAP INDEX SINGLE VALU| DW_LOCATION_B03 | | | | | | | | | | BITMAP INDEX SINGLE VALU| DW_LOCATION_B41 | | | | | | | | | | BITMAP INDEX RANGE SCAN | DW_ORDER_PART_B2 | | | | | | | 1 | 10 | | BITMAP MERGE | | | | | | | | | | | BITMAP KEY ITERATION | | | | | | | | | | | SORT BUFFER | | | | | | | | | | | TABLE ACCESS BY INDEX ROWID| DW_PRODUCT | 17 | 1K| 10 | | | | | | | BITMAP CONVERSION TO ROWID| | | | | | | | | | | BITMAP AND | | | | | | | | | | | BITMAP INDEX SINGLE VALU| DW_PRODUCT_B03 | | | | | | | | | | BITMAP OR | | | | | | | | | | | BITMAP INDEX SINGLE VAL| DW_PRODUCT_B14 | | | | | | | | | | BITMAP INDEX RANGE SCAN | DW_ORDER_PART_B3 | | | | | | | 1 | 10 | | TABLE ACCESS BY INDEX ROWID | DW_PRODUCT | 17 | 1K| 10 | 5,00 | S->P | HASH | | | | BITMAP CONVERSION TO ROWIDS | | | | | | | | | | | BITMAP AND | | | | | | | | | | | BITMAP INDEX SINGLE VALUE | DW_PRODUCT_B03 | | | | | | | | | | BITMAP OR | | | | | | | | | | | BITMAP INDEX SINGLE VALUE | DW_PRODUCT_B14 | | | | | | | | | UTLXPLP: Parallel Plan, with Partitioning

SQL Plus Timing Results Fact ImplementationUNIX2003 Serial, No Partition9,68822,344 Serial, with Partition5,57811,625 Parallel, No Partition7,75017,875 Parallel, with Partition11,14025,454 NOTE: specific to my data and user queries

Plethora Table Design Options Fact ImplementationUNIX Regular “Heap” Table9,293 Single Column Partition4,747 Multi Column Partition4,987 Composite Partition6,319 Index Organized12,508 Partition Index Organized14,902 NOTE: specific to my data and user queries

Conclusions Remember: should use Oracle latest Oracle version for best results (optimizer has matured for DW and specifically star queries) proper init.ora (i.e. spfile) parameters lots and lots of bitmap indexes must use statistics and histograms shoot for the “Star Transformation” Get non-parallel, non-partitioned explain plan right first, then improve upon that with others highly recommend SQL tuning tools – like “TOAD Xpert”