Recommending Materialized Views and Indexes with the IBM DB2 Design Advisor (Automating Physical Database Design) Jarek Gryz.

Slides:



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

Database Administration, Integrity and Performance.
Database Optimization & Maintenance Tim Richard ECM Training Conference#dbwestECM Agenda SQL Configuration OnBase DB Planning Backups Integrity.
IBM Software Group ® Recommending Materialized Views and Indexes with the IBM DB2 Design Advisor (Automating Physical Database Design) Jarek Gryz.
Outline SQL Server Optimizer  Enumeration architecture  Search space: flexibility/extensibility  Cost and statistics Automatic Physical Tuning  Database.
--What is a Database--1 What is a database What is a Database.
Database Systems: A Practical Approach to Design, Implementation and Management International Computer Science S. Carolyn Begg, Thomas Connolly Lecture.
Chapter Physical Database Design Methodology Software & Hardware Mapping Logical Design to DBMS Physical Implementation Security Implementation Monitoring.
Chapter 6: Database Evolution Title: AutoAdmin “What-if” Index Analysis Utility Authors: Surajit Chaudhuri, Vivek Narasayya ACM SIGMOD 1998.
Physical Database Monitoring and Tuning the Operational System.
A Guide to SQL, Seventh Edition. Objectives Understand, create, and drop views Recognize the benefits of using views Grant and revoke user’s database.
Chapter 17 Methodology – Physical Database Design for Relational Databases Transparencies © Pearson Education Limited 1995, 2005.
Team Dosen UMN Physical DB Design Connolly Book Chapter 18.
Overview of the Database Development Process
Practical Database Design and Tuning. Outline  Practical Database Design and Tuning Physical Database Design in Relational Databases An Overview of Database.
Online Database Support Experiences Diana Bonham, Dennis Box, Anil Kumar, Julie Trumbo, Nelly Stanfield.
Lecture 9 Methodology – Physical Database Design for Relational Databases.
1 Introduction to Database Systems. 2 Database and Database System / A database is a shared collection of logically related data designed to meet the.
Physical Database Design & Performance. Optimizing for Query Performance For DBs with high retrieval traffic as compared to maintenance traffic, optimizing.
Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations.
Informix IDS Administration with the New Server Studio 4.0 By Lester Knutsen My experience with the beta of Server Studio and the new Informix database.
Oracle9i Performance Tuning Chapter 1 Performance Tuning Overview.
10/10/2012ISC239 Isabelle Bichindaritz1 Physical Database Design.
Indexes / Session 2/ 1 of 36 Session 2 Module 3: Types of Indexes Module 4: Maintaining Indexes.
Methodology – Physical Database Design for Relational Databases.
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.
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
7 Strategies for Extracting, Transforming, and Loading.
Last Updated : 27 th April 2004 Center of Excellence Data Warehousing Group Teradata Performance Optimization.
Creating Indexes on Tables An index provides quick access to data in a table, based on the values in specified columns. A table can have more than one.
IMS 4212: Database Implementation 1 Dr. Lawrence West, Management Dept., University of Central Florida Physical Database Implementation—Topics.
Introduction to Core Database Concepts Getting started with Databases and Structure Query Language (SQL)
Copyright Sammamish Software Services All rights reserved. 1 Prog 140  SQL Server Performance Monitoring and Tuning.
SQL Server Statistics DEMO SQL Server Statistics SREENI JULAKANTI,MCTS.MCITP,MCP. SQL SERVER Database Administration.
DB Index Expert Copyright © SoftTree Technologies, Inc.
IT 5433 LM4 Physical Design. Learning Objectives: Describe the physical database design process Explain how attributes transpose from the logical to physical.
11 Copyright © 2009, Oracle. All rights reserved. Enhancing ETL Performance.
SQL IMPLEMENTATION & ADMINISTRATION Indexing & Views.
Databases and DBMSs Todd S. Bacastow January 2005.
SQL Server Statistics and its relationship with Query Optimizer
Practical Database Design and Tuning
Data, Space and Transaction Processing
Indexes By Adrienne Watt.
Indexing Structures for Files and Physical Database Design
Record Storage, File Organization, and Indexes
Physical Database Design
Informix Red Brick Warehouse 5.1
Designing Database Solutions for SQL Server
Methodology – Physical Database Design for Relational Databases
Physical Database Design for Relational Databases Step 3 – Step 8
Database Performance Tuning and Query Optimization
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
Chapter 15 QUERY EXECUTION.
Join Processing in Database Systems with Large Main Memories (part 2)
Data, Databases, and DBMSs
國立臺北科技大學 課程:資料庫系統 fall Chapter 18
Physical Database Design
Practical Database Design and Tuning
Chapter 4 Indexes.
CH 4 Indexes.
Index Use Cases.
Microsoft SQL Server 2014 for Oracle DBAs Module 7
CH 4 Indexes.
Overview of Query Evaluation
Chapter 11 Database Performance Tuning and Query Optimization
Views 1.
Query Optimization.
Performance And Scalability In Oracle9i And SQL Server 2000
Database System Concepts and Architecture
Query Processing.
Presentation transcript:

