Database performance becomes an important issue in the presence of

Size: px
Start display at page:

Download "Database performance becomes an important issue in the presence of"

Transcription

1 Database tuning is the process of improving database performance by minimizing response time (the time it takes a statement to complete) and maximizing throughput the number of statements a database can handle concurrently per second). Tuning is a team exercise - collectively performed by DBAs, database designers, application designers and database users, based understanding of the database. Tuning both depends on and impacts the following: - Table design, relationships, index design, and other components. - Query design, size of data read and retrieved, and order of execution. - Nature and frequency of read and insert/update/delete operations - Partitioning of the work between the Database server and the client. - Timing, events and effect of loading tables, indexes or parts there of into memory. - Concurrency characteristics of statements Database performance becomes an important issue in the presence of - large amounts of data, - complex queries, - queries manipulating large amounts of data, - long running queries, - queries that lock every one else out, - large number of simultaneous transactions, - large numbers of users, and - limited bandwidth. In general, most database systems are designed for good performance. The best improvements can be achieved in the initial design phase but sometimes not enough information is available about the characteristics of a database. Later, altering a large database in production use can be expensive and practical considerations put constraints on what can be changed. Tuning can make the difference between a query taking milliseconds or minutes or even more to execute. 1 / 12

2 Imagine that the customer table in sakila database contains information about 500,000 customers and city table contains another several hundred rows: {code} SELECT cu.customer_id AS ID, CONCAT(cu.first_name, _utf8' ', cu.last_name) AS name, a.address AS address, a.postal_code AS `zip code`, a.phone AS phone, city.city AS city, country.country AS country, IF(cu.active, _utf8'active',_utf8'') AS notes, cu.store_id AS StoreID FROM customer AS cu JOIN address AS a ON cu.address_id = a.address_id JOIN city ON a.city_id = city.city_id JOIN country ON city.country_id = country.country_id WHERE country LIKE 'U%' AND city REGEXP '[A-L]*'; {/code} Without appropriate indexes, the database system may take a long time completing this query due to massive joins. More on query tuning and indexing in another lessson. Improving Application Design A SQL statement or transaction can be written in different ways to perform the same task - some good and some not so good. Smart Database systems automatically rearrange SQL queries for performance via query optimization. In doing so, the database system query optimizer uses information such as table sizes, indexes available, and the distribution of data. However, a query optimizer may not be able to optimize poorly written SQL code best understood by the application writer. If some queries are known to require more processing time than others, an application may be rearranged to run those at a no-load or low-load time. 2 / 12

3 Range queries (ones that search for values within a range) can be slower than exact match queries. Also, join and nested queries, and queries that use clauses such as the DISTINCT and ORDER BY clauses can be slow. A large number of simultaneous users can slow down response time if the system does not have enough memory or processor cycles or if the transactions conflict heavily. Using Non-Normalized Tables To Eliminate Joins As we have seen in another lesson, normalizing tables eliminates data redundancy and the associated data consistency problems. However, to improve performance, databases are sometimes use normalized tables to store redundant data to avoid or eliminate joins. Here are two examples of reading film with categories: Code Sample: OptimizeDB/Demos/Normalized-Film.sql SELECT title, description, rating, c.name as category FROM film f JOIN film_category fc USING (film_id) JOIN category c USING (category_id); Code Explanation Normalized access via film_category and category. Execution of this query may be slowed down by the two joins. This often-used query can now be written with no join as: Code Sample: OptimizeDB/Demos/Non-Normalized-Film.sql SELECT title, description, rating, category_name as category FROM film_detail f; Code Explanation No joins are needed as category name is stored along with film in the Non-normalized film_detail. table 3 / 12

4 Precomputing Queries Frequently executed queries requiring a fair amount of fetching can be precomputed and their results stored in the database. This will reduce both disk I/O and query processing times. Storing pre-computed summary data in the database can significantly improve performance on frequently used queries, such as maintaining counts, sums and related updates. Here are two examples of reading film with stock count: Code Sample: OptimizeDB/Demos/Count-On-Demand.sql SELECT film_id, title, count(inventory_id) AS in_stock FROM film JOIN inventory USING (film_id) GROUP BY film_id HAVING in_stock > 3; Code Explanation Film inventory is always fetched fresh from database, requiring a join and a GROUP BY. Execution of this query may be improved by eliminating both joins and aggregation-on-demand as: Code Sample: OptimizeDB/Demos/Pre-Computed.sql SELECT film_id, title, in_stock FROM film_detail WHERE in_stock > 3; Code Explanation Film count in stock is stored with the film. The updates to inventory will be automated using triggers on the inventory table. The results need not be stored in existing tables. One may create new tables or even 4 / 12

5 materialized views. Warning: The performance-gain benefits of removing the joins and pre-computing must outweigh the cost of altering the table, any extra storage, maintaining redundant data consistently and other limitations of non-normalized tables such as loss of cardinality. The tradeoff is between a slight performance degradation during inserts and changes to orders and a significant performance improvement in summary information queries. Materialized Views Creating materialized views or pre-created result sets can be beneficial if computing this data involves joining large tables with very dynamic and loose matching criteria, very common in web applications these days via custom-search forms. A database supporting materialized views will automatically update the views to incorporate relevant changes made to the base tables. Some smart systems perform these changes incrementally, leading to considerable reduction in update processing. Warning: MySQL does not support materialized views and the same can be simulated via tables containing result-sets updated using pre-computed queries. These tables will need to be maintained via batch jobs or using triggers on base tables. In many summary-data situations, the base tables are updated using batch jobs anyway. Code Sample: OptimizeDB/Demos/Materialized-View.sql {code} DROP TABLE IF EXISTS customer_summary; CREATE TABLE customer_summary SELECT cu.customer_id AS ID, CONCAT(cu.first_name, _utf8' ', cu.last_name) AS name, a.address AS address, a.postal_code AS `zip code`, a.phone AS phone, city.city AS city, country.country AS country, IF(cu.active, _utf8'active',_utf8'') AS notes, cu.store_id AS SID, COUNT(r.rental_id) AS rental_count, SUM(p.amount) AS payment 5 / 12

