Index Selection tools in Microsoft SQL Server and IBM DB2

Similar documents
Self Tuning Databases

Recommending Materialized Views and Indexes with the IBM DB2 Design Advisor

DB2 Advisor: An Optimizer Smart Enough to Recommend Its Own Indexes

An Efficient, Cost-Driven Index Selection Tool for Microsoft SQL Server

Self-Tuning Database Systems: The AutoAdmin Experience

Autonomous Query-driven Index Tuning

Index Merging. Abstract. 1. Introduction

Automatic Selection of Bitmap Join Indexes in Data Warehouses

Enhanced Performance of Database by Automated Self-Tuned Systems

Autonomic Computing. A DB2 That Manages Itself?

Recommending XML Physical Designs for XML Databases

Inline LOBs (Large Objects)

AutoAdmin What-if Index Analysis Utility

The Role of Database Aware Flash Technologies in Accelerating Mission- Critical Databases

The Idea. A DB2 That Manages Itself? Agenda. Guy M. Lohman. Almaden Research Center

Autonomous Query-driven Index Tuning

Overview of Data Exploration Techniques. Stratos Idreos, Olga Papaemmanouil, Surajit Chaudhuri

Oracle Hyperion Profitability and Cost Management

Towards Autonomic Index Maintenance

AUTOMATED physical design has been the burning issue

International Journals of Combined Research & Development eissn: x,pissn: ,vol:5;issue:6,june- 2016

Toward Autonomic Computing with DB2 Universal Database

Oracle Database 11g: Real Application Testing & Manageability Overview

Parser: SQL parse tree

Oracle Database 11g: SQL Tuning Workshop

Index Selection for Embedded Control Applications using Description Logics

arxiv: v1 [cs.db] 16 Sep 2008

AutoAdmin: Self-Tuning Database Systems Technology

Tosska SQL Tuning Expert Pro for Oracle

IBM Tivoli Storage Manager for HP-UX Version Installation Guide IBM

Advanced Database Systems

Migrate from Netezza Workload Migration

Oracle 11g Optimizer Statistics Inderpal S. Johal. Inderpal S. Johal, Data Softech Inc.

Oracle Database 10g The Self-Managing Database

XML Index Recommendation with Tight Optimizer Coupling

Evaluation of relational operations

RESTORE: REUSING RESULTS OF MAPREDUCE JOBS. Presented by: Ahmed Elbagoury

We ve done. Now. Next

Caching All Plans with Just One Optimizer Call

Unit 3 Disk Scheduling, Records, Files, Metadata

Primitives for Workload Summarization and Implications for SQL

An Integrated Approach to Performance Monitoring for Autonomous Tuning

HYRISE In-Memory Storage Engine

CPE702 Algorithm Analysis and Design Week 7 Algorithm Design Patterns

Exadata Implementation Strategy

Key to A Successful Exadata POC

Lecture #14 Optimizer Implementation (Part I)

CSE 344 Final Review. August 16 th

Managing the Database

Relational Query Optimization. Highlights of System R Optimizer

Optimization Overview

Robustness in Automatic Physical Database Design

Something to think about. Problems. Purpose. Vocabulary. Query Evaluation Techniques for large DB. Part 1. Fact:

Administrivia Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications

Big Data Processing Technologies. Chentao Wu Associate Professor Dept. of Computer Science and Engineering

Administrivia Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications

Keyword Search over Hybrid XML-Relational Databases

Optimization of Queries in Distributed Database Management System

CS 4604: Introduction to Database Management Systems. B. Aditya Prakash Lecture #10: Query Processing

An Overview of Cost-based Optimization of Queries with Aggregates

systems & research project

Query Optimization in Distributed Databases. Dilşat ABDULLAH

MySQL for Database Administrators Ed 4

CAS CS 460/660 Introduction to Database Systems. Query Evaluation II 1.1

Massively Parallel Seesaw Search for MAX-SAT

ONLINE INDEXING FOR DATABASES USING QUERY WORKLOADS

MapReduce-II. September 2013 Alberto Abelló & Oscar Romero 1

Concurrent execution of an analytical workload on a POWER8 server with K40 GPUs A Technology Demonstration

Db2 9.7 Create Table If Not Exists >>>CLICK HERE<<<

