SlideShare a Scribd company logo
1 of 30
Download to read offline
www.fromdual.com
1 / 30
Need for Speed:
Indexierung unter MySQL
CeBIT 2014,
11. März, Hannover
Oli Sennhauser
Senior MySQL Berater bei FromDual GmbH
oli.sennhauser@fromdual.com
www.fromdual.com
2 / 30
Über FromDual GmbH
● FromDual bietet neutral und unabhängig:
● Beratung für MySQL, Galera Cluster,
MariaDB und Percona Server
● Support für MySQL und Galera Cluster
● Remote-DBA Dienstleistungen
● MySQL Schulung
● OSB Alliance Mitglied
www.fromdual.com
www.fromdual.com
3 / 30
Unsere Kunden
www.fromdual.com
4 / 30
MySQL und Indexierung
● MySQL Dokumentation:
The best way to improve the performance of SELECT operations is
to create indexes on one or more of the columns that are tested in
the query.
● Grossartig! Aber:
Unnecessary indexes waste space and waste time to determine
which indexes to use. You must find the right balance to achieve
fast queries using the optimal set of indexes.
● ... hmmm, somit müssen wir wohl ein bisschen denken... :-(
www.fromdual.com
5 / 30
Was ist ein Index?
● Adams, Douglas:
The Hitchhiker's
Guide to the
Galaxy?
● Sennhauser, Oli,
Uster?
www.fromdual.com
6 / 30
Index technisch gesehen
MyISAM
InnoDB
www.fromdual.com
7 / 30
MySQL nutzt Indizes:
● Um Eindeutigkeit zu erzwingen (PRIMARY KEY, UNIQUE KEY)
● Um schnell auf Zeilen zuzugreifen und diese zu filtern (WHERE)
● Um Joins schnell auszuführen (JOIN)
● Um MIN() und MAX() Werte schnell zu finden
● Für Sortier- und Gruppier-Operationen (ORDER BY, GROUP BY)
●
Um Joins mittels eines Covering Index zu vermeiden
● Um FOREIGN KEY Constraints (FOREIGN KEY) zu erzwingen
www.fromdual.com
8 / 30
WHERE Klausel 1
SELECT *
  FROM customers
 WHERE name = 'FromDual';
SHOW CREATE TABLE customersG
CREATE TABLE `customers` (
  `customer_id` smallint(5) unsigned
, `name` varchar(64) DEFAULT NULL
, PRIMARY KEY (`customer_id`)
)
EXPLAIN
SELECT *
  FROM customers
 WHERE name = 'FromDual';
+­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­+­­­­­­+­­­­­­­+­­­­­­­­­­­­­+
| table     | type | possible_keys | key  | rows  | Extra       |
+­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­+­­­­­­+­­­­­­­+­­­­­­­­­­­­­+
| customers | ALL  | NULL          | NULL | 31978 | Using where |
+­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­+­­­­­­+­­­­­­­+­­­­­­­­­­­­­+
www.fromdual.com
9 / 30
Wie legt man Indices an?
ALTER TABLE …
● ADD PRIMARY KEY (id);
● ADD UNIQUE KEY (uuid);
● ADD FOREIGN KEY (customer_id)
REFERENCES customers (customer_id);
● ADD INDEX (last_name, first_name);
● ADD INDEX pre_ind (hash(8));
● ADD FULLTEXT INDEX (last_name, 
first_name);
www.fromdual.com
10 / 30
WHERE Klausel 2
ALTER TABLE customers
  ADD INDEX (name);
CREATE TABLE `customers` (
  `customer_id` smallint(5) unsigned
, `name` varchar(64) DEFAULT NULL
, PRIMARY KEY (`customer_id`)
, KEY `name` (`name`)
)
+-----------+------+---------------+------+---------+-------+------+
| table | type | possible_keys | key | key_len | ref | rows |
+-----------+------+---------------+------+---------+-------+------+
| customers | ref | name | name | 67 | const | 1 |
+-----------+------+---------------+------+---------+-------+------+
Verbesserung: 20 ms → 5 ms
www.fromdual.com
11 / 30
JOIN Klausel
EXPLAIN SELECT *
  FROM customers AS c
  JOIN orders AS o ON c.customer_id = o.customer_id
 WHERE c.name = 'FromDual';
+­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­+­­­­­­+­­­­­­­­­+­­­­­­­+­­­­­­­­­+
| table | type | possible_keys | key  | key_len | ref   | rows    |
+­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­+­­­­­­+­­­­­­­­­+­­­­­­­+­­­­­­­­­+
| c     | ref  | PRIMARY,name  | name | 67      | const |       1 |
| o     | ALL  | NULL          | NULL | NULL    | NULL  | 1045105 |
+­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­+­­­­­­+­­­­­­­­­+­­­­­­­+­­­­­­­­­+
ALTER TABLE orders
  ADD INDEX (customer_id);
+-------+------+---------------+-------------+---------+---------------+------+
| table | type | possible_keys | key | key_len | ref | rows |
+-------+------+---------------+-------------+---------+---------------+------+
| c | ref | PRIMARY,name | name | 67 | const | 1 |
| o | ref | customer_id | customer_id | 3 | c.customer_id | 8 |
+-------+------+---------------+-------------+---------+---------------+------+
Verbesserung: 450 ms → 6 ms
www.fromdual.com
12 / 30
Tabellen sortieren oder gruppieren
EXPLAIN SELECT *
  FROM contacts AS c
 WHERE last_name = 'Sennhauser'
 ORDER BY last_name, first_name;
+­­­­­­­+­­­­­­+­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| table | type | key       | rows | Extra                                              |
+­­­­­­­+­­­­­­+­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| c     | ref  | last_name | 1561 | Using index condition; Using where; Using filesort |
+­­­­­­­+­­­­­­+­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
ORDER BY, GROUP BY
ALTER TABLE contacts
  ADD INDEX (last_name, first_name);
+­­­­­­­+­­­­­­+­­­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­+
| table | type | key         | rows | Extra                    |
+­­­­­­­+­­­­­­+­­­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­+
| c     | ref  | last_name_2 | 1561 | Using where; Using index |
+­­­­­­­+­­­­­­+­­­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­+
Verbesserung : 20 ms → 7 ms
www.fromdual.com
13 / 30
Covering Indices
EXPLAIN
SELECT customer_id, amount
  FROM orders AS o
 WHERE customer_id = 59349;
+­­­­­­­+­­­­­­+­­­­­­­­­­­­­+­­­­­­+­­­­­­­+
| table | type | key         | rows | Extra |
+­­­­­­­+­­­­­­+­­­­­­­­­­­­­+­­­­­­+­­­­­­­+
| o     | ref  | customer_id |   15 | NULL  |
+­­­­­­­+­­­­­­+­­­­­­­­­­­­­+­­­­­­+­­­­­­­+
ALTER TABLE orders
  ADD INDEX (customer_id, amount);
+­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­+
| table | type | key           | rows | Extra       |
+­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­+
| o     | ref  | customer_id_2 |   15 | Using index |
+­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­+
Und jetzt?
www.fromdual.com
14 / 30
Vorteil von Covering Indices
● Warum sind Covering Indices vorteilhaft?
ohne
mit
www.fromdual.com
15 / 30
Finden von fehlenden Indices
● ER Diagramm? :-(
● Hängt hauptsächlich von der Business
Logik ab...
● Wie FINDET man sie? --> Slow Query Log
● MySQL Variablen:
● Seit v5.1
on-line!
+-------------------------------+----------+
| Variable_name | Value |
+-------------------------------+----------+
| log_queries_not_using_indexes | ON |
| long_query_time | 0.250000 |
| min_examined_row_limit | 100 |
| slow_query_log | ON |
| slow_query_log_file | slow.log |
+-------------------------------+----------+
www.fromdual.com
16 / 30
Indices sind nicht nur gut!
● Indices brauchen Platz (Platte, heisse Daten im RAM!)
● Indices brauchen Zeit für Wartung (CPU, RAM, I/O)
● Optimizer braucht Zeit um herauszufinden, welchen
Index er nehmen soll.
● Manchmal ist der Optimizer völlig verwirrt und trifft eine
falsche Entscheidung wenn zu viele (ähnliche) Indices
vorhanden sind.
→ Es gilt die richtige Balance
für schnelle Abfragen und
optimalen Indices zu finden.
www.fromdual.com
17 / 30
Kleiner Index – schnelle Abfrage
● Passt besser in RAM (weniger I/O)
● Höhere Datendichte (Rows/Block)
● Weniger CPU Zyklen
● Prefixed Index:
ADD INDEX pre_ind (hash(8));
www.fromdual.com
18 / 30
Indices vermeiden
● Vermeide redundante (daher unnötige) Indices
● Wie kann so was passieren?
● Entwickler 1: Kreiert einen Foreign Key Constraint → erledigt
● Entwickler 2: Ouu! Abfrage ist langsam → Oli hat gesagt:
Index anlegen → erledigt
● Entwickler 3: Ouu! Anfrage ist langsam → Entwickler 2 ist ein
Idiot! → Index anlegen → erledigt
● Frameworks vs. Entwickler
● Upgrade Prozess vs. DevOps
● Vermeide Indexes welche nicht benutz/benötigt werden!
www.fromdual.com
19 / 30
Wie findet man solche Indices?
SHOW CREATE TABLE ...G
mysqldump ­­no­data > structure_dump.sql
● Seit MySQL 5.6: PERFORMANCE_SCHEMA
● Percona Server / MariaDB: Userstats
● http://fromdual.com/mysql-performance-schema-hints
SELECT object_schema, object_name, index_name
FROM performance_schema.table_io_waits_summary_by_index_usage
WHERE index_name IS NOT NULL
AND count_star = 0
ORDER BY object_schema, object_name;
www.fromdual.com
20 / 30
Vermeide partiell redundante
Indices
● INDEX (city, last_name, first_name)
● INDEX (city, last_name)
● INDEX (city)
● INDEX (last_name, city)
● INDEX (first_name, last_name)
???
!!!
www.fromdual.com
21 / 30
Schlechte Selektivität
● Weg mit Indices mit schlechter Selektivität (~= geringe
Kardinalität)
● Kandidaten sind:
● status
● gender
● active
● Wie findet man ob ein Feld eine
schlechte Selektivität hat?
Indices (und Joins) sind teuer!!!
● Break-even zwischen 15% und 66%
● Schauen wir mal ob der MySQL
Optimizer davon weiss... :-)
SELECT status, COUNT(*)
FROM orders
GROUP BY status;
+--------+--------+
| status | cnt |
+--------+--------+
| 0 | 393216 |
| 1 | 262144 |
| 2 | 12 |
| 3 | 36 |
| 4 | 24 |
| 5 | 4 |
| 6 | 8 |
+--------+--------+
www.fromdual.com
22 / 30
Optimizer liegt falsch!
SELECT * FROM orders WHERE status = 2;
+--------+------+---------------+--------+------+
| table | type | possible_keys | key | rows |
+--------+------+---------------+--------+------+
| orders | ref | status | status | 12 |
+--------+------+---------------+--------+------+
SELECT * FROM orders WHERE status = 0;
1.43 s
+--------+------+---------------+--------+--------+
| table | type | possible_keys | key | rows |
+--------+------+---------------+--------+--------+
| orders | ref | status | status | 327469 |
+--------+------+---------------+--------+--------+
SELECT * FROM orders IGNORE INDEX (status) WHERE status = 0;
0.44 s
+--------+------+---------------+------+--------+
| table | type | possible_keys | key | rows |
+--------+------+---------------+------+--------+
| orders | ALL | NULL | NULL | 654939 |
+--------+------+---------------+------+--------+
SELECT status, COUNT(*)
FROM orders
GROUP BY status;
+--------+--------+
| status | cnt |
+--------+--------+
| 0 | 393216 |
| 1 | 262144 |
| 2 | 12 |
| 3 | 36 |
| 4 | 24 |
| 5 | 4 |
| 6 | 8 |
+--------+--------+
5.6.12 (nach ANALYZE TABLE)
www.fromdual.com
23 / 30
InnoDB PK und SK
● InnoDB kennt
● Primary Keys und
● Secondary Keys
www.fromdual.com
24 / 30
Geclusterter Index
● InnoDB: Daten = Blätter des Primary Keys
● Heisst auch Index Clustered Table (IOT)
→ Daten sind sortiert wie PK (Index ist sortiert)!
→ PK beeinflusst Lokalität der Daten (physische
Lage)
● AUTO_INCREMENT ~= Sortieren nach Zeit!
● Gut in vielen Fällen
● Wenn heisse Daten = aktuelle Daten
● Schlecht für Zeitreihen
● Wenn heisse Daten = Daten pro Objekt
www.fromdual.com
25 / 30
A_I ts v_id xpos ypos ...
Beispiel: InnoDB
   1 17:30 #42 x, y, ...
   2 17:30 #43 x, y, ...
   3 17:30 #44 x, y, ...
2001 17:32 #42 x, y, ...
2002 17:32 #43 x, y, ...
2003 17:32 #44 x, y, ...
...
#42 alle 2'
die letzten 3 Tage
Q1: Δ in Zeilen?
A1: 1 Zeile ~ 100 byte
Q2: Δ in bytes?
Q3: Default InnoDB block size?
Q4: Avg. # Zeilen von LKW #42 in 1 InnoDB block?
A2: 3 d und 720 pt/d → ~2000 pt ~ 2000 rec ~ 2000 blk
Q5: Wie lange dauert das und warum (32 Mbyte)?
~ 2000 IOPS ~ 10s random read!!!
S: Alles im RAM oder starkes I/O-System oder …?
~ 2000 Zeilen
~ 200 kbyte
default: 16 kbyte
~ 1
2000 LKWs
www.fromdual.com
26 / 30
ts v_id xpos ypos ...
Geclusterter PK rettet den Tag!
17:30 #42 x, y, ...
17:32 #42 x, y, ...
17:34 #42 x, y, ...
17:30 #43 x, y, ...
17:32 #43 x, y, ...
17:34 #43 x, y, ...
... #42 alle 2'
die letzten 3 Tage
Q1: Avg. # Zeilen von LKW #42 in 1 InnoDB block?
A1: 3 d und 720 pt/d → ~2000 pt ~ 2000 rec ~ 20 blk
Q2: Wie lange dauert das und warum (320 kbyte)?
~ 1-2 IOPS ~ 10-20 ms sequential read!
S: Wow f=50 schneller! Nachteile?
~ 120
2000 LKWs
17:30 #44 x, y, ...
...
www.fromdual.com
27 / 30
Index Hints
● MySQL Optimizer liegt manchmal falsch!
● Wir müssen ihm nachhelfen...
● Index Hints (Hinweise) sind:
● USE INDEX (ind1, ind2)
● Schau nur diese Indices an...
● FORCE INDEX (ind3)
● Nimm diesen Index ohne weiter nachzudenken
● IGNORE INDEX (ind1, ind3)
● Schau Dir alle Indices ausser diese an
● Hints nur als allerletzte Rettung verwenden!
www.fromdual.com
28 / 30
MySQL Variablen
● MySQL Variablen welche Indices beeinflussen
● MyISAM: key_buffer_size
● InnoDB: innodb_buffer_pool_size
● InnoDB Change Buffer
● innodb_change_buffer_max_size
● innodb_change_buffering
● Adaptive Hash Index (AHI)
● MySQL 5.6.3 / 5.5.14 Indexlänge 767 → 3072 bytes
● innodb_large_prefix
www.fromdual.com
29 / 30
Wir suchen noch:
● Datenbank Enthusiast/in für Support /
remote-DBA / Beratung
www.fromdual.com
30 / 30
Q & A
Fragen ?
Diskussion?
Anschliessend ist noch Zeit für ein persönliches Gespräch...
● FromDual bietet neutral und unabhängig:
● MySQL Beratung
● Remote-DBA
● Support für MySQL, Galera Cluster, MariaDB und Percona Server
●
MySQL Schulung
www.fromdual.com/presentations

More Related Content

What's hot

MySQLドライバの改良と軽量O/Rマッパーの紹介
MySQLドライバの改良と軽量O/Rマッパーの紹介MySQLドライバの改良と軽量O/Rマッパーの紹介
MySQLドライバの改良と軽量O/Rマッパーの紹介kwatch
 
Percona Live 2012PPT: MySQL Query optimization
Percona Live 2012PPT: MySQL Query optimizationPercona Live 2012PPT: MySQL Query optimization
Percona Live 2012PPT: MySQL Query optimizationmysqlops
 
External Language Stored Procedures for MySQL
External Language Stored Procedures for MySQLExternal Language Stored Procedures for MySQL
External Language Stored Procedures for MySQLAntony T Curtis
 
Tracing and profiling my sql (percona live europe 2019) draft_1
Tracing and profiling my sql (percona live europe 2019) draft_1Tracing and profiling my sql (percona live europe 2019) draft_1
Tracing and profiling my sql (percona live europe 2019) draft_1Valerii Kravchuk
 
Applying profilers to my sql (fosdem 2017)
Applying profilers to my sql (fosdem 2017)Applying profilers to my sql (fosdem 2017)
Applying profilers to my sql (fosdem 2017)Valeriy Kravchuk
 
Instant add column for inno db in mariadb 10.3+ (fosdem 2018, second draft)
Instant add column for inno db in mariadb 10.3+ (fosdem 2018, second draft)Instant add column for inno db in mariadb 10.3+ (fosdem 2018, second draft)
Instant add column for inno db in mariadb 10.3+ (fosdem 2018, second draft)Valerii Kravchuk
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바NeoClova
 
Gdb basics for my sql db as (openfest 2017) final
Gdb basics for my sql db as (openfest 2017) finalGdb basics for my sql db as (openfest 2017) final
Gdb basics for my sql db as (openfest 2017) finalValeriy Kravchuk
 
FOSDEM 2012: MySQL synchronous replication in practice with Galera
FOSDEM 2012: MySQL synchronous replication in practice with GaleraFOSDEM 2012: MySQL synchronous replication in practice with Galera
FOSDEM 2012: MySQL synchronous replication in practice with GaleraFromDual GmbH
 
Using Perl Stored Procedures for MariaDB
Using Perl Stored Procedures for MariaDBUsing Perl Stored Procedures for MariaDB
Using Perl Stored Procedures for MariaDBAntony T Curtis
 
MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)NeoClova
 
Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)Valerii Kravchuk
 