6 FROM customer AS cu JOIN address AS a ON cu.address_id = a.address_id JOIN city ON a.city_id = city.city_id JOIN country ON city.country_id = country.country_id JOIN rental r USING (customer_id) JOIN payment p USING (customer_id) GROUP BY customer_id ; {/code} Code Explanation A new table is create to contain often used customer information to represent a materialized view. The table also keeps rental count and total payments made by each customer. Transactions Transaction planning and design impact performance in many ways. - Generally, performance is improved by using small or short-running transactions. - Splitting large and complex transactions into small transactions will also reduce chances of deadlock and the associated high cost of transaction management to break deadlocks or rollbacks. Small transactions presumably need fewer locks and thus compete less for locks between them, reducing the waiting time for locks. This also increases concurrency. - In other cases, it may be beneficial to combine several small update transactions into one transaction so the disk writes at the end of each transaction are merged together. - Using non-locking reads (SQL Level 1, that is, READ UNCOMMITED level) perform well but only if not-so-exact results are acceptable to the users. Indexing Indexes greatly reduce database access time but they incur maintenance overheads when data rows are inserted, updated, or deleted, leading to additional disk I/O, more processing time, and extra storage. MySQL uses indexes to: 6 / 12

7 - Quickly find the rows matching a WHERE clause. - Eliminate rows from consideration. If there is a choice between multiple indexes, MySQL normally uses the index that finds the smallest number of rows. - Retrieve rows from other tables when performing joins. - Find the MIN() or MAX() value for a specific indexed column. For example: SELECT MIN(key_part2),MAX(key_part2) FROM tbl_name WHERE key_part1=10; - Sort or group a table if the sorting or grouping is done on a leftmost prefix of a usable key (for example, ORDER BY key_part1, key_part2). - Optimize a query to retrieve values without consulting the data rows. If a query uses only columns from a table that are numeric and that form a leftmost prefix for some key, the selected values may be retrieved from the index tree for greater speed: SELECT key_part3 FROM tbl_name WHERE key_part1=1 Types Of Indexes Two indexes commonly used in databases are the hash and B+-tree indexes. Hash indexes are very fast for equality searches, especially for columns with unique values. The number of disk blocks retrieved to get the desired data will be very small, say one or two. But hash indexes do not perform well for range queries because they are not clustering indexes - database items within a range might not be stored contiguously on disk because their hash values may be very different. B+-tree indexes, on the other hand, perform well for both equality and range queries though they are not as fast as hash indexes for equality searches: SELECT * FROM film WHERE title = 'FARGO'; If there are going to be many such queries, then a hash index on column title of film would be appropriate. Hash Index Characteristics: - They are used only for equality comparisons that use the = or <=> operators. - They are not used for comparison operators such as < that find a range of values. - The optimizer cannot use a hash index to speed up ORDER BY operations, as hashes have no natural ordering. - MySQL cannot determine approximately how many rows there are between two values (this is used by the range optimizer to decide which index to use). This may affect some queries if you change a MyISAM table to a hash-indexed MEMORY table. - Only whole keys can be used to search for a row. Where as with a B-tree index, any 7 / 12

8 leftmost prefix of the key can be used to find rows. B-tree Indexes Hash indexes cannot be used for range queries: SELECT * FROM film WHERE rental_rate > 2.99; A B-tree index can be used for column comparisons in expressions that use the =, >, >=, <, <=, or BETWEEN operators. The index also can be used for LIKE comparisons if the argument to LIKE is a constant string that does not start with a wildcard character. For example, the following SELECT statements use indexes: It would be best to use a B+-tree index on column rental_rate of film. SELECT * FROM tbl_name WHERE key_col LIKE 'Patrick%'; SELECT * FROM tbl_name WHERE key_col LIKE 'Pat%_ck%'; In the first statement, only rows with 'Patrick' <= key_col < 'Patricl' are considered. In the second statement, only rows with 'Pat' <= key_col < 'Pau' are considered. Indexes are not used when... The following SELECT statements do not use indexes: SELECT * FROM tbl_name WHERE key_col LIKE '%Patrick%'; SELECT * FROM tbl_name WHERE key_col LIKE other_col; In the first statement, the LIKE value begins with a wildcard character. In the second statement, the LIKE value is not a constant. Different Data Types for Compared Columns MySQL can use indexes on columns more efficiently if they are declared as the same type and size. In this context, VARCHAR and CHAR are considered the same if they are declared as the same size. For example, VARCHAR(10) and CHAR(10) are the same size, but VARCHAR(10) and CHAR(15) are not. 8 / 12

9 Comparing columns with different types may prevent use of indexes when values cannot be compared without conversion, for example, when a numeric column is compared to a string type column. For a given value such as 5 in the numeric column, it compares equal to several values in the string column such as '5 ', ' 5', '005', or '005.e1'. This conversion requirement will discard any indexes for the string column. What To Index? Analyzing and understanding frequently executed queries can help decide what to index. For example, assume that queries such as are executed frequently: SELECT title FROM film JOIN inventory USING (film_id) JOIN rental USING (inventory_id) WHERE rating = 'PG'; A database system will try to minimize the number of rows involved in a join. Assuming that re ntal is larger than film, it will first select rows from the film table that satisfy the filter condition Whether or not an index should be created depends on the application. If a SELECT statement returns a small percentage of the total number of rows, then it will benefit from an index; otherwise, it may not.: SELECT title FROM film WHERE title LIKE 'G%'; The result of this query could be empty, consist of one row, a few rows, or a large number of rows. If the result is a small percentage, say 5% or less, of the rows. If the percentage is 50% or more, then using an index may not be beneficial. As the number of rows in a table increases, the benefit of using an index increases. The breakeven point for using an index, will depend, in addition to query selectivity and table size, upon the query result size, the frequency of the queries, and the need for fast responses. Note: Indexes not being used should be removed to reduce maintenance overheads. 9 / 12