DATABASE Management Systems (DBMSs) have been

Lightweight Automatic Index Selection for Relational Databases

Query Processing & Optimization

IBM EXAM - C DB Fundamentals. Buy Full Product.

Teradata Analyst Pack More Power to Analyze and Tune Your Data Warehouse for Optimal Performance

Oracle 1Z0-514 Exam Questions and Answers (PDF) Oracle 1Z0-514 Exam Questions 1Z0-514 BrainDumps

Developing Integrated Engine for Database Administrator and Developer

Greedy Algorithms CHAPTER 16

Automatic Parallel Execution Presented by Joel Goodman Oracle University EMEA

Elementary IR: Scalable Boolean Text Search. (Compare with R & G )

Diagnosing Estimation Errors in Page Counts Using Execution Feedback

Migrate from Netezza Workload Migration

Data Warehouse Workloads

Challenges in building a DBMS Resource Advisor

MariaDB Optimizer. Current state, comparison with other branches, development plans

Compressing SQL Workloads Ashish Kumar Gupta* University of Washington, Seattle 114, Sieg Hall, Box Seattle, WA (206)

XML Index Recommendation with Tight Optimizer Coupling

CSE 190D Spring 2017 Final Exam Answers

Overview of Implementing Relational Operators and Query Evaluation

PARALLEL & DISTRIBUTED DATABASES CS561-SPRING 2012 WPI, MOHAMED ELTABAKH

Problem Set 2 Solutions

Presentation Abstract

Exadata Implementation Strategy

Examples of Physical Query Plan Alternatives. Selected Material from Chapters 12, 14 and 15

Attack on DES. Jing Li

Answering Queries Using Views

Greedy Algorithms 1 {K(S) K(S) C} For large values of d, brute force search is not feasible because there are 2 d {1,..., d}.

Greedy Algorithms. Previous Examples: Huffman coding, Minimum Spanning Tree Algorithms

Chapter 5 Managing the Data

Demystifying SQL Tuning: Tips and Techniques for SQL Experts

INDEXES MICHAEL LIUT DEPARTMENT OF COMPUTING AND SOFTWARE MCMASTER UNIVERSITY

Transcription:

Index Selection tools in Microsoft SQL Server and IBM DB2 Seminar: Self-Tuning Databases Marcel Giard 26.11.2003

Structure Introduction Microsoft SQL Server Index Selection Tool IBM DB2 Advisor Conclusion Index Selection Tools in Microsoft SQL Server and IBM DB2 2

Introduction Indexes have great impact on performance of a DB configuration: set of indexes goal: support DBA with powerfully tool older approaches independent DB optimizer using the DB optimizer avoids asynchrony Index Selection Tools in Microsoft SQL Server and IBM DB2 3

Problem Ideal: pick optimal index configuration from all possible configurations for a given workload for a table with n columns: e.g. a table with 10 has 6235301 possible indexes not counting different types of indexes analogue for index configurations for a DB with n tables n k=1 n!/ n k! Index Selection Tools in Microsoft SQL Server and IBM DB2 4

Microsoft Index Selection Tool part of Auto Admin time to perform a workload represents the cost of the workload uses own optimizer for cost estimation different algorithms to narrow the search room iterative (first single column indexes then multi column indexes) Index Selection Tools in Microsoft SQL Server and IBM DB2 5

Architecture

Candidate Index Selection selects promising index configurations breaks down a workload of n queries in n workloads of one query Index selection for each of them (seed: indexable columns) union of results builds set of candidate index configurations Index Selection Tools in Microsoft SQL Server and IBM DB2 7

Configuration Enumeration number of all subsets of the candidate indexes still too big uses a greedy algorithm start with a pair of indexes and add successive the one with best benefit-cost ratio Index Selection Tools in Microsoft SQL Server and IBM DB2 8

Cost Evaluation lowers number of optimizer calls keeps track of former cost estimations of the optimizer and tries to derive costs for some queries from it e.g.: if for one query in the workload the new configuration only differs in indexes not used in this query the old cost can be used Index Selection Tools in Microsoft SQL Server and IBM DB2 9

What-if Tool uses modified SQL Server to operate with hypothetical indexes generating statistics for these indexes changing catalogue tables call optimizer in no-execute mode returns costs undoes changes Index Selection Tools in Microsoft SQL Server and IBM DB2 10

