Advanced MySQL Query Tuning

Size: px
Start display at page:

Download "Advanced MySQL Query Tuning"

Transcription

1 Advanced MySQL Query Tuning Alexander Rubin August 6, 2014

2 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) Joined Percona 1 year ago Helping customers improve MySQL performance performance tuning full text search high availability

3 Agenda Indexes How B-tree works Queries Temporary Tables and Filesort in MySQL GROUP BY Optimizations ORDER BY Optimizations Subqueries New in MySQL 5.6 Geo/Spatial Search

4 How to Deal with Slow Performance Indexes

5 MySQL Index Types: B-Tree Default index type (except for MEMORY tables) When you add index (except for MEMORY) MySQL will use B-Tree Support equality and range operations

6 MySQL Index Types: B-Tree Equality search: select * from table where id = 12 Scan thru the tree and go directly to 1 leaf Stop

7 MySQL Index Types: B-Tree Range: select * from table where id in (6, 12, 18) Scan thru the tree and visit many leafs/nodes

8 CREATE TABLE City ( ID int(11) NOT NULL AUTO_INCREMENT, Name char(35) NOT NULL DEFAULT '', CountryCode char(3) NOT NULL DEFAULT '', District char(20) NOT NULL DEFAULT '', Population int(11) NOT NULL DEFAULT '0', PRIMARY KEY (ID), KEY CountryCode (CountryCode) ) Engine=InnoDB;

9 MySQL will use 1 (best) index mysql> explain select * from City where ID = 1; table type possible_keys key key_len ref rows Extra City const PRIMARY PRIMARY 4 const mysql> explain select * from City where CountryCode = 'USA'; table type possible_keys key key_len ref rows Extra City ref CountryCode CountryCode 3 const 274 Using where

10 Leftmost part of combined index mysql> alter table City add key comb(countrycode, District, Population), drop key CountryCode;

11 Leftmost part of combined index mysql> explain select * from City where CountryCode = 'USA'\G ********************** 1. row ****************** table: City type: ref possible_keys: comb key: comb key_len: 3 ref: const rows: 273 Uses first field from the comb key

12 Key_len = total size (in bytes) of index parts used Index: comb(countrycode, District, Population) Explain: key: comb key_len: 3 Fields: CountryCode char(3) District char(20) Population int(11) 3 -> Char(3) -> First field is used

13 2 Leftmost Fields mysql> explain select * from City where CountryCode = 'USA' and District = 'California'\G ********************** 1. row ****************** table: City type: ref possible_keys: comb key: comb key_len: 23 ref: const,const rows: 68 Uses 2 first fields from the comb key CountryCode = 3 chars District = 20 chars Total = 23

14 3 Leftmost Fields mysql> explain select * from City where CountryCode = 'USA' and District = 'California and population > 10000\G ********************** 1. row ****************** table: City type: range possible_keys: comb key: comb key_len: 27 ref: NULL rows: 68 Uses all fields from the comb key CountryCode = 3 chars/bytes District = 20 chars/bytes Population = 4 bytes (INT) Total = 27

15 Can t use combined index not a leftmost part mysql> explain select * from City where District = 'California' and population > 10000\G ********************** 1. row ****************** table: City type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: 3868 Does not have the CountryCode in the where clause = can t use comb index

16 Covered index = cover all fields in query select name from City where CountryCode = 'USA' and District = 'Alaska' and population > mysql> alter table City add key cov1(countrycode, District, population, name); Uses all fields in the query in particular order: 1. Where part 2. Group By/Order (not used now) 3. Select part (here: name)

17 Explain mysql> explain select name from City where CountryCode = 'USA' and District = 'Alaska' and population > 10000\G *************************** 1. row *********** table: City type: range possible_keys: cov1 key: cov1 key_len: 27 ref: NULL rows: 1 Extra: Using where; Using index Using index = covered index is used MySQL will only use index Will not go to the data file

18 Order of Fields in Index Range and const conditions select * from City where district = 'California' and population > Index (district, population) in this order Rule of thumb: Const first, Range second Depends on query

19 How to Deal with Slow Performance Queries

20 Complex Slow Queries Group By Order By Select distinct Temporary tables Filesort The World s Most Popular Open Source Database

21 GROUP BY Queries

22 How many cities in each country? mysql> explain select CountryCode, count(*) from City group by CountryCode\G id: 1 Temporary tables are slow! select_type: SIMPLE table: City type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: 4079 Extra: Using temporary; Using filesort

23 Temporary Tables: Theory

24 Main performance issues MySQL can create temporary tables when query uses: GROUP BY Range + ORDER BY Some other expressions 2 types of temporary tables MEMORY On-disk

25 First, MySQL tries to create temporary table in memory MySQL configuration variables: tmp_table_size maximum size for in Memory temporary tables max_heap_table_size Sets the maximum size for MEMORY tables

26 MySQL temp table > tmp_table_ size OR MySQL temp table > max_heap_ table_size convert to MyISAM temporary table on disk

27 MEMORY engine does not support BLOB/TEXT select blob_field from table group by field1 select concat(...string>512 chars) group by field1 Create on-disk temporary table right away

28 Temporary Tables: Practice

29 6M rows, ~2G in size CREATE TABLE ontime_2012 ( YearD int(11) DEFAULT NULL, MonthD tinyint(4) DEFAULT NULL, DayofMonth tinyint(4) DEFAULT NULL, DayOfWeek tinyint(4) DEFAULT NULL, Carrier char(2) DEFAULT NULL, Origin char(5) DEFAULT NULL, DepDelayMinutes int(11) DEFAULT NULL,... ) ENGINE=InnoDB DEFAULT CHARSET=latin1 _Name=On-Time

30 Find maximum delay for flights on Sunday Group by airline SELECT max(depdelayminutes), carrier, dayofweek FROM ontime_2012 WHERE dayofweek = 7 GROUP BY Carrier

31 select max(depdelayminutes), carrier, dayofweek from ontime_2012 where dayofweek = 7 group by Carrier type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: Full table scan! Temporary table! Extra: Using where; Using temporary; Using filesort

32 mysql> alter table ontime_2012 add key (dayofweek); explain select max(depdelayminutes), Carrier, dayofweek from ontime_2012 where dayofweek =7 group by Carrier\G type: ref Index is used = better possible_keys: DayOfWeek key: DayOfWeek BUT: Large temporary table! key_len: 2 ref: const rows: Extra: Using where; Using temporary; Using filesort