10 Client-Server Interactions All users (clients) interacting with a database server will expect (demand) good response times. Many factors in the interactions between applications running on the client and the database server will affect performance, for example: - Data Processing At The Client Or The Database Server: After the data has been retrieved, some additional processing may need to be performed - at the client or at the database server. If processing is done at the database server, then this may slow down the database server for everyone. If the processing is done at the client, then the needed data will have to be transmitted from the database to the client over the network which can take time and affect others. As an example suppose that a sales report has to be generated by aggregating much raw data and then sorting it in a variety of ways: - The sales report can be aggregated at the database server or at the client. If aggregated at the database server, it will slow down the server. If aggregated at the client, much data may have to be transmitted to the client. In this case, it would seem appropriate to do aggregation at the database server. - The sales report data can be sorted at the database server or at the client. It would be appropriate to do the sorting at the client to avoid burdening the database server. Unlike in the first case of sending data to the client for aggregation, not much data will have to be transmitted to the client. - Connections To The Database Server: Instead of opening a new connection for each SQL statement, the client should keep one connection open for the whole session. Opening and closing connections is expensive / 12

11 Data Transfer: Fetching rows, one by one, from the database server will be slower than fetching groups of rows. MyISAM Index Collecting Statistics Storage engines collect statistics about tables for use by the optimizer. Table statistics are based on value groups, where a value group is a set of rows with the same key prefix value. For optimizer purposes, an important statistic is the average value group size. MySQL uses the average value group size to estimate: - how may rows must be read for each ref access - how many row a partial join will produce; that is, an operation like: Syntax (...) JOIN tbl_name ON tbl_name.key = expr As the average value group size for an index increases, the index is less useful for those two purposes because the average number of rows per lookup increases: For the index to be good for optimization purposes, it is best that each index value target a small number of rows in the table. When a given index value yields a large number of rows, the index is less useful and MySQL is less likely to use it. The SHOW INDEX statement displays a cardinality value based on N/S, where N is the number of rows in the table and S is the average value group size. That ratio yields an approximate number of value groups in the table. To help make decisions about performance, MySQL supports ANALYZE TABLE statement to collect statistics about the data in the tables including information about data distribution, and use this to determine the query selectivity and result size. The following statement generates data distribution statistics for the table rental 11 / 12

12 Here is an exercise to perform some table analysis: Exercise: Table Analysis Duration: 20 to 30 minutes. In this exercise, you will analyze tables. 1. See indexes for rental table, check cardinality. 2. Write and execute a procedure to insert several rows with random data in the rental table. 3. See indexes for rental table again, cardinality should reflect the same numbers. 4. Analyze table. 5. See indexes for rental table again, cardinality should reflect new rows inserted. To regenerate table statistics, one can also use myisamchk or CHECK TABLE. Optimizing Databases and Their Objects Conclusion This lesson covered the optimization of a MySQL database for performance. To continue to learn MySQL go to the top of this page and click on the next lesson in this MySQL Tutorial's Table of Contents. 12 / 12

Grouping Data using GROUP BY in MySQL

Grouping Data using GROUP BY in MySQL Grouping Data using GROUP BY in MySQL One key feature supported by the SELECT is to find aggregate values, grouping data elements as needed. ::= SELECT... [GROUP BY ]

More information

Introducing Transactions

Introducing Transactions We have so far interactively executed several SQL statements that have performed various actions in your MySQL database. The statements were run in an isolated environment one statement at a time, with

More information

To insert a record into a table, you must specify values for all fields that do not have default values and cannot be NULL.

To insert a record into a table, you must specify values for all fields that do not have default values and cannot be NULL. Once tables have been created, the database sits like an empty container. To initially fill this database container with data, we need to use INSERT statements to add data in a MySQL database. To insert

More information

Brief History of SQL. Relational Database Management System. Popular Databases

Brief History of SQL. Relational Database Management System. Popular Databases Brief History of SQL In 1970, Dr. E.F. Codd published "A Relational Model of Data for Large Shared Data Banks," an article that outlined a model for storing and manipulating data using tables. Shortly

More information

Towards a Sufficient Set of Mutation Operators for. Structured Query Language (SQL)

Towards a Sufficient Set of Mutation Operators for. Structured Query Language (SQL) Towards a Sufficient Set of Mutation Operators for Structured Query Language (SQL) Donald W. McCormick II Thesis submitted to the faculty of the Virginia Polytechnic Institute and State University in partial

More information

Lecture 17. Monday, November 17, 2014

Lecture 17. Monday, November 17, 2014 Lecture 17 Monday, November 17, 2014 DELIMITER So far this semester, we ve used ; to send all of our SQL statements However, when we define routines that use SQL statements in them, it can make distinguishing

More information

CSED421 Database Systems Lab. Index

CSED421 Database Systems Lab. Index CSED421 Database Systems Lab Index Index of Index What is an index? When to Create an Index or Not? Index Syntax UNIQUE Index / Indexing Prefixes / Multiple-column index Confirming indexes Index types

More information

Writing High Performance SQL Statements. Tim Sharp July 14, 2014

Writing High Performance SQL Statements. Tim Sharp July 14, 2014 Writing High Performance SQL Statements Tim Sharp July 14, 2014 Introduction Tim Sharp Technical Account Manager Percona since 2013 16 years working with Databases Optimum SQL Performance Schema Indices

More information

7. Query Processing and Optimization

7. Query Processing and Optimization 7. Query Processing and Optimization Processing a Query 103 Indexing for Performance Simple (individual) index B + -tree index Matching index scan vs nonmatching index scan Unique index one entry and one

More information

MySQL Indexing. Best Practices for MySQL 5.6. Peter Zaitsev CEO, Percona MySQL Connect Sep 22, 2013 San Francisco,CA

MySQL Indexing. Best Practices for MySQL 5.6. Peter Zaitsev CEO, Percona MySQL Connect Sep 22, 2013 San Francisco,CA MySQL Indexing Best Practices for MySQL 5.6 Peter Zaitsev CEO, Percona MySQL Connect Sep 22, 2013 San Francisco,CA For those who Does not Know Us Percona Helping Businesses to be Successful with MySQL

More information

System Characteristics

System Characteristics System Characteristics Performance is influenced by characteristics of the system hosting the database server, for example: - Disk input/output (I/O) speed. - Amount of memory available. - Processor speed.

More information

ORACLE TRAINING CURRICULUM. Relational Databases and Relational Database Management Systems