Recommending Materialized Views and Indexes with the IBM DB2 Design Advisor (Automating Physical Database Design) Jarek Gryz

Agenda Motivation Indexes in DB2 Materialized query tables in DB2 Problem definition How does the DB2 Design Advisor tool work ? Experiments

Motivation

Why have an index? Performance, Performance, Performance Provides order for example : Joins, GROUP BY, ORDER BY, DISTINCT Limits I/O and data retrieved due to filtering with predicates Range of values (start/stop keys) Join predicates Provides index-only access Enforces uniqueness or other constraints Provides statistics useful to the optimizer for cardinality estimation for example: statistics on number of keys

Why have Materialized query tables ? The MQT feature is a powerful feature in DB2 that allows you to precompute and materialize a query result into a table Full refresh or incremental refresh possible Subsequently it allows similar queries to automatically use the precomputed data from the MQT to improve performance

Problem Definition Given: Determine: Workload information System configuration Database characteristics Determine: An Index and MQT set that will lead to good workload performance in a reasonable or specified maximum time considering disk space and maintenance constraints and be easy to use

The DB2 Design Advisor Automatically capture : Determines: A representative query workload (potentially compressing it to reduce its size) The existing database characteristics and environment System information Determines: An Index and MQT set that will lead to good ESTIMATED workload response time Using DB2's Query Rewriter/Optimizer to suggest candidates Using DB2's Optimizer to provide cost / benefit information Using a combinatorial algorithm to perform a cost-benefit analysis observing constraints of (1) advisor execution time, (2) disk space and (3) anticipated DB2 costs of creating the entities plus overhead during INSERT / UPDATE / DELETE activity. Using sampled or estimated statistics of new entities Providing both GUI and command line options for initiating

Issues in automating physical DB design selection When to initiate the design algorithm? Health monitor with health indicators such as number of sort overflows to initiate the advisor What data to use to make the decision? Automatically capture workload, DB, and system information Allow work on real data or just statistics How to make the decision? Method to be described How are the recommendations implemented? Little user interaction to ask if or when to initiate to gain DBA trust Online methods to reduce implementation cost E.g., online index creation

The various steps within the Advisor

Index candidate generation During optimization generate virtual candidates when: Predicate exists but no index (e.g., R.A > 5 or R.A=S.B) Ordering required Uniqueness required Winning candidates are the virtuals in the final optimized query plan Provides candidates we know the optimizer will use

MQT Candidate Generation Candidates are generated from original queries, logical views and common expressions which are formed by matching multiple queries. Uses multiquery optimization (MQO) Provides candidates we know the queries will use Candidates can contain table references in a federated DB (tables on different servers)

Combinatorial search algorithm The search phase uses a knapsack algorithm and random swap method to choose the recommended index and MQT set Requires each candidate to have a cost-benefit ratio (cbratio) Benefit based on estimated cost with and without MQT usage (updates have negative benefit) Cost based on disk space usage REFRESH DEFERRED or IMMEDIATE MQTs recommended. Assumption (DEFERRED): estimated time for population = full refresh cost one refresh cost included in the calculation IMMEDIATE changes added in plans for insert/update/deletes If indexes on candidate MQT are selected, then the MQT must be selected as well

Experiments Detect what MQO candidates adds to performance improvement OLAP DB and workload Workload estimated execution time (WET) Type of MQT Selection WET without MQTs WET with MQTs % diff in WETs Num. of MQTs MQTs from queries 493.7 seconds 353.0 seconds 28.5% 7 MQTs from MQO 352.0 seconds 28.4% 4

Autonomic capabilities in DB2 Stinger Health Monitor Recommendation Advisor Automatic page write integrity checking Automatic index reorganization Recovery Expert Fault Monitor Backup Self-tuning Automated HADR DB2/Websphere Integration log and trace analyzer Configuration Advisor Design Advisor advises: Indexes, MDCs, MQTs, Partitioning Self-configuring Self-healing Query compiler query rewrite cost based optimization Automatic query parallelism degree Self-configuring/optimizing utilities Adaptive utility throttling Runstats Performance Expert Query patroller workload manager Self-tuning load Self-optimizing Automated Table Maintenance Runstats Reorg Statistics profiling