Performance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingPerformance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingSveta Smirnova
 
How to Avoid Pitfalls in Schema Upgrade with Galera
How to Avoid Pitfalls in Schema Upgrade with GaleraHow to Avoid Pitfalls in Schema Upgrade with Galera
How to Avoid Pitfalls in Schema Upgrade with GaleraSveta Smirnova
 
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sadDevelopers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sadmCloud
 
MySQL Timeout Variables Explained
MySQL Timeout Variables Explained MySQL Timeout Variables Explained
MySQL Timeout Variables Explained Mydbops
 
MySQL Backup and Security Best Practices
MySQL Backup and Security Best PracticesMySQL Backup and Security Best Practices
MySQL Backup and Security Best PracticesLenz Grimmer
 
How to Avoid Pitfalls in Schema Upgrade with Percona XtraDB Cluster
How to Avoid Pitfalls in Schema Upgrade with Percona XtraDB ClusterHow to Avoid Pitfalls in Schema Upgrade with Percona XtraDB Cluster
How to Avoid Pitfalls in Schema Upgrade with Percona XtraDB ClusterSveta Smirnova
 
MySQL Performance schema missing_manual_flossuk
MySQL Performance schema missing_manual_flossukMySQL Performance schema missing_manual_flossuk
MySQL Performance schema missing_manual_flossukValeriy Kravchuk
 