ORACLE TRAINING CURRICULUM. Relational Databases and Relational Database Management Systems ORACLE TRAINING CURRICULUM Relational Database Fundamentals Overview of Relational Database Concepts Relational Databases and Relational Database Management Systems Normalization Oracle Introduction to

More information

Chapter 12: Indexing and Hashing. Basic Concepts

Chapter 12: Indexing and Hashing. Basic Concepts Chapter 12: Indexing and Hashing! Basic Concepts! Ordered Indices! B+-Tree Index Files! B-Tree Index Files! Static Hashing! Dynamic Hashing! Comparison of Ordered Indexing and Hashing! Index Definition

More information

Chapter 12: Indexing and Hashing

Chapter 12: Indexing and Hashing Chapter 12: Indexing and Hashing Basic Concepts Ordered Indices B+-Tree Index Files B-Tree Index Files Static Hashing Dynamic Hashing Comparison of Ordered Indexing and Hashing Index Definition in SQL

More information

MySQL Indexing. Best Practices. Peter Zaitsev, CEO Percona Inc August 15, 2012

MySQL Indexing. Best Practices. Peter Zaitsev, CEO Percona Inc August 15, 2012 MySQL Indexing Best Practices Peter Zaitsev, CEO Percona Inc August 15, 2012 You ve Made a Great Choice! Understanding indexing is crucial both for Developers and DBAs Poor index choices are responsible

More information

File Structures and Indexing

File Structures and Indexing File Structures and Indexing CPS352: Database Systems Simon Miner Gordon College Last Revised: 10/11/12 Agenda Check-in Database File Structures Indexing Database Design Tips Check-in Database File Structures

More information

Optimizing Testing Performance With Data Validation Option