33 mysql> alter table ontime_2012 add key covered(dayofweek, Carrier, DepDelayMinutes); explain select max(depdelayminutes), Carrier, dayofweek from ontime_2012 where dayofweek =7 group by Carrier\G... possible_keys: DayOfWeek,covered key: covered key_len: 2 ref: const rows: No temporary table! MySQL will only use index Extra: Using where; Using index Called tight index scan

34 mysql> explain select max(depdelayminutes), Carrier, dayofweek from ontime_2012 where dayofweek > 3 group by Carrier, dayofweek\g... type: range Range scan possible_keys: covered key: covered key_len: 2 ref: NULL rows: Extra: Using where; Using index; Using temporary; Using filesort

35 (select max(depdelayminutes), Carrier, dayofweek from ontime_2012 where dayofweek = 3 group by Carrier, dayofweek) union (select max(depdelayminutes), Carrier, dayofweek from ontime_2012 where dayofweek = 4 group by Carrier, dayofweek)

36 *************************** 1. row *************************** table: ontime_2012 key: covered... Extra: Using where; Using index *************************** 2. row *************************** table: ontime_2012 key: covered Extra: Using where; Using index *************************** 3. row *************************** id: NULL select_type: UNION RESULT table: <union1,2> type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: NULL Extra: Using temporary

37 GROUP BY: Loose index scan Loose index scan: considers only a fraction of the keys in an index Following rules apply: The query is over a single table. The GROUP BY columns should form a leftmost prefix of the index The only aggregate functions = MIN() and MAX(), same column

38 Loose index scan example mysql> alter table ontime_2012 add key loose_index_scan (Carrier, dayofweek, DepDelayMinutes); mysql> explain select max(depdelayminutes), Carrier, dayofweek from ontime_2012 where dayofweek > 5 group by Carrier, dayofweek\g... table: ontime_2012 type: range possible_keys: NULL key: loose_index_scan key_len: 5 ref: NULL rows: 201 Loose index scan Very fast Range works! Extra: Using where; Using index for group-by

39 Loose index scan vs. tight index scan Table: ontime_2012, 6M rows, data: 2G, index: 210M CREATE TABLE ontime_2012 ( YearD int(11) DEFAULT NULL, MonthD tinyint(4) DEFAULT NULL, DayofMonth tinyint(4) DEFAULT NULL, DayOfWeek tinyint(4) DEFAULT NULL, Carrier char(2) DEFAULT NULL, Origin char(5) DEFAULT NULL, DepDelayMinutes int(11) DEFAULT NULL,... KEY loose_index_scan (Carrier,DayOfWeek,DepDelayMinutes), KEY covered (DayOfWeek,Carrier,DepDelayMinutes) ) ENGINE=InnoDB DEFAULT CHARSET=latin1

40 Loose index scan vs. tight index scan Loose index scan select max(depdelayminutes) as ddm, Carrier, dayofweek from ontime_2012 where dayofweek = 5 group by Carrier, dayofweek table: ontime_2012 type: range possible_keys: covered key: loose_index_scan key_len: 5 ref: NULL rows: 201 Extra: Using where; Using index for group-by Carrier, DayOfWeek, DepDelayMinutes mysql> select ddm Carrier dayofweek AA rows in set (0.00 sec)

41 Loose index scan vs. tight index scan Results Loose index scan Tight Index Scan Temporary table

42 Where loose index scan is not supported AVG() + Group By loose index scan is not supported mysql> explain select avg(depdelayminutes) as ddm, Carrier, dayofweek from ontime_2012 where dayofweek >5 group by Carrier, dayofweek \G table: ontime_2012 type: range key: covered key_len: 2 ref: NULL rows: Extra: Using where; Using index; Using temporary; Using filesort mysql> select ddm Carrier dayofweek AA rows in set (1.39 sec) 1. No loose index scan 2. Filter by key 3. Group by filesort

43 ORDER BY and filesort

44 mysql> explain select district, name, population from City where CountryCode = 'USA' order by population desc limit 10\G table: City type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: 4079 Extra: Using where; Using filesort

45 mysql> alter table City add key my_sort2 (CountryCode, population); mysql> explain select district, name, population from City where CountryCode = 'USA' order by population desc limit 10\G table: City type: ref key: my_sort2 key_len: 3 ref: const rows: 207 Extra: Using where No filesort

46 mysql> alter table ontime_2012 add key (DepDelayMinutes); Query OK, 0 rows affected (38.68 sec) mysql> explain select * from ontime_2012 where dayofweek in (6,7) order by DepDelayMinutes desc limit 10\G type: index possible_keys: DayOfWeek,covered key: DepDelayMinutes key_len: 5 ref: NULL rows: 24 Extra: Using where 10 rows in set (0.00 sec) 1. Index is sorted 2. Scan the whole table in the order of the index 3. Filter results 4. Stop after finding 10 rows matching the where condition

47 If Index points to the beginning of the table (physically) = fast As it stops after 10 rows (LIMIT 10)

48 If Index points to the end of table (physically) or random = slower Much more rows to scan (and skip)

49 Subqueries Optimizations

50 Subqueries, I Subquery in FROM and joins SELECT sb1,sb2,sb3 FROM (SELECT s1 AS sb1, s2 AS sb2, s3*2 AS sb3 FROM t1) AS sb WHERE sb1 > 1; Subquery inside where SELECT * FROM t1 WHERE column1 in (SELECT column2 FROM t2);

51 Subqueries, II MySQL 5.6: Resolved Adds an index on the derived table Subquery in FROM and joins SELECT sb1,sb2,sb3 FROM (SELECT s1 AS sb1, s2 AS sb2, s3*2 AS sb3 FROM t1) AS sb WHERE sb1 > 1; MySQL will create a temporary table for (SELECT s1 AS sb1, s2 AS sb2, s3*2 AS sb3 FROM t1) with no indexes (fixed in MySQL 5.6) Rewrite as join

52 Subqueries, III MySQL 5.6: resolved, semi-join subquery optimization strategies Subquery inside where SELECT * FROM t1 WHERE column1 in (SELECT column2 FROM t2 where..); Will not use index on column1 Can rewrite query as join