What's hot (20)

MySQLドライバの改良と軽量O/Rマッパーの紹介
MySQLドライバの改良と軽量O/Rマッパーの紹介MySQLドライバの改良と軽量O/Rマッパーの紹介
MySQLドライバの改良と軽量O/Rマッパーの紹介
 
Percona Live 2012PPT: MySQL Query optimization
Percona Live 2012PPT: MySQL Query optimizationPercona Live 2012PPT: MySQL Query optimization
Percona Live 2012PPT: MySQL Query optimization
 
External Language Stored Procedures for MySQL
External Language Stored Procedures for MySQLExternal Language Stored Procedures for MySQL
External Language Stored Procedures for MySQL
 
Tracing and profiling my sql (percona live europe 2019) draft_1
Tracing and profiling my sql (percona live europe 2019) draft_1Tracing and profiling my sql (percona live europe 2019) draft_1
Tracing and profiling my sql (percona live europe 2019) draft_1
 
Applying profilers to my sql (fosdem 2017)
Applying profilers to my sql (fosdem 2017)Applying profilers to my sql (fosdem 2017)
Applying profilers to my sql (fosdem 2017)
 
Instant add column for inno db in mariadb 10.3+ (fosdem 2018, second draft)
Instant add column for inno db in mariadb 10.3+ (fosdem 2018, second draft)Instant add column for inno db in mariadb 10.3+ (fosdem 2018, second draft)
Instant add column for inno db in mariadb 10.3+ (fosdem 2018, second draft)
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바
 