Optimizing Testing Performance With Data Validation Option Optimizing Testing Performance With Data Validation Option 1993-2016 Informatica LLC. No part of this document may be reproduced or transmitted in any form, by any means (electronic, photocopying, recording

More information

Chapter 11: Indexing and Hashing

Chapter 11: Indexing and Hashing Chapter 11: Indexing and Hashing Basic Concepts Ordered Indices B + -Tree Index Files B-Tree Index Files Static Hashing Dynamic Hashing Comparison of Ordered Indexing and Hashing Index Definition in SQL

More information

Evaluation of Relational Operations: Other Techniques

Evaluation of Relational Operations: Other Techniques Evaluation of Relational Operations: Other Techniques [R&G] Chapter 14, Part B CS4320 1 Using an Index for Selections Cost depends on #qualifying tuples, and clustering. Cost of finding qualifying data

More information

CPS352 Lecture - Indexing

CPS352 Lecture - Indexing Objectives: CPS352 Lecture - Indexing Last revised 2/25/2019 1. To explain motivations and conflicting goals for indexing 2. To explain different types of indexes (ordered versus hashed; clustering versus

More information

Covering indexes. Stéphane Combaudon - SQLI

Covering indexes. Stéphane Combaudon - SQLI Covering indexes Stéphane Combaudon - SQLI Indexing basics Data structure intended to speed up SELECTs Similar to an index in a book Overhead for every write Usually negligeable / speed up for SELECT Possibility

More information

Evaluation of Relational Operations: Other Techniques

Evaluation of Relational Operations: Other Techniques Evaluation of Relational Operations: Other Techniques Chapter 14, Part B Database Management Systems 3ed, R. Ramakrishnan and Johannes Gehrke 1 Using an Index for Selections Cost depends on #qualifying

More information

Kathleen Durant PhD Northeastern University CS Indexes

Kathleen Durant PhD Northeastern University CS Indexes Kathleen Durant PhD Northeastern University CS 3200 Indexes Outline for the day Index definition Types of indexes B+ trees ISAM Hash index Choosing indexed fields Indexes in InnoDB 2 Indexes A typical

More information

<Insert Picture Here> Looking at Performance - What s new in MySQL Workbench 6.2

<Insert Picture Here> Looking at Performance - What s new in MySQL Workbench 6.2 Looking at Performance - What s new in MySQL Workbench 6.2 Mario Beck MySQL Sales Consulting Manager EMEA The following is intended to outline our general product direction. It is

More information

Hash-Based Indexing 165

Hash-Based Indexing 165 Hash-Based Indexing 165 h 1 h 0 h 1 h 0 Next = 0 000 00 64 32 8 16 000 00 64 32 8 16 A 001 01 9 25 41 73 001 01 9 25 41 73 B 010 10 10 18 34 66 010 10 10 18 34 66 C Next = 3 011 11 11 19 D 011 11 11 19

More information

SQL STORED ROUTINES. CS121: Relational Databases Fall 2017 Lecture 9

SQL STORED ROUTINES. CS121: Relational Databases Fall 2017 Lecture 9 SQL STORED ROUTINES CS121: Relational Databases Fall 2017 Lecture 9 SQL Functions 2 SQL queries can use sophisticated math operations and functions Can compute simple functions, aggregates Can compute

More information

MySQL User Conference and Expo 2010 Optimizing Stored Routines

MySQL User Conference and Expo 2010 Optimizing Stored Routines MySQL User Conference and Expo 2010 Optimizing Stored Routines 1 Welcome, thanks for attending! Roland Bouman; Leiden, Netherlands Ex MySQL AB, Sun Microsystems Web and BI Developer Co-author of Pentaho

More information

Evaluation of Relational Operations: Other Techniques

Evaluation of Relational Operations: Other Techniques Evaluation of Relational Operations: Other Techniques Chapter 12, Part B Database Management Systems 3ed, R. Ramakrishnan and Johannes Gehrke 1 Using an Index for Selections v Cost depends on #qualifying

More information

Database Architectures

Database Architectures Database Architectures CPS352: Database Systems Simon Miner Gordon College Last Revised: 4/15/15 Agenda Check-in Parallelism and Distributed Databases Technology Research Project Introduction to NoSQL

More information

Implementation of Relational Operations: Other Operations

Implementation of Relational Operations: Other Operations Implementation of Relational Operations: Other Operations Module 4, Lecture 2 Database Management Systems, R. Ramakrishnan 1 Simple Selections SELECT * FROM Reserves R WHERE R.rname < C% Of the form σ

More information

NEED FOR SPEED: BEST PRACTICES FOR MYSQL PERFORMANCE TUNING JANIS GRIFFIN PERFORMANCE EVANGELIST / SENIOR DBA

NEED FOR SPEED: BEST PRACTICES FOR MYSQL PERFORMANCE TUNING JANIS GRIFFIN PERFORMANCE EVANGELIST / SENIOR DBA NEED FOR SPEED: BEST PRACTICES FOR MYSQL PERFORMANCE TUNING JANIS GRIFFIN PERFORMANCE EVANGELIST / SENIOR DBA 1 WHO AM I?» Senior DBA / Performance Evangelist for Solarwinds Janis.Griffin@solarwinds.com

More information

Tired of MySQL Making You Wait? Alexander Rubin, Principal Consultant, Percona Janis Griffin, Database Evangelist, SolarWinds

Tired of MySQL Making You Wait? Alexander Rubin, Principal Consultant, Percona Janis Griffin, Database Evangelist, SolarWinds Tired of MySQL Making You Wait? Alexander Rubin, Principal Consultant, Percona Janis Griffin, Database Evangelist, SolarWinds Who Am I? Senior DBA / Performance Evangelist for Solarwinds Janis.Griffin@solarwinds.com

More information

Segregating Data Within Databases for Performance Prepared by Bill Hulsizer

Segregating Data Within Databases for Performance Prepared by Bill Hulsizer Segregating Data Within Databases for Performance Prepared by Bill Hulsizer When designing databases, segregating data within tables is usually important and sometimes very important. The higher the volume

More information

Frequently Asked Questions. Fulltext Indexing on Large Documentum Repositories For Content Server Versions up to 5.2.x

Frequently Asked Questions. Fulltext Indexing on Large Documentum Repositories For Content Server Versions up to 5.2.x Frequently Asked Questions Fulltext Indexing on Large Documentum Repositories For Content Server Versions up to 5.2.x FAQ Version 1.0 Performance Engineering Page 1 of 8 FAQ1. Q. How will my Hardware requirements

More information

SQL Coding Guidelines

SQL Coding Guidelines SQL Coding Guidelines 1. Always specify SET NOCOUNT ON at the top of the stored procedure, this command suppresses the result set count information thereby saving some amount of time spent by SQL Server.

More information

Chapter 17: Parallel Databases

Chapter 17: Parallel Databases Chapter 17: Parallel Databases Introduction I/O Parallelism Interquery Parallelism Intraquery Parallelism Intraoperation Parallelism Interoperation Parallelism Design of Parallel Systems Database Systems

More information

Databasesystemer, forår 2005 IT Universitetet i København. Forelæsning 8: Database effektivitet. 31. marts Forelæser: Rasmus Pagh

Databasesystemer, forår 2005 IT Universitetet i København. Forelæsning 8: Database effektivitet. 31. marts Forelæser: Rasmus Pagh Databasesystemer, forår 2005 IT Universitetet i København Forelæsning 8: Database effektivitet. 31. marts 2005 Forelæser: Rasmus Pagh Today s lecture Database efficiency Indexing Schema tuning 1 Database

More information

Improving IBM Red Brick Warehouse Query Performance

Improving IBM Red Brick Warehouse Query Performance Improving IBM Red Brick Warehouse Query Performance Aman Sinha, Richard Taylor, Mandar Pimpale, David Wilhite, Cindy Fung European Red Brick Users Group Conference 2003 Milano, Italy September 9 September

More information

INTERMEDIATE SQL GOING BEYOND THE SELECT. Created by Brian Duffey

INTERMEDIATE SQL GOING BEYOND THE SELECT. Created by Brian Duffey INTERMEDIATE SQL GOING BEYOND THE SELECT Created by Brian Duffey WHO I AM Brian Duffey 3 years consultant at michaels, ross, and cole 9+ years SQL user What have I used SQL for? ROADMAP Introduction 1.

More information

Database Architectures

Database Architectures Database Architectures CPS352: Database Systems Simon Miner Gordon College Last Revised: 11/15/12 Agenda Check-in Centralized and Client-Server Models Parallelism Distributed Databases Homework 6 Check-in

More information

6232B: Implementing a Microsoft SQL Server 2008 R2 Database

6232B: Implementing a Microsoft SQL Server 2008 R2 Database 6232B: Implementing a Microsoft SQL Server 2008 R2 Database Course Overview This instructor-led course is intended for Microsoft SQL Server database developers who are responsible for implementing a database

More information

Evaluation of relational operations

Evaluation of relational operations Evaluation of relational operations Iztok Savnik, FAMNIT Slides & Textbook Textbook: Raghu Ramakrishnan, Johannes Gehrke, Database Management Systems, McGraw-Hill, 3 rd ed., 2007. Slides: From Cow Book

More information

Mastering the art of indexing

Mastering the art of indexing Mastering the art of indexing Yoshinori Matsunobu Lead of MySQL Professional Services APAC Sun Microsystems Yoshinori.Matsunobu@sun.com 1 Table of contents Speeding up Selects B+TREE index structure Index

More information

Course Modules for MCSA: SQL Server 2016 Database Development Training & Certification Course:

Course Modules for MCSA: SQL Server 2016 Database Development Training & Certification Course: Course Modules for MCSA: SQL Server 2016 Database Development Training & Certification Course: 20762C Developing SQL 2016 Databases Module 1: An Introduction to Database Development Introduction to the

More information

DATABASE SYSTEMS. Database programming in a web environment. Database System Course, 2016

DATABASE SYSTEMS. Database programming in a web environment. Database System Course, 2016 DATABASE SYSTEMS Database programming in a web environment Database System Course, 2016 AGENDA FOR TODAY Advanced Mysql More than just SELECT Creating tables MySQL optimizations: Storage engines, indexing.

More information

Announcement. Reading Material. Overview of Query Evaluation. Overview of Query Evaluation. Overview of Query Evaluation 9/26/17

Announcement. Reading Material. Overview of Query Evaluation. Overview of Query Evaluation. Overview of Query Evaluation 9/26/17 Announcement CompSci 516 Database Systems Lecture 10 Query Evaluation and Join Algorithms Project proposal pdf due on sakai by 5 pm, tomorrow, Thursday 09/27 One per group by any member Instructor: Sudeepa

More information

Table Compression in Oracle9i Release2. An Oracle White Paper May 2002

Table Compression in Oracle9i Release2. An Oracle White Paper May 2002 Table Compression in Oracle9i Release2 An Oracle White Paper May 2002 Table Compression in Oracle9i Release2 Executive Overview...3 Introduction...3 How It works...3 What can be compressed...4 Cost and

More information

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Database Systems: Fall 2008 Quiz II

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Database Systems: Fall 2008 Quiz II Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.830 Database Systems: Fall 2008 Quiz II There are 14 questions and 11 pages in this quiz booklet. To receive

More information

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

Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications. Administrivia. Administrivia. Faloutsos/Pavlo CMU /615 Carnegie Mellon Univ. Dept. of Computer Science 15-415/615 - DB Applications C. Faloutsos A. Pavlo Lecture#14(b): Implementation of Relational Operations Administrivia HW4 is due today. HW5 is out. Faloutsos/Pavlo

More information

1.1 - Basics of Query Processing in SQL Server

1.1 - Basics of Query Processing in SQL Server Department of Computer Science and Engineering 2013/2014 Database Administration and Tuning Lab 3 2nd semester In this lab class, we will address query processing. For students with a particular interest

More information

! Parallel machines are becoming quite common and affordable. ! Databases are growing increasingly large

! Parallel machines are becoming quite common and affordable. ! Databases are growing increasingly large Chapter 20: Parallel Databases Introduction! Introduction! I/O Parallelism! Interquery Parallelism! Intraquery Parallelism! Intraoperation Parallelism! Interoperation Parallelism! Design of Parallel Systems!

More information

Chapter 20: Parallel Databases

Chapter 20: Parallel Databases Chapter 20: Parallel Databases! Introduction! I/O Parallelism! Interquery Parallelism! Intraquery Parallelism! Intraoperation Parallelism! Interoperation Parallelism! Design of Parallel Systems 20.1 Introduction!

More information

Chapter 20: Parallel Databases. Introduction

Chapter 20: Parallel Databases. Introduction Chapter 20: Parallel Databases! Introduction! I/O Parallelism! Interquery Parallelism! Intraquery Parallelism! Intraoperation Parallelism! Interoperation Parallelism! Design of Parallel Systems 20.1 Introduction!

More information

I Want To Go Faster! A Beginner s Guide to Indexing

I Want To Go Faster! A Beginner s Guide to Indexing I Want To Go Faster! A Beginner s Guide to Indexing Bert Wagner Slides available here! @bertwagner bertwagner.com youtube.com/c/bertwagner bert@bertwagner.com Why Indexes? Biggest bang for the buck Can

More information

Physical DB design and tuning: outline

Physical DB design and tuning: outline Physical DB design and tuning: outline Designing the Physical Database Schema Tables, indexes, logical schema Database Tuning Index Tuning Query Tuning Transaction Tuning Logical Schema Tuning DBMS Tuning

More information

Advanced SQL Tribal Data Workshop Joe Nowinski

Advanced SQL Tribal Data Workshop Joe Nowinski Advanced SQL 2018 Tribal Data Workshop Joe Nowinski The Plan Live demo 1:00 PM 3:30 PM Follow along on GoToMeeting Optional practice session 3:45 PM 5:00 PM Laptops available What is SQL? Structured Query

More information

DATABASE PERFORMANCE AND INDEXES. CS121: Relational Databases Fall 2017 Lecture 11

DATABASE PERFORMANCE AND INDEXES. CS121: Relational Databases Fall 2017 Lecture 11 DATABASE PERFORMANCE AND INDEXES CS121: Relational Databases Fall 2017 Lecture 11 Database Performance 2 Many situations where query performance needs to be improved e.g. as data size grows, query performance

More information

Outline. Database Tuning. Join Strategies Running Example. Outline. Index Tuning. Nikolaus Augsten. Unit 6 WS 2014/2015

Outline. Database Tuning. Join Strategies Running Example. Outline. Index Tuning. Nikolaus Augsten. Unit 6 WS 2014/2015 Outline Database Tuning Nikolaus Augsten University of Salzburg Department of Computer Science Database Group 1 Examples Unit 6 WS 2014/2015 Adapted from Database Tuning by Dennis Shasha and Philippe Bonnet.

More information

Jet Data Manager 2014 SR2 Product Enhancements

Jet Data Manager 2014 SR2 Product Enhancements Jet Data Manager 2014 SR2 Product Enhancements Table of Contents Overview of New Features... 3 New Features in Jet Data Manager 2014 SR2... 3 Improved Features in Jet Data Manager 2014 SR2... 5 New Features

More information

Advanced MySQL Query Tuning

Advanced MySQL Query Tuning Advanced MySQL Query Tuning Alexander Rubin July 21, 2013 About Me My name is Alexander Rubin Working with MySQL for over 10 years Started at MySQL AB, then Sun Microsystems, then Oracle (MySQL Consulting)

More information

Evaluation of Relational Operations

Evaluation of Relational Operations Evaluation of Relational Operations Chapter 14 Comp 521 Files and Databases Fall 2010 1 Relational Operations We will consider in more detail how to implement: Selection ( ) Selects a subset of rows from

More information

Chapter 18: Parallel Databases

Chapter 18: Parallel Databases Chapter 18: Parallel Databases Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 18: Parallel Databases Introduction I/O Parallelism Interquery Parallelism Intraquery

More information

Chapter 18: Parallel Databases. Chapter 18: Parallel Databases. Parallelism in Databases. Introduction

Chapter 18: Parallel Databases. Chapter 18: Parallel Databases. Parallelism in Databases. Introduction Chapter 18: Parallel Databases Chapter 18: Parallel Databases Introduction I/O Parallelism Interquery Parallelism Intraquery Parallelism Intraoperation Parallelism Interoperation Parallelism Design of

More information

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database: SQL and PL/SQL Fundamentals NEW Oracle Database: SQL and PL/SQL Fundamentals NEW Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals training delivers the fundamentals of SQL and PL/SQL along with the

More information

Oracle Database 11g: SQL and PL/SQL Fundamentals

Oracle Database 11g: SQL and PL/SQL Fundamentals Oracle University Contact Us: +33 (0) 1 57 60 20 81 Oracle Database 11g: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn In this course, students learn the fundamentals of SQL and PL/SQL

More information

DB2 UDB: App Programming - Advanced

DB2 UDB: App Programming - Advanced A Access Methods... 8:6 Access Path Selection... 8:6 Access Paths... 5:22 ACQUIRE(ALLOCATE) / RELEASE(DEALLOCATE)... 5:14 ACQUIRE(USE) / RELEASE(DEALLOCATE)... 5:14 Active Log... 9:3 Active Logs - Determining

More information

Oracle Database: SQL and PL/SQL Fundamentals Ed 2

Oracle Database: SQL and PL/SQL Fundamentals Ed 2 Oracle University Contact Us: Local: 1800 103 4775 Intl: +91 80 67863102 Oracle Database: SQL and PL/SQL Fundamentals Ed 2 Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals

More information

Manual Trigger Sql Server 2008 Update Inserted Or Deleted

Manual Trigger Sql Server 2008 Update Inserted Or Deleted Manual Trigger Sql Server 2008 Update Inserted Or Deleted Am new to SQL scripting and SQL triggers, any help will be appreciated ://sql-serverperformance.com/2010/transactional-replication-2008-r2/ qf.customer_working_hours

More information

5. Single-row function

5. Single-row function 1. 2. Introduction Oracle 11g Oracle 11g Application Server Oracle database Relational and Object Relational Database Management system Oracle internet platform System Development Life cycle 3. Writing

More information

Teradata. This was compiled in order to describe Teradata and provide a brief overview of common capabilities and queries.

Teradata. This was compiled in order to describe Teradata and provide a brief overview of common capabilities and queries. Teradata This was compiled in order to describe Teradata and provide a brief overview of common capabilities and queries. What is it? Teradata is a powerful Big Data tool that can be used in order to quickly

More information

MySQL 5.0 Certification Study Guide

MySQL 5.0 Certification Study Guide MySQL 5.0 Certification Study Guide Paul DuBois, Stefan Hinz, and Carsten Pedersen MySQC Press 800 East 96th Street, Indianapolis, Indiana 46240 USA Table of Contents Introduction 1 About This Book 1 Sample

More information

What Developers must know about DB2 for z/os indexes

What Developers must know about DB2 for z/os indexes CRISTIAN MOLARO CRISTIAN@MOLARO.BE What Developers must know about DB2 for z/os indexes Mardi 22 novembre 2016 Tour Europlaza, Paris-La Défense What Developers must know about DB2 for z/os indexes Introduction

More information

IT Best Practices Audit TCS offers a wide range of IT Best Practices Audit content covering 15 subjects and over 2200 topics, including:

IT Best Practices Audit TCS offers a wide range of IT Best Practices Audit content covering 15 subjects and over 2200 topics, including: IT Best Practices Audit TCS offers a wide range of IT Best Practices Audit content covering 15 subjects and over 2200 topics, including: 1. IT Cost Containment 84 topics 2. Cloud Computing Readiness 225

More information

20761 Querying Data with Transact SQL

20761 Querying Data with Transact SQL Course Overview The main purpose of this course is to give students a good understanding of the Transact-SQL language which is used by all SQL Server-related disciplines; namely, Database Administration,

More information

Designing dashboards for performance. Reference deck

Designing dashboards for performance. Reference deck Designing dashboards for performance Reference deck Basic principles 1. Everything in moderation 2. If it isn t fast in database, it won t be fast in Tableau 3. If it isn t fast in desktop, it won t be

More information

TotalCost = 3 (1, , 000) = 6, 000

TotalCost = 3 (1, , 000) = 6, 000 156 Chapter 12 HASH JOIN: Now both relations are the same size, so we can treat either one as the smaller relation. With 15 buffer pages the first scan of S splits it into 14 buckets, each containing about

More information

ORACLE PL/SQL DATABASE COURSE

ORACLE PL/SQL DATABASE COURSE ORACLE PL/SQL DATABASE COURSE Oracle PL/SQL Database Programming Course (OPDP-001) JMT Oracle PL/SQL Hands-On Training (OPDP-001) is an intense hands-on course that is designed to give the student maximum

More information

Chapter 12: Indexing and Hashing

Chapter 12: Indexing and Hashing Chapter 12: Indexing and Hashing Database System Concepts, 5th Ed. See www.db-book.com for conditions on re-use Chapter 12: Indexing and Hashing Basic Concepts Ordered Indices B + -Tree Index Files B-Tree

More information

Sheeri Cabral. Are You Getting the Best Out of Your MySQL Indexes? Slides

Sheeri Cabral. Are You Getting the Best Out of Your MySQL Indexes? Slides Are You Getting the Best Out of Your MySQL Indexes? Slides http://bit.ly/mysqlindex2 Sheeri Cabral Senior DB Admin/Architect, Mozilla @sheeri www.sheeri.com What is an index? KEY vs. INDEX KEY = KEY CONSTRAINT

More information

Physical Design. Elena Baralis, Silvia Chiusano Politecnico di Torino. Phases of database design D B M G. Database Management Systems. Pag.

Physical Design. Elena Baralis, Silvia Chiusano Politecnico di Torino. Phases of database design D B M G. Database Management Systems. Pag. Physical Design D B M G 1 Phases of database design Application requirements Conceptual design Conceptual schema Logical design ER or UML Relational tables Logical schema Physical design Physical schema

More information

IT Certification Exams Provider! Weofferfreeupdateserviceforoneyear! h ps://www.certqueen.com

IT Certification Exams Provider! Weofferfreeupdateserviceforoneyear! h ps://www.certqueen.com IT Certification Exams Provider! Weofferfreeupdateserviceforoneyear! h ps://www.certqueen.com Exam : 005-002 Title : Certified MySQL 5.0 DBA Part I Version : Demo 1 / 10 1. Will the following SELECT query

More information

1.264 Lecture 8. SQL continued Connecting to database servers

1.264 Lecture 8. SQL continued Connecting to database servers 1.264 Lecture 8 SQL continued Connecting to database servers Subqueries SQL subqueries let you use the results of one query as part of another query. Subqueries Are often natural ways of writing a statement

More information

Review -Chapter 4. Review -Chapter 5

Review -Chapter 4. Review -Chapter 5 Review -Chapter 4 Entity relationship (ER) model Steps for building a formal ERD Uses ER diagrams to represent conceptual database as viewed by the end user Three main components Entities Relationships

More information

Database Management Systems (CS 601) Assignments

Database Management Systems (CS 601) Assignments Assignment Set I : Introduction (CO1) DBA s are the highest paid professionals among other database employees -Justify. What makes a DBA different from the other SQL developers? Why is the mapping between

More information

Oracle Hyperion Profitability and Cost Management

Oracle Hyperion Profitability and Cost Management Oracle Hyperion Profitability and Cost Management Configuration Guidelines for Detailed Profitability Applications November 2015 Contents About these Guidelines... 1 Setup and Configuration Guidelines...

More information

Outline. Database Management and Tuning. Outline. Join Strategies Running Example. Index Tuning. Johann Gamper. Unit 6 April 12, 2012

Outline. Database Management and Tuning. Outline. Join Strategies Running Example. Index Tuning. Johann Gamper. Unit 6 April 12, 2012 Outline Database Management and Tuning Johann Gamper Free University of Bozen-Bolzano Faculty of Computer Science IDSE Unit 6 April 12, 2012 1 Acknowledgements: The slides are provided by Nikolaus Augsten

More information

CSC Web Programming. Introduction to SQL

CSC Web Programming. Introduction to SQL CSC 242 - Web Programming Introduction to SQL SQL Statements Data Definition Language CREATE ALTER DROP Data Manipulation Language INSERT UPDATE DELETE Data Query Language SELECT SQL statements end with

More information

Performance Tuning. Chapter 25

Performance Tuning. Chapter 25 Chapter 25 Performance Tuning This chapter covers the following topics: Overview, 618 Identifying the Performance Bottleneck, 619 Optimizing the Target Database, 624 Optimizing the Source Database, 627

More information

Oracle Compare Two Database Tables Sql Query Join

Oracle Compare Two Database Tables Sql Query Join Oracle Compare Two Database Tables Sql Query Join data types. Namely, it assumes that the two tables payments and How to use SQL PIVOT to Compare Two Tables in Your Database. This can (not that using the

More information

SQL Interview Questions

SQL Interview Questions SQL Interview Questions SQL stands for Structured Query Language. It is used as a programming language for querying Relational Database Management Systems. In this tutorial, we shall go through the basic

More information

Inputs. Decisions. Leads to

Inputs. Decisions. Leads to Chapter 6: Physical Database Design and Performance Modern Database Management 9 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Heikki Topi 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Objectives

More information

192 Chapter 14. TotalCost=3 (1, , 000) = 6, 000

192 Chapter 14. TotalCost=3 (1, , 000) = 6, 000 192 Chapter 14 5. SORT-MERGE: With 52 buffer pages we have B> M so we can use the mergeon-the-fly refinement which costs 3 (M + N). TotalCost=3 (1, 000 + 1, 000) = 6, 000 HASH JOIN: Now both relations

More information

Database Management and Tuning

Database Management and Tuning Database Management and Tuning Index Tuning Johann Gamper Free University of Bozen-Bolzano Faculty of Computer Science IDSE Unit 4 Acknowledgements: The slides are provided by Nikolaus Augsten and have

More information

Manual Trigger Sql Server 2008 Insert Update Delete

Manual Trigger Sql Server 2008 Insert Update Delete Manual Trigger Sql Server 2008 Insert Update Delete Am new to SQL scripting and SQL triggers, any help will be appreciated ://sql-serverperformance.com/2010/transactional-replication-2008-r2/ qf.customer_working_hours

More information

Clustering Techniques A Technical Whitepaper By Lorinda Visnick

Clustering Techniques A Technical Whitepaper By Lorinda Visnick Clustering Techniques A Technical Whitepaper By Lorinda Visnick 14 Oak Park Bedford, MA 01730 USA Phone: +1-781-280-4000 www.objectstore.net Introduction Performance of a database can be greatly impacted

More information

Introduction to SQL/PLSQL Accelerated Ed 2

Introduction to SQL/PLSQL Accelerated Ed 2 Oracle University Contact Us: Local: 1800 103 4775 Intl: +91 80 67863102 Introduction to SQL/PLSQL Accelerated Ed 2 Duration: 5 Days What you will learn This Introduction to SQL/PLSQL Accelerated course

More information

Intelligent Caching in Data Virtualization Recommended Use of Caching Controls in the Denodo Platform

Intelligent Caching in Data Virtualization Recommended Use of Caching Controls in the Denodo Platform Data Virtualization Intelligent Caching in Data Virtualization Recommended Use of Caching Controls in the Denodo Platform Introduction Caching is one of the most important capabilities of a Data Virtualization

More information

Outline. Database Management and Tuning. What is an Index? Key of an Index. Index Tuning. Johann Gamper. Unit 4

Outline. Database Management and Tuning. What is an Index? Key of an Index. Index Tuning. Johann Gamper. Unit 4 Outline Database Management and Tuning Johann Gamper Free University of Bozen-Bolzano Faculty of Computer Science IDSE Unit 4 1 2 Conclusion Acknowledgements: The slides are provided by Nikolaus Augsten

More information

1Z MySQL 5 Database Administrator Certified Professional Exam, Part II Exam.

1Z MySQL 5 Database Administrator Certified Professional Exam, Part II Exam. Oracle 1Z0-874 MySQL 5 Database Administrator Certified Professional Exam, Part II Exam TYPE: DEMO http://www.examskey.com/1z0-874.html Examskey Oracle 1Z0-874 exam demo product is here for you to test

More information

HANA Performance. Efficient Speed and Scale-out for Real-time BI

HANA Performance. Efficient Speed and Scale-out for Real-time BI HANA Performance Efficient Speed and Scale-out for Real-time BI 1 HANA Performance: Efficient Speed and Scale-out for Real-time BI Introduction SAP HANA enables organizations to optimize their business

More information