Multi-column Index Generation iterative approach create multi-column indexes with increasing width builds new multi-column indexes by adding a indexable column to an existing index generates new configurations by adding multicolumn indexes to existing configurations gives them to the Candidate Index Selection Index Selection Tools in Microsoft SQL Server and IBM DB2 11

Test Results numbers from Microsoft Index Selection Tools in Microsoft SQL Server and IBM DB2 12

IBM DB2 Advisor let the optimizer recommend candidate indexes each query in the workload is only called once all in one call index selection as variant of the Knapsack Problem input: workload + statistics of the DB output: recommended indexes Index Selection Tools in Microsoft SQL Server and IBM DB2 13

Architecture Index Selection Tools in Microsoft SQL Server and IBM DB2 14

Single Query Optimization Idea extension of existing optimization process idea: suppose all possible indexes available run optimization indexes chosen by the optimizer are the optimal 2 ways in real world: Brute Force and Ignorance (BFI) Smart column Enumeration for Index Scans (SAEFIS) Index Selection Tools in Microsoft SQL Server and IBM DB2 15

Single Query Optimization Algorithm ALGORITHM 1: RECOMMEND INDEXES(Statement S) 1. Enable RECOMMEND INDEXES mode 2. Enter the DB2 Optimizer 3. Inject the schema with virtual indexes using SAEFIS and generate their statistics 4. Inject the schema with virtual indexes using BFI and generate their statistics 5. Construct the best plan for S by calling the DB2 Optimizer 6. Scan the optimal plan, searching for virtual indexes 7. Submit these indexes back to the user as recommended. Index Selection Tools in Microsoft SQL Server and IBM DB2 16

Workload Optimization Idea Knapsack Problem approach indexes selected in order of their benefit up to a maximal size then create variants by swapping small sets of indexes and test them if its cheaper its the new solution duration determines the quality of the solution Index Selection Tools in Microsoft SQL Server and IBM DB2 17

Workload Optimization Algorithm 1 ALGORITHM 2: 1. Get Workload W, including the frequency of execution of each statement. 2. R = ~ 3. For each Statement S in W, (a) EXPLAIN S with existing indexes, returning S.cost with existing indexes. 4. For each Statement S in W, (a) EXPLAIN S in RECOMMEND INDEX mode, i.e. with virtual indexes (b) R = R RECOMMEND INDEXES(S) Index Selection Tools in Microsoft SQL Server and IBM DB2 18

Workload Optimization Algorithm 2 ALGORITHM 2: 5. For each index I in R (a) I.benefit = S.cost with existing indexes - S.cost with virtual indexes (b) I.size = bytes in index 6. Sort indexes in R by decreasing benefit-to-cost ratio. 7. Combine any index subsumed by an index with a higher ratio with that index. 8. Accept indexes from set R until disk constraint is exhausted. 9. while (time did not expire) repeat (a) TRY VARIATION Index Selection Tools in Microsoft SQL Server and IBM DB2 19

Test Results 1 Index Selection Tools in Microsoft SQL Server and IBM DB2 20

Test Results 2 Index Selection Tools in Microsoft SQL Server and IBM DB2 21

Conclusions Microsoft SQL Server cost based works mainly outside DB optimizer reducing DB optimizer invocations extra tool IBM DB2 DB optimizer recommends indexes works mainly within the DB optimizer few optimizer call lower maintenance more complex DB optimizer Index Selection Tools in Microsoft SQL Server and IBM DB2 22

References [CN97] Surajit Chaudhuri and Vivek Narasayya, An Efficient, Cost-Driven Index Selection Tool for Microsoft SQL Server, Proceedings of the 23rd VLDB Conference Athens, Greece, 1997, pages 146-155 [CN98] Surajit Chaudhuri and Vivek R. Narasayya, AutoAdmin 'What-if' Index Analysis Utility. In Haas and Tiwary [HT98], pages 367-378 [LVZZS00] G. Lohman, G. Valentin, D. Zilio, M. Zuliani, A Skelly, "DB2 Advisor: An optimizer smart enough to recommend its own indexes", Proceedings, 16th IEEE Conference on Data Engineering, San Diego, CA, 2000. Index Selection Tools in Microsoft SQL Server and IBM DB2 23