Gdb basics for my sql db as (openfest 2017) final
Gdb basics for my sql db as (openfest 2017) finalGdb basics for my sql db as (openfest 2017) final
Gdb basics for my sql db as (openfest 2017) final
 
FOSDEM 2012: MySQL synchronous replication in practice with Galera
FOSDEM 2012: MySQL synchronous replication in practice with GaleraFOSDEM 2012: MySQL synchronous replication in practice with Galera
FOSDEM 2012: MySQL synchronous replication in practice with Galera
 
Using Perl Stored Procedures for MariaDB
Using Perl Stored Procedures for MariaDBUsing Perl Stored Procedures for MariaDB
Using Perl Stored Procedures for MariaDB
 
MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)
 
Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)
 
Performance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingPerformance Schema for MySQL Troubleshooting
Performance Schema for MySQL Troubleshooting
 
How to Avoid Pitfalls in Schema Upgrade with Galera
How to Avoid Pitfalls in Schema Upgrade with GaleraHow to Avoid Pitfalls in Schema Upgrade with Galera
How to Avoid Pitfalls in Schema Upgrade with Galera
 
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sadDevelopers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
 
MySQL Timeout Variables Explained
MySQL Timeout Variables Explained MySQL Timeout Variables Explained
MySQL Timeout Variables Explained
 
MySQL Backup and Security Best Practices
MySQL Backup and Security Best PracticesMySQL Backup and Security Best Practices
MySQL Backup and Security Best Practices
 
How to Avoid Pitfalls in Schema Upgrade with Percona XtraDB Cluster
How to Avoid Pitfalls in Schema Upgrade with Percona XtraDB ClusterHow to Avoid Pitfalls in Schema Upgrade with Percona XtraDB Cluster
How to Avoid Pitfalls in Schema Upgrade with Percona XtraDB Cluster
 
MySQL Performance schema missing_manual_flossuk
MySQL Performance schema missing_manual_flossukMySQL Performance schema missing_manual_flossuk
MySQL Performance schema missing_manual_flossuk
 
My sql administration
My sql administrationMy sql administration
My sql administration
 

Similar to MySQL Indexierung CeBIT 2014

Need for Speed: Mysql indexing
Need for Speed: Mysql indexingNeed for Speed: Mysql indexing
Need for Speed: Mysql indexingFromDual GmbH
 
Need for Speed: MySQL Indexing
Need for Speed: MySQL IndexingNeed for Speed: MySQL Indexing
Need for Speed: MySQL IndexingMYXPLAIN
 
MariaDB 10.5 new features for troubleshooting (mariadb server fest 2020)
MariaDB 10.5 new features for troubleshooting (mariadb server fest 2020)MariaDB 10.5 new features for troubleshooting (mariadb server fest 2020)
MariaDB 10.5 new features for troubleshooting (mariadb server fest 2020)Valeriy Kravchuk
 
PostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major FeaturesPostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major FeaturesInMobi Technology
 
IT Tage 2019 MariaDB 10.4 New Features
IT Tage 2019 MariaDB 10.4 New FeaturesIT Tage 2019 MariaDB 10.4 New Features
IT Tage 2019 MariaDB 10.4 New FeaturesFromDual GmbH
 
MariaDB 10.4 New Features
MariaDB 10.4 New FeaturesMariaDB 10.4 New Features
MariaDB 10.4 New FeaturesFromDual GmbH
 
MariaDB 10.0 Query Optimizer
MariaDB 10.0 Query OptimizerMariaDB 10.0 Query Optimizer
MariaDB 10.0 Query OptimizerSergey Petrunya
 
MariaDB 10.2 New Features
MariaDB 10.2 New FeaturesMariaDB 10.2 New Features
MariaDB 10.2 New FeaturesFromDual GmbH
 
Query Optimization with MySQL 5.6: Old and New Tricks
Query Optimization with MySQL 5.6: Old and New TricksQuery Optimization with MySQL 5.6: Old and New Tricks
Query Optimization with MySQL 5.6: Old and New TricksMYXPLAIN
 
Performance Schema for MySQL troubleshooting
Performance Schema for MySQL troubleshootingPerformance Schema for MySQL troubleshooting
Performance Schema for MySQL troubleshootingSveta Smirnova
 
Performance Enhancements In Postgre Sql 8.4
Performance Enhancements In Postgre Sql 8.4Performance Enhancements In Postgre Sql 8.4
Performance Enhancements In Postgre Sql 8.4HighLoad2009
 
PostgreSQL 9.5 Features
PostgreSQL 9.5 FeaturesPostgreSQL 9.5 Features
PostgreSQL 9.5 FeaturesSaiful
 
Performance schema in_my_sql_5.6_pluk2013
Performance schema in_my_sql_5.6_pluk2013Performance schema in_my_sql_5.6_pluk2013
Performance schema in_my_sql_5.6_pluk2013Valeriy Kravchuk
 
Sql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ISql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ICarlos Oliveira
 
Performance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingPerformance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingSveta Smirnova
 
Advanced Query Optimizer Tuning and Analysis
Advanced Query Optimizer Tuning and AnalysisAdvanced Query Optimizer Tuning and Analysis
Advanced Query Optimizer Tuning and AnalysisMYXPLAIN
 
MySQL Query Optimisation 101
MySQL Query Optimisation 101MySQL Query Optimisation 101
MySQL Query Optimisation 101Federico Razzoli
 

Similar to MySQL Indexierung CeBIT 2014 (20)

Need for Speed: Mysql indexing
Need for Speed: Mysql indexingNeed for Speed: Mysql indexing
Need for Speed: Mysql indexing
 
Need for Speed: MySQL Indexing
Need for Speed: MySQL IndexingNeed for Speed: MySQL Indexing
Need for Speed: MySQL Indexing
 
MariaDB 10.5 new features for troubleshooting (mariadb server fest 2020)
MariaDB 10.5 new features for troubleshooting (mariadb server fest 2020)MariaDB 10.5 new features for troubleshooting (mariadb server fest 2020)
MariaDB 10.5 new features for troubleshooting (mariadb server fest 2020)
 
PostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major FeaturesPostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major Features
 
IT Tage 2019 MariaDB 10.4 New Features
IT Tage 2019 MariaDB 10.4 New FeaturesIT Tage 2019 MariaDB 10.4 New Features
IT Tage 2019 MariaDB 10.4 New Features
 
MariaDB 10.4 New Features
MariaDB 10.4 New FeaturesMariaDB 10.4 New Features
MariaDB 10.4 New Features
 
MariaDB 10.0 Query Optimizer
MariaDB 10.0 Query OptimizerMariaDB 10.0 Query Optimizer
MariaDB 10.0 Query Optimizer
 
MariaDB 10.2 New Features
MariaDB 10.2 New FeaturesMariaDB 10.2 New Features
MariaDB 10.2 New Features
 
MySQL performance tuning
MySQL performance tuningMySQL performance tuning
MySQL performance tuning
 
Query Optimization with MySQL 5.6: Old and New Tricks
Query Optimization with MySQL 5.6: Old and New TricksQuery Optimization with MySQL 5.6: Old and New Tricks
Query Optimization with MySQL 5.6: Old and New Tricks
 