53 Collect system variables every minute with agent Find the latest version of each config per each server CREATE TABLE `sysconfigs` ( `service_id` tinyint(3) unsigned NOT NULL, `instance_id` smallint(5) unsigned NOT NULL,... `var` varchar(100) NOT NULL, `val` varchar(500) CHARACTER SET utf8 NOT NULL, `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`service_id`,`instance_id`,`var`,`ts`), KEY `instance_id` (`instance_id`) ) ENGINE=InnoDB

54 Query with subquery SELECT s.instance_id, s.ts, s.instance_id, s.var, s.val FROM sysconfigs s JOIN (select instance_id, var, max(ts) as last_ts from sysconfigs s1 where service_id = 2 group by instance_id, var) s1 on s.instance_id = s1.instance_id and s.var=s1.var and s.ts = s1.last_ts

55 Explain plan. Actual rows examined: 65 million select_type table type possible_keys key key_len ref rows Extra PRIMARY <derived2> ALL NULL NULL NULL NULL 1268 PRIMARY s ref instance_id instance_id 2 s1.instance_id Using where DERIVED s1 ref PRIMARY PRIMARY Using where; Using index Query time instance_id ts instance_id var val :32:29 1 autocommit ON :32:29 1 automatic_sp_privileges ON :32:29 1 auto_increment_increment rows in set (2 min sec)

56 -- explicitly create temp table create temporary table t engine=memory as select instance_id, var, max(ts) as last_ts from sysconfigs s1 where service_id = 2 group by instance_id, var; -- add indexes alter table t add primary key (instance_id, var, last_ts); SELECT s.instance_id, s.ts, s.instance_id, s.var, s.val FROM sysconfigs s join t as s1 on s.instance_id = s1.instance_id and s.var=s1.var and s.ts = s1.last_ts; -- clean up drop temporary table t;

57 create temporary table t engine=memory as select instance_id, var, max(ts) as last_ts from sysconfigs s1 where service_id = 2 group by instance_id, var Query OK, 1268 rows affected (0.63 sec) Records: 1268 Duplicates: 0 Warnings: alter table t add primary key (instance_id, var, last_ts) Query OK, 1268 rows affected (0.00 sec) Records: 1268 Duplicates: 0 Warnings: select SQL_CALC_FOUND_ROWS s.instance_id, s.ts, s.instance_id, s.var, s.val from sysconfigs s join t as s1 on s.instance_id = s1.instance_id and s.var=s1.var and s.ts = s1.last_ts instance_id ts instance_id var val rows in set (0.26 sec) drop temporary table t New: 0.89 seconds Original: 2 min sec Query OK, 0 rows affected (0.00 sec)

58 MySQL id select_type table type possible_keys key key_len ref rows Extra PRIMARY s ALL instance_id NULL NULL NULL NULL 1 PRIMARY <derived2> ref <auto_key0> <auto_key0> Using index 2 DERIVED s1 ref PRIMARY,instance_id PRIMARY 1 const Using where; Using index MySQL select_type table type possible_keys key key_len ref rows Extra PRIMARY <derived2> ALL NULL NULL NULL NULL 1268 PRIMARY s ref instance_id instance_id 2 s1.instance_id Using where DERIVED s1 ref PRIMARY PRIMARY Using where; Using index

59 MySQL 5.6 mysql> SELECT s.instance_id, s.ts, s.instance_id, s.var, s.val FROM sysconfigs s JOIN (select instance_id, var, max(ts) as last_ts from sysconfigs s1 where service_id = 2 group by instance_id, var) s1 on s.instance_id = s1.instance_id and s.var=s1.var and s.ts = s1.last_ts; instance_id ts instance_id var val rows in set (0.75 sec) MySQL instance_id ts instance_id var val rows in set (2 min sec)

60 mysql> explain select * from metric_data where instance_id in (select mysql_server_id from mysql_servers where deleted is not null)\g *************************** 1. row *************************** id: 1 select_type: PRIMARY table: metric_data type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: Extra: Using where *************************** 2. row *************************** id: 2 select_type: DEPENDENT SUBQUERY table: mysql_servers type: unique_subquery possible_keys: PRIMARY key: PRIMARY key_len: 2 ref: func rows: 1 Extra: Using index 2 rows in set (0.00 sec) CREATE TABLE metric_data( KEY instance_id(instance_id) ) ENGINE=InnoDB;

61 mysql> explain select * from metric_data md join mysql_servers s on (s.mysql_server_id=md.instance_id) where deleted is not null\g *************************** 1. row *************************** id: 1 select_type: SIMPLE table: s type: ALL possible_keys: PRIMARY,deleted key: NULL key_len: NULL ref: NULL rows: 4 Extra: Using where *************************** 2. row *************************** id: 1 select_type: SIMPLE table: md type: ref possible_keys: instance_id key: instance_id key_len: 2 ref: o2004.s.mysql_server_id rows: Extra: 2 rows in set (0.00 sec)

62 mysql> explain select * from metric_data where instance_id in (select mysql_server_id from mysql_servers where deleted is not null)\g *************************** 1. row *************************** id: 1 select_type: SIMPLE table: mysql_servers type: index possible_keys: PRIMARY,deleted key: deleted key_len: 4 ref: NULL rows: 4 Extra: Using where; Using index *************************** 2. row *************************** id: 1 select_type: SIMPLE table: metric_data type: ref possible_keys: instance_id key: instance_id key_len: 2 ref: o2004.mysql_servers.mysql_server_id rows: 4023 Extra: NULL 2 rows in set (0.00 sec)

63 Geo/Spatial Search

64 MySQL with Spatial Extensions mysql> CREATE TABLE `points` ( `OGR_FID` int(11) NOT NULL AUTO_INCREMENT, `SHAPE` geometry NOT NULL, `osm_id` text, `name` text,... `other_tags` text, UNIQUE KEY `OGR_FID` (`OGR_FID`), SPATIAL KEY `SHAPE` (`SHAPE`) ) ENGINE=MyISAM AUTO_INCREMENT= DEFAULT CHARSET=latin1

65 Spatial Data types in MySQL MyISAM Supports both SPATIAL types and indexes InnoDB Supports SPATIAL types only, not indexes added SPATIAL index support in labs version of MySQL 5.7

66 MySQL with Spatial Extensions `SHAPE` geometry mysql> select astext(shape) from points limit 1; astext(shape) POINT( ) row in set (0.00 sec) World Known Text (WKT)

67 MySQL with Spatial Extensions `SHAPE` geometry mysql> select astext(shape) from tl_2013_us_zcta510 where zcta5ce10 = '27701'\G ********************** 1. row ************************ astext(shape): POLYGON(( , , , , , )) Polygon for ZIP = (Durham, NC)

68 ST_CONTAINS example mysql> SELECT zcta5ce10 as ZIP FROM tl_2013_us_zcta510 WHERE st_contains(shape, POINT( , )); ZIP row in set (0.00 sec)

69 ST_DISTANCE: all restaurants around (lat, lon) mysql> SELECT name, st_distance(shape, POINT( , )) as distance FROM points WHERE ["amenity"=>"restaurant >] ORDER BY distance LIMIT 5; name distance The Pit Piedmont Torero's Fishmonger's Pop's

70 More Info 4/creating-geo-enabled-applications-mysql-5-6/ Labs.mysql.com MySQL GIS/RTREE support SPATIAL Indexes for InnoDB

71 Performance Schema: Webinar Join me next week (Aug 13, 10 a.m. PDT) for a Performance Schema webinar. Example: find usage (IOPS) per user mysql sys> select * from user_summary_by_file_io where user like 'a%'; user ios io_latency api h api h api h app :01:06.33 app s app s rows in set (0.06 sec)

72 Questions? Thank you!

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

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

MySQL Performance Optimization

MySQL Performance Optimization P R A C T I C A L MySQL Performance Optimization A hands-on, business-case-driven guide to understanding MySQL query parameter tuning and database performance optimization. With the increasing importance

More information

MySQL Query Tuning 101. Sveta Smirnova, Alexander Rubin April, 16, 2015

MySQL Query Tuning 101. Sveta Smirnova, Alexander Rubin April, 16, 2015 MySQL Query Tuning 101 Sveta Smirnova, Alexander Rubin April, 16, 2015 Agenda 2 Introduction: where to find slow queries Indexes: why and how do they work All about EXPLAIN More tools Where to find more

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

Indexes - What You Need to Know

Indexes - What You Need to Know Indexes - What You Need to Know http://www.percona.com/training/ 2011-2017 Percona, Inc. 1 / 53 Indexes - Need to Know QUERY PLANNING 2011-2017 Percona, Inc. 2 / 53 About This Chapter The number one goal

More information

Query Optimization Percona, Inc. 1 / 74

Query Optimization Percona, Inc. 1 / 74 Query Optimization http://www.percona.com/training/ 2011-2017 Percona, Inc. 1 / 74 Table of Contents 1. Query Planning 3. Composite Indexes 2. Explaining the EXPLAIN 4. Kitchen Sink 2011-2017 Percona,

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

OKC MySQL Users Group

OKC MySQL Users Group OKC MySQL Users Group OKC MySQL Discuss topics about MySQL and related open source RDBMS Discuss complementary topics (big data, NoSQL, etc) Help to grow the local ecosystem through meetups and events

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

Part 1: IoT demo Part 2: MySQL, JSON and Flexible storage

Part 1: IoT demo Part 2: MySQL, JSON and Flexible storage Part 1: IoT demo Part 2: MySQL, JSON and Flexible storage $ node particle_mysql_all.js Starting... INSERT INTO cloud_data_json (name, data) values ('particle', '{\"data\":\"null\",\"ttl\":60,\"published_at\":\"2017-09-28t19:40:49.869z\",\"coreid\":\"1f0039000947343337373738

More information

Practical MySQL indexing guidelines

Practical MySQL indexing guidelines Practical MySQL indexing guidelines Percona Live October 24th-25th, 2011 London, UK Stéphane Combaudon stephane.combaudon@dailymotion.com Agenda Introduction Bad indexes & performance drops Guidelines

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

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

Explaining the MySQL EXPLAIN

Explaining the MySQL EXPLAIN Explaining the MySQL EXPLAIN Ronald Bradford http://ronaldbradford.com OTN South America Tour July 2011 Agenda EXPLAIN syntax options How to read QEP QEP examples MySQL optimizer limitations PURPOSE EXPLAIN

More information

Oracle 1Z MySQL 5.6 Database Administrator. Download Full Version :

Oracle 1Z MySQL 5.6 Database Administrator. Download Full Version : Oracle 1Z0-883 MySQL 5.6 Database Administrator Download Full Version : http://killexams.com/pass4sure/exam-detail/1z0-883 D. The mysqld binary was not compiled with SSL support. E. The server s SSL certificate

More information

MySQL Schema Best Practices

MySQL Schema Best Practices MySQL Schema Best Practices 2 Agenda Introduction 3 4 Introduction - Sample Schema Key Considerations 5 Data Types 6 Data Types [root@plive-2017-demo plive_2017]# ls -alh action*.ibd -rw-r-----. 1 mysql

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

MySQL Schema Review 101

MySQL Schema Review 101 MySQL Schema Review 101 How and What you should be looking at... Mike Benshoof - Technical Account Manager, Percona Agenda Introduction Key things to consider and review Tools to isolate issues Common

More information

The MariaDB/MySQL Query Executor In-depth. Presented by: Timour Katchaounov Optimizer team: Igor Babaev, Sergey Petrunia, Timour Katchaounov

The MariaDB/MySQL Query Executor In-depth. Presented by: Timour Katchaounov Optimizer team: Igor Babaev, Sergey Petrunia, Timour Katchaounov The MariaDB/MySQL Query Executor In-depth Presented by: Timour Katchaounov Optimizer team: Igor Babaev, Sergey Petrunia, Timour Katchaounov Outline What's IN Query engine architecture Execution model Representation

More information

Optimizing Queries with EXPLAIN

Optimizing Queries with EXPLAIN Optimizing Queries with EXPLAIN Sheeri Cabral Senior Database Administrator Twitter: @sheeri What is EXPLAIN? SQL Extension Just put it at the beginning of your statement Can also use DESC or DESCRIBE

More information

Advanced query optimization techniques on large queries. Peter Boros Percona Webinar

Advanced query optimization techniques on large queries. Peter Boros Percona Webinar Advanced query optimization techniques on large queries Peter Boros Percona Webinar Agenda Showing the title slide Going through this agenda Prerequisites Case study #1 Case study #2 Case study #3 Case

More information

How to Use JSON in MySQL Wrong

How to Use JSON in MySQL Wrong How to Use JSON in MySQL Wrong Bill Karwin, Square Inc. October, 2018 1 Me Database Developer at Square Inc. MySQL Quality Contributor Author of SQL Antipatterns: Avoiding the Pitfalls of Database Programming

More information

MySQL 101. Designing effective schema for InnoDB. Yves Trudeau April 2015

MySQL 101. Designing effective schema for InnoDB. Yves Trudeau April 2015 MySQL 101 Designing effective schema for InnoDB Yves Trudeau April 2015 About myself : Yves Trudeau Principal architect at Percona since 2009 With MySQL then Sun, 2007 to 2009 Focus on MySQL HA and distributed

More information

The Top 20 Design Tips

The Top 20 Design Tips The Top 20 Design Tips For MySQL Enterprise Data Architects Ronald Bradford COO PrimeBase Technologies April 2008 Presented Version By: 1.1 Ronald 10.Apr.2008 Bradford 1. Know Your Technology Tools Generics

More information

MySQL 5.7 and MongoDB

MySQL 5.7 and MongoDB MySQL 5.7 and MongoDB Geospatial Introduction Alexander Rubin - Principal Architect, Percona Mike Benshoof - Technical Account Manager, Percona Agenda Introduction GIS in MySQL GIS in MongoDB 2 What is

More information

MongoDB For MySQL DBAs. Alexander Rubin - Principal Architect, Percona

MongoDB For MySQL DBAs. Alexander Rubin - Principal Architect, Percona MongoDB For DBAs Alexander Rubin - Principal Architect, Percona Agenda How to in MongoDB Storage engines in MongoDB Opera4ons in MongoDB Replica4on in MongoDB Sharding in MongoDB Other examples 2 What

More information

When and How to Take Advantage of New Optimizer Features in MySQL 5.6. Øystein Grøvlen Senior Principal Software Engineer, MySQL Oracle

When and How to Take Advantage of New Optimizer Features in MySQL 5.6. Øystein Grøvlen Senior Principal Software Engineer, MySQL Oracle When and How to Take Advantage of New Optimizer Features in MySQL 5.6 Øystein Grøvlen Senior Principal Software Engineer, MySQL Oracle Program Agenda Improvements for disk-bound queries Subquery improvements

More information

Oracle 1Z0-882 Exam. Volume: 100 Questions. Question No: 1 Consider the table structure shown by this output: Mysql> desc city:

Oracle 1Z0-882 Exam. Volume: 100 Questions. Question No: 1 Consider the table structure shown by this output: Mysql> desc city: Volume: 100 Questions Question No: 1 Consider the table structure shown by this output: Mysql> desc city: 5 rows in set (0.00 sec) You execute this statement: SELECT -,-, city. * FROM city LIMIT 1 What

More information

Tools and Techniques for Index Design. Bill Karwin, Percona Inc.

Tools and Techniques for Index Design. Bill Karwin, Percona Inc. Tools and Techniques for Index Design Bill Karwin, Percona Inc. It s About Performance What s the most frequent recommendation in database performance audits? What s the easiest way to speed up SQL queries,

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

Optimizer Standof. MySQL 5.6 vs MariaDB 5.5. Peter Zaitsev, Ovais Tariq Percona Inc April 18, 2012

Optimizer Standof. MySQL 5.6 vs MariaDB 5.5. Peter Zaitsev, Ovais Tariq Percona Inc April 18, 2012 Optimizer Standof MySQL 5.6 vs MariaDB 5.5 Peter Zaitsev, Ovais Tariq Percona Inc April 18, 2012 Thank you Ovais Tariq Ovais Did a lot of heavy lifing for this presentation He could not come to talk together

More information

Maximizing SQL reviews with pt-query-digest

Maximizing SQL reviews with pt-query-digest PALOMINODB OPERATIONAL EXCELLENCE FOR DATABASES Maximizing SQL reviews with pt-query-digest Mark Filipi www.palominodb.com What is pt-query-digest Analyzes MySQL queries from slow, general and binary log

More information

Target Practice. A Workshop in Tuning MySQL Queries OSCON Jay Pipes Community Relations Manager, North America MySQL, Inc.

Target Practice. A Workshop in Tuning MySQL Queries OSCON Jay Pipes Community Relations Manager, North America MySQL, Inc. Target Practice A Workshop in Tuning MySQL Queries OSCON 2007 Jay Pipes Community Relations Manager, North America MySQL, Inc. Setup Download materials and MySQL Community Server Download workshop materials

More information

Sun Certified MySQL 5.0 Developer Part II

Sun Certified MySQL 5.0 Developer Part II 310-813 Sun Certified MySQL 5.0 Developer Part II Version 13.3 QUESTION NO: 1 When executing multi-row operations, what should be the first thing you look for to see if anything unexpected happened? A.

More information

Troubleshooting Slow Queries. Sveta Smirnova Principal Support Engineer April, 28, 2016

Troubleshooting Slow Queries. Sveta Smirnova Principal Support Engineer April, 28, 2016 Troubleshooting Slow Queries Sveta Smirnova Principal Support Engineer April, 28, 2016 Table of Contents Before we start What affects query execution EXPLAIN: how to find out how optimizer works Data matters:

More information

Exam Questions 1z0-882

Exam Questions 1z0-882 Exam Questions 1z0-882 Oracle Certified Professional, MySQL 5.6 Developer https://www.2passeasy.com/dumps/1z0-882/ 1.Which statement describes the process of normalizing databases? A. All text is trimmed

More information

MySQL usage of web applications from 1 user to 100 million. Peter Boros RAMP conference 2013

MySQL usage of web applications from 1 user to 100 million. Peter Boros RAMP conference 2013 MySQL usage of web applications from 1 user to 100 million Peter Boros RAMP conference 2013 Why MySQL? It's easy to start small, basic installation well under 15 minutes. Very popular, supported by a lot

More information

MySQL 5.7 For Operational DBAs an Introduction. Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars

MySQL 5.7 For Operational DBAs an Introduction. Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 is Great! A lot of Worthy Changes for Developers and DBAs 2 What Developers

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

<Insert Picture Here> Boosting performance with MySQL partitions

<Insert Picture Here> Boosting performance with MySQL partitions Boosting performance with MySQL partitions Giuseppe Maxia MySQL Community Team Lead at Oracle 1 about me -Giuseppe Maxia a.k.a. The Data Charmer MySQL Community Team Lead Long time

More information

MySQL vs MariaDB. Where are we now?

MySQL vs MariaDB. Where are we now? MySQL vs MariaDB Where are we now? Hey! A BRIEF HISTORY OF THE UNIVERSE (of MySQL and MariaDB) Herman Hollerith Unireg Begins Essentially, the origin of what we know MySQL as today, establishing its code

More information

itexamdump 최고이자최신인 IT 인증시험덤프 일년무료업데이트서비스제공

itexamdump 최고이자최신인 IT 인증시험덤프  일년무료업데이트서비스제공 itexamdump 최고이자최신인 IT 인증시험덤프 http://www.itexamdump.com 일년무료업데이트서비스제공 Exam : 1z1-882 Title : Oracle Certified Professional, MySQL 5.6 Developer Vendor : Oracle Version : DEMO Get Latest & Valid 1z1-882

More information

MySQL Performance Tuning

MySQL Performance Tuning MySQL Performance Tuning Sumi Ryu Senior Sales Consultant 1 Program Agenda Basics: Hardware, Storage Engines and Versions Server Tuning Index, Query and Schema Optimization MySQL Performance Schema Introduction

More information

Why we re excited about MySQL 8

Why we re excited about MySQL 8 Why we re excited about MySQL 8 Practical Look for Devs and Ops Peter Zaitsev, CEO, Percona February 4nd, 2018 FOSDEM 1 In the Presentation Practical view on MySQL 8 Exciting things for Devs Exciting things

More information

Chapter 8: Working With Databases & Tables

Chapter 8: Working With Databases & Tables Chapter 8: Working With Databases & Tables o Working with Databases & Tables DDL Component of SQL Databases CREATE DATABASE class; o Represented as directories in MySQL s data storage area o Can t have

More information

High Performance MySQL Practical Tuesday, April 01, :45

High Performance MySQL Practical Tuesday, April 01, :45 High Performance MySQL Practical Tuesday, April 01, 2014 16:45 1. Optimal Data Types: a. Choose Data Type Suggestion: i. Smaller is usually better ii. Simple is good iii. Avoid NULL if possible b. MySQL

More information

The Blackhole and Federated Storage Engines: The Coolest Kids on the Block

The Blackhole and Federated Storage Engines: The Coolest Kids on the Block The Blackhole and Federated Storage Engines: The Coolest Kids on the Block Kai Voigt, kai@mysql.com Senior Instructor, MySQL AB Giuseppe Maxia, giuseppe@mysql.com QA Developer, MySQL AB Kai Voigt Mister

More information

MySQL Query Optimization. Originally: Query Optimization from 0 to 10 by Jaime Crespo

MySQL Query Optimization. Originally: Query Optimization from 0 to 10 by Jaime Crespo MySQL Query Optimization Originally: Query Optimization from 0 to 10 by Jaime Crespo Agenda 1. Introduction 7. Query Profiling 2. Access Types and Basic Indexing Techniques 8. General Optimizer Improvements

More information

Oracle Exam 1z0-882 Oracle Certified Professional, MySQL 5.6 Developer Version: 7.0 [ Total Questions: 100 ]

Oracle Exam 1z0-882 Oracle Certified Professional, MySQL 5.6 Developer Version: 7.0 [ Total Questions: 100 ] s@lm@n Oracle Exam 1z0-882 Oracle Certified Professional, MySQL 5.6 Developer Version: 7.0 [ Total Questions: 100 ] Oracle 1z0-882 : Practice Test Question No : 1 Consider the statements: Mysql> drop function

More information

Querying Data with Transact SQL

Querying Data with Transact SQL Course 20761A: Querying Data with Transact SQL Course details Course Outline Module 1: Introduction to Microsoft SQL Server 2016 This module introduces SQL Server, the versions of SQL Server, including

More information

Partitioning. Sheeri K. Cabral Database Administrator The Pythian Group, January 12, 2009

Partitioning. Sheeri K. Cabral Database Administrator The Pythian Group,  January 12, 2009 Partitioning Sheeri K. Cabral Database Administrator The Pythian Group, www.pythian.com cabral@pythian.com January 12, 2009 Partitioning Why What How How to Partition CREATE TABLE tblname ( fld FLDTYPE...

More information

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus CSCI-UA:0060-02 Database Design & Web Implementation Professor Evan Sandhaus sandhaus@cs.nyu.edu evan@nytimes.com Lecture #10: Open Office Base, Life on the Console, MySQL Database Design and Web Implementation

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

What is SQL? Toolkit for this guide. Learning SQL Using phpmyadmin

What is SQL? Toolkit for this guide. Learning SQL Using phpmyadmin http://www.php-editors.com/articles/sql_phpmyadmin.php 1 of 8 Members Login User Name: Article: Learning SQL using phpmyadmin Password: Remember Me? register now! Main Menu PHP Tools PHP Help Request PHP

More information

DB2 SQL Class Outline

DB2 SQL Class Outline DB2 SQL Class Outline The Basics of SQL Introduction Finding Your Current Schema Setting Your Default SCHEMA SELECT * (All Columns) in a Table SELECT Specific Columns in a Table Commas in the Front or

More information

More MySQL ELEVEN Walkthrough examples Walkthrough 1: Bulk loading SESSION

More MySQL ELEVEN Walkthrough examples Walkthrough 1: Bulk loading SESSION SESSION ELEVEN 11.1 Walkthrough examples More MySQL This session is designed to introduce you to some more advanced features of MySQL, including loading your own database. There are a few files you need

More information

Meet the Sergei Golubchik MariaDB Corporation

Meet the Sergei Golubchik MariaDB Corporation Meet the 10.2 Sergei Golubchik MariaDB Corporation k 10.2 Facts About a year in active development Currently at 10.2.2 beta Plans Gamma soon GA by the end of the year 10.2 Analytical queries Removing historical

More information

OBJECTIVE. ABOUT Ronald BRADFORD. Improving Performance with Better Indexes. Improve query performance, therefore

OBJECTIVE. ABOUT Ronald BRADFORD. Improving Performance with Better Indexes. Improve query performance, therefore Improving Performance with Better Indexes The only active MySQL group in New York http://www.meetup.com/effectivemysql/ Ronald Bradford http://ronaldbradford.com 2011.0 OBJECTIVE Improve query performance,

More information

State of MariaDB. Igor Babaev Notice: MySQL is a registered trademark of Sun Microsystems, Inc.

State of MariaDB. Igor Babaev Notice: MySQL is a registered trademark of Sun Microsystems, Inc. State of MariaDB Igor Babaev igor@askmonty.org New features in MariaDB 5.2 New engines: OQGRAPH, SphinxSE Virtual columns Extended User Statistics Segmented MyISAM key cache Pluggable Authentication Storage-engine-specific

More information

Exact Numeric Data Types

Exact Numeric Data Types SQL Server Notes for FYP SQL data type is an attribute that specifies type of data of any object. Each column, variable and expression has related data type in SQL. You would use these data types while

More information

Outline. Introduction to SQL. What happens when you run an SQL query? There are 6 possible clauses in a select statement. Tara Murphy and James Curran

Outline. Introduction to SQL. What happens when you run an SQL query? There are 6 possible clauses in a select statement. Tara Murphy and James Curran Basic SQL queries Filtering Joining tables Grouping 2 Outline Introduction to SQL Tara Murphy and James Curran 1 Basic SQL queries 2 Filtering 27th March, 2008 3 Joining tables 4 Grouping Basic SQL queries

More information

Introduction to SQL. Tara Murphy and James Curran. 15th April, 2009

Introduction to SQL. Tara Murphy and James Curran. 15th April, 2009 Introduction to SQL Tara Murphy and James Curran 15th April, 2009 Basic SQL queries Filtering Joining tables Grouping 2 What happens when you run an SQL query? ˆ To run an SQL query the following steps

More information

Database Systems. phpmyadmin Tutorial

Database Systems. phpmyadmin Tutorial phpmyadmin Tutorial Please begin by logging into your Student Webspace. You will access the Student Webspace by logging into the Campus Common site. Go to the bottom of the page and click on the Go button

More information

PostgreSQL to MySQL A DBA's Perspective. Patrick

PostgreSQL to MySQL A DBA's Perspective. Patrick PostgreSQL to MySQL A DBA's Perspective Patrick King @mr_mustash Yelp s Mission Connecting people with great local businesses. My Database Experience Started using Postgres 7 years ago Postgres 8.4 (released

More information

1Copyright 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12

1Copyright 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 1 Insert Information Protection Policy Classification from Slide 12 Getting Started with MySQL Santo Leto Principal Technical Support Engineer, MySQL Jesper Wisborg Krogh Principal Technical Support Engineer,

More information

Practical Performance Tuning using Digested SQL Logs. Bob Burgess Salesforce Marketing Cloud

Practical Performance Tuning using Digested SQL Logs. Bob Burgess Salesforce Marketing Cloud Practical Performance Tuning using Digested SQL Logs Bob Burgess Salesforce Marketing Cloud Who?! Database Architect! Salesforce Marketing Cloud (Radian6 & Buddy Media stack) Why?! I can t be the only

More information

<Insert Picture Here> Upcoming Changes in MySQL 5.7 Morgan Tocker, MySQL Community Manager

<Insert Picture Here> Upcoming Changes in MySQL 5.7 Morgan Tocker, MySQL Community Manager Upcoming Changes in MySQL 5.7 Morgan Tocker, MySQL Community Manager http://www.tocker.ca/ Safe Harbor Statement The following is intended to outline our general product direction.

More information

MySQL 8.0 What s New in the Optimizer

MySQL 8.0 What s New in the Optimizer MySQL 8.0 What s New in the Optimizer Manyi Lu Director MySQL Optimizer & GIS Team, Oracle October 2016 Copyright Copyright 2 015, 2016,Oracle Oracle and/or and/or its its affiliates. affiliates. All All

More information

MySQL Cluster An Introduction

MySQL Cluster An Introduction MySQL Cluster An Introduction Geert Vanderkelen O Reilly MySQL Conference & Expo 2010 Apr. 13 2010 In this presentation we'll introduce you to MySQL Cluster. We ll go through the MySQL server, the storage

More information

MySQL Index Cookbook. Deep & Wide Index Tutorial

MySQL Index Cookbook. Deep & Wide Index Tutorial MySQL Index Cookbook Deep & Wide Index Tutorial Rick James Feb., 2015 TOC Preface Case Study PRIMARY KEY Use Cases EXPLAIN Work-Arounds Datatypes Tools PARTITIONing MyISAM Miscellany 2 Preface Terminology

More information

Chapter 9: Working With Data

Chapter 9: Working With Data Chapter 9: Working With Data o Working with Data DML Component of SQL Used with much greater frequency than DDL Used to Add / Maintain / Delete / Query tables INSERT Used to enter new records o Data entry

More information

Query Optimization, part 2: query plans in practice

Query Optimization, part 2: query plans in practice Query Optimization, part 2: query plans in practice CS634 Lecture 13 Slides by E. O Neil based on Database Management Systems 3 rd ed, Ramakrishnan and Gehrke Working with the Oracle query optimizer First

More information

Experimental Finance, IEOR. Mike Lipkin, Alexander Stanton

Experimental Finance, IEOR. Mike Lipkin, Alexander Stanton Experimental Finance, IEOR Mike Lipkin, Alexander Stanton Housekeeping Make sure your tables/views/functions are prefixed with UNI ID One zip file please, containing other files Describe your process Project

More information

ALTER TABLE Improvements in MARIADB Server. Marko Mäkelä Lead Developer InnoDB MariaDB Corporation

ALTER TABLE Improvements in MARIADB Server. Marko Mäkelä Lead Developer InnoDB MariaDB Corporation ALTER TABLE Improvements in MARIADB Server Marko Mäkelä Lead Developer InnoDB MariaDB Corporation Generic ALTER TABLE in MariaDB CREATE TABLE ; INSERT SELECT; RENAME ; DROP TABLE ; Retroactively named

More information

Lecture 19 Query Processing Part 1

Lecture 19 Query Processing Part 1 CMSC 461, Database Management Systems Spring 2018 Lecture 19 Query Processing Part 1 These slides are based on Database System Concepts 6 th edition book (whereas some quotes and figures are used from

More information

Load Testing Tools. for Troubleshooting MySQL Concurrency Issues. May, 23, 2018 Sveta Smirnova

Load Testing Tools. for Troubleshooting MySQL Concurrency Issues. May, 23, 2018 Sveta Smirnova Load Testing Tools for Troubleshooting MySQL Concurrency Issues May, 23, 2018 Sveta Smirnova Introduction This is very personal webinar No intended use No best practices No QA-specific tools Real life

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

618 Index. BIT data type, 108, 109 BIT_LENGTH, 595f BIT VARYING data type, 108 BLOB data type, 108 Boolean data type, 109

618 Index. BIT data type, 108, 109 BIT_LENGTH, 595f BIT VARYING data type, 108 BLOB data type, 108 Boolean data type, 109 Index A abbreviations in field names, 22 in table names, 31 Access. See under Microsoft acronyms in field names, 22 in table names, 31 aggregate functions, 74, 375 377, 416 428. See also AVG; COUNT; COUNT(*);

More information

Load Data Fast! BILL KARWIN PERCONA LIVE OPEN SOURCE DATABASE CONFERENCE 2017

Load Data Fast! BILL KARWIN PERCONA LIVE OPEN SOURCE DATABASE CONFERENCE 2017 Load Data Fast! BILL KARWIN PERCONA LIVE OPEN SOURCE DATABASE CONFERENCE 2017 Bill Karwin Software developer, consultant, trainer Using MySQL since 2000 Senior Database Architect at SchoolMessenger SQL

More information

Data Storage and Query Answering. Data Storage and Disk Structure (4)

Data Storage and Query Answering. Data Storage and Disk Structure (4) Data Storage and Query Answering Data Storage and Disk Structure (4) Introduction We have introduced secondary storage devices, in particular disks. Disks use blocks as basic units of transfer and storage.

More information

processing data with a database

processing data with a database processing data with a database 1 MySQL and MySQLdb MySQL: an open source database running MySQL for database creation MySQLdb: an interface to MySQL for Python 2 CTA Tables in MySQL files in GTFS feed

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

GridDB Advanced Edition SQL reference

GridDB Advanced Edition SQL reference GMA022C1 GridDB Advanced Edition SQL reference Toshiba Solutions Corporation 2016 All Rights Reserved. Introduction This manual describes how to write a SQL command in the GridDB Advanced Edition. Please

More information

Database performance becomes an important issue in the presence of

Database performance becomes an important issue in the presence of 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

More information

MySQL Index Cookbook. Deep & Wide Index Tutorial

MySQL Index Cookbook. Deep & Wide Index Tutorial MySQL Index Cookbook Deep & Wide Index Tutorial Rick James April, 2013 TOC Preface Case Study PRIMARY KEY Use Cases EXPLAIN Work-Arounds Datatypes Tools PARTITIONing MyISAM Miscellany Preface Terminology

More information

1z0-882.exam.55q 1z0-882 Oracle Certified Professional, MySQL 5.6 Developer

1z0-882.exam.55q   1z0-882 Oracle Certified Professional, MySQL 5.6 Developer 1z0-882.exam.55q Number: 1z0-882 Passing Score: 800 Time Limit: 120 min 1z0-882 Oracle Certified Professional, MySQL 5.6 Developer Exam A QUESTION 1 Which three are valid identifiers for the user table

More information

Tool/Web URL Features phpmyadmin. More on phpmyadmin under User Intefaces. MySQL Query Browser

Tool/Web URL Features phpmyadmin.   More on phpmyadmin under User Intefaces. MySQL Query Browser To store data in MySQL, we will set up a database and then place tables, relationships and other objects in that database, following a design that maps to our application requirements. We will use a command-line

More information

Introduction to MySQL /MariaDB and SQL Basics. Read Chapter 3!

Introduction to MySQL /MariaDB and SQL Basics. Read Chapter 3! Introduction to MySQL /MariaDB and SQL Basics Read Chapter 3! http://dev.mysql.com/doc/refman/ https://mariadb.com/kb/en/the-mariadb-library/documentation/ MySQL / MariaDB 1 College Database E-R Diagram

More information

MySQL vs MongoDB. Choosing right technology for your application. Peter Zaitsev CEO, Percona All Things Open, Raleigh,NC October 23 rd, 2017

MySQL vs MongoDB. Choosing right technology for your application. Peter Zaitsev CEO, Percona All Things Open, Raleigh,NC October 23 rd, 2017 MySQL vs MongoDB Choosing right technology for your application Peter Zaitsev CEO, Percona All Things Open, Raleigh,NC October 23 rd, 2017 1 MySQL vs MongoDB VS 2 Bigger Question What Open Source Database

More information

Modern Development With MySQL

Modern Development With MySQL Modern Development With MySQL Nicolas De Rico nicolas.de.rico@oracle.com Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes

More information

MySQL 5.7: What s New in the Optimizer?

MySQL 5.7: What s New in the Optimizer? MySQL 5.7: What s New in the Optimizer? Manyi Lu, Olav Sandstaa MySQL Optimizer Team, Oracle September, 2015 Copyright 2015, 2014, Oracle and/or its its affiliates. All All rights reserved. Safe Harbor

More information

Mysql Create Table With Multiple Index Example

Mysql Create Table With Multiple Index Example Mysql Create Table With Multiple Index Example The same process can be applied to all data types, for example numeric data will be CREATE TABLE 'students' ( 'id' int(11) NOT NULL AUTO_INCREMENT, a little

More information

Careerarm.com. 1. What is MySQL? MySQL is an open source DBMS which is built, supported and distributed by MySQL AB (now acquired by Oracle)

Careerarm.com. 1. What is MySQL? MySQL is an open source DBMS which is built, supported and distributed by MySQL AB (now acquired by Oracle) 1. What is MySQL? MySQL is an open source DBMS which is built, supported and distributed by MySQL AB (now acquired by Oracle) 2. What are the technical features of MySQL? MySQL database software is a client

More information

Analyze MySQL Query Performance with Percona Cloud Tools

Analyze MySQL Query Performance with Percona Cloud Tools Analyze MySQL Query Performance with Percona Cloud Tools Vadim Tkachenko Percona, Co-founder /CTO www.percona.com cloud.percona.com www.mysqlperformanceblog.com 2 This webinar Performance Percona Cloud

More information

Mysql Information Schema Update Time Null >>>CLICK HERE<<< doctrine:schema:update --dump-sql ALTER TABLE categorie

Mysql Information Schema Update Time Null >>>CLICK HERE<<< doctrine:schema:update --dump-sql ALTER TABLE categorie Mysql Information Schema Update Time Null I want to update a MySQL database schema (with MySQL code) but I am unfortunately not sure 'name' VARCHAR(64) NOT NULL 'password' VARCHAR(64) NOT NULL fieldname

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

SQL (and MySQL) Useful things I have learnt, borrowed and stolen

SQL (and MySQL) Useful things I have learnt, borrowed and stolen SQL (and MySQL) Useful things I have learnt, borrowed and stolen MySQL truncates data MySQL truncates data CREATE TABLE pets ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, type CHAR(3) NOT NULL, PRIMARY KEY

More information

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus CSCI-UA:0060-02 Database Design & Web Implementation Professor Evan Sandhaus sandhaus@cs.nyu.edu evan@nytimes.com Lecture #15: Post Spring Break Massive MySQL Review Database Design and Web Implementation

More information

MySQL Installation Guide (Windows)

MySQL Installation Guide (Windows) Step1- Install MySQL MySQL Installation Guide (Windows) The following description is based on MySQL 5.7.17 for Windows. Go to MySQL download page ( http://dev.mysql.com/downloads/mysql/ ). Click the Go

More information