Performance Schema for MySQL troubleshooting
Performance Schema for MySQL troubleshootingPerformance Schema for MySQL troubleshooting
Performance Schema for MySQL troubleshooting
 
Performance Enhancements In Postgre Sql 8.4
Performance Enhancements In Postgre Sql 8.4Performance Enhancements In Postgre Sql 8.4
Performance Enhancements In Postgre Sql 8.4
 
PostgreSQL 9.5 Features
PostgreSQL 9.5 FeaturesPostgreSQL 9.5 Features
PostgreSQL 9.5 Features
 
Performance schema in_my_sql_5.6_pluk2013
Performance schema in_my_sql_5.6_pluk2013Performance schema in_my_sql_5.6_pluk2013
Performance schema in_my_sql_5.6_pluk2013
 
Sql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ISql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices I
 
My sql
My sqlMy sql
My sql
 
Performance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingPerformance Schema for MySQL Troubleshooting
Performance Schema for MySQL Troubleshooting
 
Advanced Query Optimizer Tuning and Analysis
Advanced Query Optimizer Tuning and AnalysisAdvanced Query Optimizer Tuning and Analysis
Advanced Query Optimizer Tuning and Analysis
 
MySQL Query Optimisation 101
MySQL Query Optimisation 101MySQL Query Optimisation 101
MySQL Query Optimisation 101
 
MySQLinsanity
MySQLinsanityMySQLinsanity
MySQLinsanity
 

More from FromDual GmbH

MariaDB/MySQL pitfalls - And how to come out again...
MariaDB/MySQL pitfalls - And how to come out again...MariaDB/MySQL pitfalls - And how to come out again...
MariaDB/MySQL pitfalls - And how to come out again...FromDual GmbH
 
MariaDB / MySQL tripping hazard and how to get out again?
MariaDB / MySQL tripping hazard and how to get out again?MariaDB / MySQL tripping hazard and how to get out again?
MariaDB / MySQL tripping hazard and how to get out again?FromDual GmbH
 
PXC 5.5 to MariaDB 10.4 Galera Cluster Migration Workshop
PXC 5.5 to MariaDB 10.4 Galera Cluster Migration WorkshopPXC 5.5 to MariaDB 10.4 Galera Cluster Migration Workshop
PXC 5.5 to MariaDB 10.4 Galera Cluster Migration WorkshopFromDual GmbH
 
PERFORMANCE_SCHEMA and sys schema
PERFORMANCE_SCHEMA and sys schemaPERFORMANCE_SCHEMA and sys schema
PERFORMANCE_SCHEMA and sys schemaFromDual GmbH
 
MySQL für Oracle DBA's
MySQL für Oracle DBA'sMySQL für Oracle DBA's
MySQL für Oracle DBA'sFromDual GmbH
 
MySQL Backup/Recovery
MySQL Backup/RecoveryMySQL Backup/Recovery
MySQL Backup/RecoveryFromDual GmbH
 
MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?
MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?
MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?FromDual GmbH
 
MySQL-Server im Teamwork - Replikation und Cluster
MySQL-Server im Teamwork - Replikation und ClusterMySQL-Server im Teamwork - Replikation und Cluster
MySQL-Server im Teamwork - Replikation und ClusterFromDual GmbH
 
Der Datenbank-Backup ist gemacht - was nun?
Der Datenbank-Backup ist gemacht - was nun?Der Datenbank-Backup ist gemacht - was nun?
Der Datenbank-Backup ist gemacht - was nun?FromDual GmbH
 
Weltweite Produktionsdatenverwaltung mit MySQL-Replikation
Weltweite Produktionsdatenverwaltung mit MySQL-ReplikationWeltweite Produktionsdatenverwaltung mit MySQL-Replikation
Weltweite Produktionsdatenverwaltung mit MySQL-ReplikationFromDual GmbH
 
MySQL Performance Tuning für Oracle-DBA's
MySQL Performance Tuning für Oracle-DBA'sMySQL Performance Tuning für Oracle-DBA's
MySQL Performance Tuning für Oracle-DBA'sFromDual GmbH
 
MySQL Security SLAC 2015
MySQL Security SLAC 2015MySQL Security SLAC 2015
MySQL Security SLAC 2015FromDual GmbH
 
MySQL Performance Tuning für Entwickler
MySQL Performance Tuning für EntwicklerMySQL Performance Tuning für Entwickler
MySQL Performance Tuning für EntwicklerFromDual GmbH
 
MySQL Replikation - Die Eier legende Wollmilchsau?
MySQL Replikation - Die Eier legende Wollmilchsau?MySQL Replikation - Die Eier legende Wollmilchsau?
MySQL Replikation - Die Eier legende Wollmilchsau?FromDual GmbH
 
Reading MySQL fingerprints
Reading MySQL fingerprintsReading MySQL fingerprints
Reading MySQL fingerprintsFromDual GmbH
 
High-availability with Galera Cluster for MySQL
High-availability with Galera Cluster for MySQLHigh-availability with Galera Cluster for MySQL
High-availability with Galera Cluster for MySQLFromDual GmbH
 
MySQL always-up with Galera Cluster
MySQL always-up with Galera ClusterMySQL always-up with Galera Cluster
MySQL always-up with Galera ClusterFromDual GmbH
 
MySQL Cluster with Galera Cluster for MySQL
MySQL Cluster with Galera Cluster for MySQLMySQL Cluster with Galera Cluster for MySQL
MySQL Cluster with Galera Cluster for MySQLFromDual GmbH
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAsFromDual GmbH
 

More from FromDual GmbH (20)

MariaDB/MySQL pitfalls - And how to come out again...
MariaDB/MySQL pitfalls - And how to come out again...MariaDB/MySQL pitfalls - And how to come out again...
MariaDB/MySQL pitfalls - And how to come out again...
 
MariaDB / MySQL tripping hazard and how to get out again?
MariaDB / MySQL tripping hazard and how to get out again?MariaDB / MySQL tripping hazard and how to get out again?
MariaDB / MySQL tripping hazard and how to get out again?
 
PXC 5.5 to MariaDB 10.4 Galera Cluster Migration Workshop
PXC 5.5 to MariaDB 10.4 Galera Cluster Migration WorkshopPXC 5.5 to MariaDB 10.4 Galera Cluster Migration Workshop
PXC 5.5 to MariaDB 10.4 Galera Cluster Migration Workshop
 
PERFORMANCE_SCHEMA and sys schema
PERFORMANCE_SCHEMA and sys schemaPERFORMANCE_SCHEMA and sys schema
PERFORMANCE_SCHEMA and sys schema
 
MySQL für Oracle DBA's
MySQL für Oracle DBA'sMySQL für Oracle DBA's
MySQL für Oracle DBA's
 
MySQL Backup/Recovery
MySQL Backup/RecoveryMySQL Backup/Recovery
MySQL Backup/Recovery
 
MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?
MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?
MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?
 
MySQL-Server im Teamwork - Replikation und Cluster
MySQL-Server im Teamwork - Replikation und ClusterMySQL-Server im Teamwork - Replikation und Cluster
MySQL-Server im Teamwork - Replikation und Cluster
 
Der Datenbank-Backup ist gemacht - was nun?
Der Datenbank-Backup ist gemacht - was nun?Der Datenbank-Backup ist gemacht - was nun?
Der Datenbank-Backup ist gemacht - was nun?
 
Weltweite Produktionsdatenverwaltung mit MySQL-Replikation
Weltweite Produktionsdatenverwaltung mit MySQL-ReplikationWeltweite Produktionsdatenverwaltung mit MySQL-Replikation
Weltweite Produktionsdatenverwaltung mit MySQL-Replikation
 
MySQL Performance Tuning für Oracle-DBA's
MySQL Performance Tuning für Oracle-DBA'sMySQL Performance Tuning für Oracle-DBA's
MySQL Performance Tuning für Oracle-DBA's
 
MySQL Security SLAC 2015
MySQL Security SLAC 2015MySQL Security SLAC 2015
MySQL Security SLAC 2015
 
MySQL Performance Tuning für Entwickler
MySQL Performance Tuning für EntwicklerMySQL Performance Tuning für Entwickler
MySQL Performance Tuning für Entwickler
 
MySQL Replikation - Die Eier legende Wollmilchsau?
MySQL Replikation - Die Eier legende Wollmilchsau?MySQL Replikation - Die Eier legende Wollmilchsau?
MySQL Replikation - Die Eier legende Wollmilchsau?
 
Reading MySQL fingerprints
Reading MySQL fingerprintsReading MySQL fingerprints
Reading MySQL fingerprints
 
High-availability with Galera Cluster for MySQL
High-availability with Galera Cluster for MySQLHigh-availability with Galera Cluster for MySQL
High-availability with Galera Cluster for MySQL
 
MySQL always-up with Galera Cluster
MySQL always-up with Galera ClusterMySQL always-up with Galera Cluster
MySQL always-up with Galera Cluster
 
MySQL Cluster with Galera Cluster for MySQL
MySQL Cluster with Galera Cluster for MySQLMySQL Cluster with Galera Cluster for MySQL
MySQL Cluster with Galera Cluster for MySQL
 
MySQL Backup
MySQL BackupMySQL Backup
MySQL Backup
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAs
 

Recently uploaded

Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSimulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSebastiano Panichella
 
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.KathleenAnnCordero2
 
Quality by design.. ppt for RA (1ST SEM
Quality by design.. ppt for  RA (1ST SEMQuality by design.. ppt for  RA (1ST SEM
Quality by design.. ppt for RA (1ST SEMCharmi13
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationNathan Young
 
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power
 
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATIONRACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATIONRachelAnnTenibroAmaz
 
Early Modern Spain. All about this period
Early Modern Spain. All about this periodEarly Modern Spain. All about this period
Early Modern Spain. All about this periodSaraIsabelJimenez
 
PHYSICS PROJECT BY MSC - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC  - NANOTECHNOLOGYPHYSICS PROJECT BY MSC  - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC - NANOTECHNOLOGYpruthirajnayak525
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxaryanv1753
 
Chizaram's Women Tech Makers Deck. .pptx
Chizaram's Women Tech Makers Deck.  .pptxChizaram's Women Tech Makers Deck.  .pptx
Chizaram's Women Tech Makers Deck. .pptxogubuikealex
 
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comSaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comsaastr
 
Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Escort Service
 
Work Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptxWork Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptxmavinoikein
 
miladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptxmiladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptxCarrieButtitta
 
The 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringThe 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringSebastiano Panichella
 
Genshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptxGenshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptxJohnree4
 
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...漢銘 謝
 
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRRINDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRRsarwankumar4524
 
Engaging Eid Ul Fitr Presentation for Kindergartners.pptx
Engaging Eid Ul Fitr Presentation for Kindergartners.pptxEngaging Eid Ul Fitr Presentation for Kindergartners.pptx
Engaging Eid Ul Fitr Presentation for Kindergartners.pptxAsifArshad8
 
SBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSebastiano Panichella
 

Recently uploaded (20)

Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSimulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
 
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
 
Quality by design.. ppt for RA (1ST SEM
Quality by design.. ppt for  RA (1ST SEMQuality by design.. ppt for  RA (1ST SEM
Quality by design.. ppt for RA (1ST SEM
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism Presentation
 
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
 
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATIONRACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
 
Early Modern Spain. All about this period
Early Modern Spain. All about this periodEarly Modern Spain. All about this period
Early Modern Spain. All about this period
 
PHYSICS PROJECT BY MSC - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC  - NANOTECHNOLOGYPHYSICS PROJECT BY MSC  - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC - NANOTECHNOLOGY
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptx
 
Chizaram's Women Tech Makers Deck. .pptx
Chizaram's Women Tech Makers Deck.  .pptxChizaram's Women Tech Makers Deck.  .pptx
Chizaram's Women Tech Makers Deck. .pptx
 
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comSaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
 
Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170
 
Work Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptxWork Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptx
 
miladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptxmiladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptx
 
The 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringThe 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software Engineering
 
Genshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptxGenshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptx
 
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
 
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRRINDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRR
 
Engaging Eid Ul Fitr Presentation for Kindergartners.pptx
Engaging Eid Ul Fitr Presentation for Kindergartners.pptxEngaging Eid Ul Fitr Presentation for Kindergartners.pptx
Engaging Eid Ul Fitr Presentation for Kindergartners.pptx
 
SBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation Track
 

MySQL Indexierung CeBIT 2014

  • 1. www.fromdual.com 1 / 30 Need for Speed: Indexierung unter MySQL CeBIT 2014, 11. März, Hannover Oli Sennhauser Senior MySQL Berater bei FromDual GmbH oli.sennhauser@fromdual.com
  • 2. www.fromdual.com 2 / 30 Über FromDual GmbH ● FromDual bietet neutral und unabhängig: ● Beratung für MySQL, Galera Cluster, MariaDB und Percona Server ● Support für MySQL und Galera Cluster ● Remote-DBA Dienstleistungen ● MySQL Schulung ● OSB Alliance Mitglied www.fromdual.com
  • 4. www.fromdual.com 4 / 30 MySQL und Indexierung ● MySQL Dokumentation: The best way to improve the performance of SELECT operations is to create indexes on one or more of the columns that are tested in the query. ● Grossartig! Aber: Unnecessary indexes waste space and waste time to determine which indexes to use. You must find the right balance to achieve fast queries using the optimal set of indexes. ● ... hmmm, somit müssen wir wohl ein bisschen denken... :-(
  • 5. www.fromdual.com 5 / 30 Was ist ein Index? ● Adams, Douglas: The Hitchhiker's Guide to the Galaxy? ● Sennhauser, Oli, Uster?
  • 6. www.fromdual.com 6 / 30 Index technisch gesehen MyISAM InnoDB
  • 7. www.fromdual.com 7 / 30 MySQL nutzt Indizes: ● Um Eindeutigkeit zu erzwingen (PRIMARY KEY, UNIQUE KEY) ● Um schnell auf Zeilen zuzugreifen und diese zu filtern (WHERE) ● Um Joins schnell auszuführen (JOIN) ● Um MIN() und MAX() Werte schnell zu finden ● Für Sortier- und Gruppier-Operationen (ORDER BY, GROUP BY) ● Um Joins mittels eines Covering Index zu vermeiden ● Um FOREIGN KEY Constraints (FOREIGN KEY) zu erzwingen
  • 8. www.fromdual.com 8 / 30 WHERE Klausel 1 SELECT *   FROM customers  WHERE name = 'FromDual'; SHOW CREATE TABLE customersG CREATE TABLE `customers` (   `customer_id` smallint(5) unsigned , `name` varchar(64) DEFAULT NULL , PRIMARY KEY (`customer_id`) ) EXPLAIN SELECT *   FROM customers  WHERE name = 'FromDual'; +­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­+­­­­­­+­­­­­­­+­­­­­­­­­­­­­+ | table     | type | possible_keys | key  | rows  | Extra       | +­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­+­­­­­­+­­­­­­­+­­­­­­­­­­­­­+ | customers | ALL  | NULL          | NULL | 31978 | Using where | +­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­+­­­­­­+­­­­­­­+­­­­­­­­­­­­­+
  • 9. www.fromdual.com 9 / 30 Wie legt man Indices an? ALTER TABLE … ● ADD PRIMARY KEY (id); ● ADD UNIQUE KEY (uuid); ● ADD FOREIGN KEY (customer_id) REFERENCES customers (customer_id); ● ADD INDEX (last_name, first_name); ● ADD INDEX pre_ind (hash(8)); ● ADD FULLTEXT INDEX (last_name,  first_name);
  • 10. www.fromdual.com 10 / 30 WHERE Klausel 2 ALTER TABLE customers   ADD INDEX (name); CREATE TABLE `customers` (   `customer_id` smallint(5) unsigned , `name` varchar(64) DEFAULT NULL , PRIMARY KEY (`customer_id`) , KEY `name` (`name`) ) +-----------+------+---------------+------+---------+-------+------+ | table | type | possible_keys | key | key_len | ref | rows | +-----------+------+---------------+------+---------+-------+------+ | customers | ref | name | name | 67 | const | 1 | +-----------+------+---------------+------+---------+-------+------+ Verbesserung: 20 ms → 5 ms
  • 11. www.fromdual.com 11 / 30 JOIN Klausel EXPLAIN SELECT *   FROM customers AS c   JOIN orders AS o ON c.customer_id = o.customer_id  WHERE c.name = 'FromDual'; +­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­+­­­­­­+­­­­­­­­­+­­­­­­­+­­­­­­­­­+ | table | type | possible_keys | key  | key_len | ref   | rows    | +­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­+­­­­­­+­­­­­­­­­+­­­­­­­+­­­­­­­­­+ | c     | ref  | PRIMARY,name  | name | 67      | const |       1 | | o     | ALL  | NULL          | NULL | NULL    | NULL  | 1045105 | +­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­+­­­­­­+­­­­­­­­­+­­­­­­­+­­­­­­­­­+ ALTER TABLE orders   ADD INDEX (customer_id); +-------+------+---------------+-------------+---------+---------------+------+ | table | type | possible_keys | key | key_len | ref | rows | +-------+------+---------------+-------------+---------+---------------+------+ | c | ref | PRIMARY,name | name | 67 | const | 1 | | o | ref | customer_id | customer_id | 3 | c.customer_id | 8 | +-------+------+---------------+-------------+---------+---------------+------+ Verbesserung: 450 ms → 6 ms
  • 12. www.fromdual.com 12 / 30 Tabellen sortieren oder gruppieren EXPLAIN SELECT *   FROM contacts AS c  WHERE last_name = 'Sennhauser'  ORDER BY last_name, first_name; +­­­­­­­+­­­­­­+­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | table | type | key       | rows | Extra                                              | +­­­­­­­+­­­­­­+­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | c     | ref  | last_name | 1561 | Using index condition; Using where; Using filesort | +­­­­­­­+­­­­­­+­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ ORDER BY, GROUP BY ALTER TABLE contacts   ADD INDEX (last_name, first_name); +­­­­­­­+­­­­­­+­­­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­+ | table | type | key         | rows | Extra                    | +­­­­­­­+­­­­­­+­­­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­+ | c     | ref  | last_name_2 | 1561 | Using where; Using index | +­­­­­­­+­­­­­­+­­­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­+ Verbesserung : 20 ms → 7 ms
  • 13. www.fromdual.com 13 / 30 Covering Indices EXPLAIN SELECT customer_id, amount   FROM orders AS o  WHERE customer_id = 59349; +­­­­­­­+­­­­­­+­­­­­­­­­­­­­+­­­­­­+­­­­­­­+ | table | type | key         | rows | Extra | +­­­­­­­+­­­­­­+­­­­­­­­­­­­­+­­­­­­+­­­­­­­+ | o     | ref  | customer_id |   15 | NULL  | +­­­­­­­+­­­­­­+­­­­­­­­­­­­­+­­­­­­+­­­­­­­+ ALTER TABLE orders   ADD INDEX (customer_id, amount); +­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­+ | table | type | key           | rows | Extra       | +­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­+ | o     | ref  | customer_id_2 |   15 | Using index | +­­­­­­­+­­­­­­+­­­­­­­­­­­­­­­+­­­­­­+­­­­­­­­­­­­­+ Und jetzt?
  • 14. www.fromdual.com 14 / 30 Vorteil von Covering Indices ● Warum sind Covering Indices vorteilhaft? ohne mit
  • 15. www.fromdual.com 15 / 30 Finden von fehlenden Indices ● ER Diagramm? :-( ● Hängt hauptsächlich von der Business Logik ab... ● Wie FINDET man sie? --> Slow Query Log ● MySQL Variablen: ● Seit v5.1 on-line! +-------------------------------+----------+ | Variable_name | Value | +-------------------------------+----------+ | log_queries_not_using_indexes | ON | | long_query_time | 0.250000 | | min_examined_row_limit | 100 | | slow_query_log | ON | | slow_query_log_file | slow.log | +-------------------------------+----------+
  • 16. www.fromdual.com 16 / 30 Indices sind nicht nur gut! ● Indices brauchen Platz (Platte, heisse Daten im RAM!) ● Indices brauchen Zeit für Wartung (CPU, RAM, I/O) ● Optimizer braucht Zeit um herauszufinden, welchen Index er nehmen soll. ● Manchmal ist der Optimizer völlig verwirrt und trifft eine falsche Entscheidung wenn zu viele (ähnliche) Indices vorhanden sind. → Es gilt die richtige Balance für schnelle Abfragen und optimalen Indices zu finden.
  • 17. www.fromdual.com 17 / 30 Kleiner Index – schnelle Abfrage ● Passt besser in RAM (weniger I/O) ● Höhere Datendichte (Rows/Block) ● Weniger CPU Zyklen ● Prefixed Index: ADD INDEX pre_ind (hash(8));
  • 18. www.fromdual.com 18 / 30 Indices vermeiden ● Vermeide redundante (daher unnötige) Indices ● Wie kann so was passieren? ● Entwickler 1: Kreiert einen Foreign Key Constraint → erledigt ● Entwickler 2: Ouu! Abfrage ist langsam → Oli hat gesagt: Index anlegen → erledigt ● Entwickler 3: Ouu! Anfrage ist langsam → Entwickler 2 ist ein Idiot! → Index anlegen → erledigt ● Frameworks vs. Entwickler ● Upgrade Prozess vs. DevOps ● Vermeide Indexes welche nicht benutz/benötigt werden!
  • 19. www.fromdual.com 19 / 30 Wie findet man solche Indices? SHOW CREATE TABLE ...G mysqldump ­­no­data > structure_dump.sql ● Seit MySQL 5.6: PERFORMANCE_SCHEMA ● Percona Server / MariaDB: Userstats ● http://fromdual.com/mysql-performance-schema-hints SELECT object_schema, object_name, index_name FROM performance_schema.table_io_waits_summary_by_index_usage WHERE index_name IS NOT NULL AND count_star = 0 ORDER BY object_schema, object_name;
  • 20. www.fromdual.com 20 / 30 Vermeide partiell redundante Indices ● INDEX (city, last_name, first_name) ● INDEX (city, last_name) ● INDEX (city) ● INDEX (last_name, city) ● INDEX (first_name, last_name) ??? !!!
  • 21. www.fromdual.com 21 / 30 Schlechte Selektivität ● Weg mit Indices mit schlechter Selektivität (~= geringe Kardinalität) ● Kandidaten sind: ● status ● gender ● active ● Wie findet man ob ein Feld eine schlechte Selektivität hat? Indices (und Joins) sind teuer!!! ● Break-even zwischen 15% und 66% ● Schauen wir mal ob der MySQL Optimizer davon weiss... :-) SELECT status, COUNT(*) FROM orders GROUP BY status; +--------+--------+ | status | cnt | +--------+--------+ | 0 | 393216 | | 1 | 262144 | | 2 | 12 | | 3 | 36 | | 4 | 24 | | 5 | 4 | | 6 | 8 | +--------+--------+
  • 22. www.fromdual.com 22 / 30 Optimizer liegt falsch! SELECT * FROM orders WHERE status = 2; +--------+------+---------------+--------+------+ | table | type | possible_keys | key | rows | +--------+------+---------------+--------+------+ | orders | ref | status | status | 12 | +--------+------+---------------+--------+------+ SELECT * FROM orders WHERE status = 0; 1.43 s +--------+------+---------------+--------+--------+ | table | type | possible_keys | key | rows | +--------+------+---------------+--------+--------+ | orders | ref | status | status | 327469 | +--------+------+---------------+--------+--------+ SELECT * FROM orders IGNORE INDEX (status) WHERE status = 0; 0.44 s +--------+------+---------------+------+--------+ | table | type | possible_keys | key | rows | +--------+------+---------------+------+--------+ | orders | ALL | NULL | NULL | 654939 | +--------+------+---------------+------+--------+ SELECT status, COUNT(*) FROM orders GROUP BY status; +--------+--------+ | status | cnt | +--------+--------+ | 0 | 393216 | | 1 | 262144 | | 2 | 12 | | 3 | 36 | | 4 | 24 | | 5 | 4 | | 6 | 8 | +--------+--------+ 5.6.12 (nach ANALYZE TABLE)
  • 23. www.fromdual.com 23 / 30 InnoDB PK und SK ● InnoDB kennt ● Primary Keys und ● Secondary Keys
  • 24. www.fromdual.com 24 / 30 Geclusterter Index ● InnoDB: Daten = Blätter des Primary Keys ● Heisst auch Index Clustered Table (IOT) → Daten sind sortiert wie PK (Index ist sortiert)! → PK beeinflusst Lokalität der Daten (physische Lage) ● AUTO_INCREMENT ~= Sortieren nach Zeit! ● Gut in vielen Fällen ● Wenn heisse Daten = aktuelle Daten ● Schlecht für Zeitreihen ● Wenn heisse Daten = Daten pro Objekt
  • 25. www.fromdual.com 25 / 30 A_I ts v_id xpos ypos ... Beispiel: InnoDB    1 17:30 #42 x, y, ...    2 17:30 #43 x, y, ...    3 17:30 #44 x, y, ... 2001 17:32 #42 x, y, ... 2002 17:32 #43 x, y, ... 2003 17:32 #44 x, y, ... ... #42 alle 2' die letzten 3 Tage Q1: Δ in Zeilen? A1: 1 Zeile ~ 100 byte Q2: Δ in bytes? Q3: Default InnoDB block size? Q4: Avg. # Zeilen von LKW #42 in 1 InnoDB block? A2: 3 d und 720 pt/d → ~2000 pt ~ 2000 rec ~ 2000 blk Q5: Wie lange dauert das und warum (32 Mbyte)? ~ 2000 IOPS ~ 10s random read!!! S: Alles im RAM oder starkes I/O-System oder …? ~ 2000 Zeilen ~ 200 kbyte default: 16 kbyte ~ 1 2000 LKWs
  • 26. www.fromdual.com 26 / 30 ts v_id xpos ypos ... Geclusterter PK rettet den Tag! 17:30 #42 x, y, ... 17:32 #42 x, y, ... 17:34 #42 x, y, ... 17:30 #43 x, y, ... 17:32 #43 x, y, ... 17:34 #43 x, y, ... ... #42 alle 2' die letzten 3 Tage Q1: Avg. # Zeilen von LKW #42 in 1 InnoDB block? A1: 3 d und 720 pt/d → ~2000 pt ~ 2000 rec ~ 20 blk Q2: Wie lange dauert das und warum (320 kbyte)? ~ 1-2 IOPS ~ 10-20 ms sequential read! S: Wow f=50 schneller! Nachteile? ~ 120 2000 LKWs 17:30 #44 x, y, ... ...
  • 27. www.fromdual.com 27 / 30 Index Hints ● MySQL Optimizer liegt manchmal falsch! ● Wir müssen ihm nachhelfen... ● Index Hints (Hinweise) sind: ● USE INDEX (ind1, ind2) ● Schau nur diese Indices an... ● FORCE INDEX (ind3) ● Nimm diesen Index ohne weiter nachzudenken ● IGNORE INDEX (ind1, ind3) ● Schau Dir alle Indices ausser diese an ● Hints nur als allerletzte Rettung verwenden!
  • 28. www.fromdual.com 28 / 30 MySQL Variablen ● MySQL Variablen welche Indices beeinflussen ● MyISAM: key_buffer_size ● InnoDB: innodb_buffer_pool_size ● InnoDB Change Buffer ● innodb_change_buffer_max_size ● innodb_change_buffering ● Adaptive Hash Index (AHI) ● MySQL 5.6.3 / 5.5.14 Indexlänge 767 → 3072 bytes ● innodb_large_prefix
  • 29. www.fromdual.com 29 / 30 Wir suchen noch: ● Datenbank Enthusiast/in für Support / remote-DBA / Beratung
  • 30. www.fromdual.com 30 / 30 Q & A Fragen ? Diskussion? Anschliessend ist noch Zeit für ein persönliches Gespräch... ● FromDual bietet neutral und unabhängig: ● MySQL Beratung ● Remote-DBA ● Support für MySQL, Galera Cluster, MariaDB und Percona Server ● MySQL Schulung www.fromdual.com/presentations