You are here

Feed aggregator

Why you should take care of MySQL data types

Shinguz - Wed, 2016-05-25 11:42

A customer reported last month that MySQL does a full table scan (FTS) if a query was filtered by a INT value on a VARCHAR column. First I told him that this is not true any more because MySQL has fixed this behaviour long time ago. He showed me that I was wrong:

CREATE TABLE `test` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `data` varchar(64) DEFAULT NULL, `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `data` (`data`) ) ENGINE=InnoDB; EXPLAIN SELECT * FROM test WHERE data = 42\G *************************** 1. row *************************** id: 1 select_type: SIMPLE table: test partitions: NULL type: ALL possible_keys: data key: NULL key_len: NULL ref: NULL rows: 522500 filtered: 10.00 Extra: Using where EXPLAIN SELECT * FROM test WHERE data = '42'\G *************************** 1. row *************************** id: 1 select_type: SIMPLE table: test partitions: NULL type: ref possible_keys: data key: data key_len: 67 ref: const rows: 1 filtered: 100.00 Extra: NULL

When I executed the query I got some more interesting information:

SELECT * FROM test WHERE data = '42'; Empty set (0.00 sec) SELECT * FROM test WHERE data = 42; +--------+----------------------------------+---------------------+ | id | data | ts | +--------+----------------------------------+---------------------+ | 1096 | 42a5cb4a3e76857a3efe7af44ba9f4dd | 2016-05-25 10:26:59 | ... | 718989 | 42a1921fb2df42126d85f9586532eda4 | 2016-05-25 10:27:12 | +--------+----------------------------------+---------------------+ 767 rows in set, 65535 warnings (0.26 sec)

Looking at the warnings we also find the reason: MySQL does the cast on the column and not on the value which is a bit odd IMHO:

show warnings; | Warning | 1292 | Truncated incorrect DOUBLE value: '80f52706c2f9de40472ec29a7f70c992' |

A bit suspicious I looked at the warnings of the query execution plan again:

show warnings; +---------+------+---------------------------------------------------------------------------------------------+ | Level | Code | Message | +---------+------+---------------------------------------------------------------------------------------------+ | Warning | 1739 | Cannot use ref access on index 'data' due to type or collation conversion on field 'data' | | Warning | 1739 | Cannot use range access on index 'data' due to type or collation conversion on field 'data' | +---------+------+---------------------------------------------------------------------------------------------+

I thought this was fixed, but it seems not. The following releases behave like this: MySQL 5.0.96, 5.1.73, 5.5.38, 5.6.25, 5.7.12 and MariaDB 5.5.41, 10.0.21 and 10.1.9

The other way around it seems to work in both cases:

SELECT * FROM test WHERE id = 42; +----+----------------------------------+---------------------+ | id | data | ts | +----+----------------------------------+---------------------+ | 42 | 81d74057d7be8f20563da404bb1b3ab0 | 2016-05-25 10:26:56 | +----+----------------------------------+---------------------+ SELECT * FROM test WHERE id = '42'; +----+----------------------------------+---------------------+ | id | data | ts | +----+----------------------------------+---------------------+ | 42 | 81d74057d7be8f20563da404bb1b3ab0 | 2016-05-25 10:26:56 | +----+----------------------------------+---------------------+ EXPLAIN SELECT * FROM test WHERE id = 42\G *************************** 1. row *************************** id: 1 select_type: SIMPLE table: test partitions: NULL type: const possible_keys: PRIMARY key: PRIMARY key_len: 4 ref: const rows: 1 filtered: 100.00 Extra: NULL
Taxonomy upgrade extras: query tuningexplaindata typesql

DOAG Datenbank Konferenz 2016

Oli Sennhauser - Tue, 2016-05-10 19:43

Heute war ich auf der DOAG Datenbank 2016 Konferenz in Düsseldorf. Der einzige Vortrag zum Thema MySQL war mein eigener: MySQL für Oracle DBAs. Daher hatte ich die Möglichkeit wieder mal etwas über den Zaun zu linsen. Hier meine Notizen:

Oracle Database in-Memory - What's new and what's comming

Von Andy Rivenes, Senior Principal Product Manager, Oracle Corporation

  • Ist NICHT eine one size fits all Lösung.
  • Für Analytics-Abfragen (DWH, Datamart, BI).
  • Beschleunigt OLTP Workload NICHT.
  • Ist ein Column-Store.
  • In-Memory heisst: weiteren Cache (RAM). Mehr Speicher (RAM) hinzufügen. Column-Store Size. Daten werden partiell doppelt vorgehalten.
  • Beide Formate Row und Column sind vorhanden.
  • Optimizer entscheidet ob Row-Store oder Column-Store verwendet wird.
  • Wird vom DBA pro Tabelle, Partition, Subpartition oder Materialized View festgelegt. 2 - 20 x Kompression.
  • Column-Store wird on demand aufgebaut. Wenn nicht verfügbar, fallback auf Row-Store.
  • Column-Store Advisor.
  • Jeder Core scannt eine Spalte aus dem Column-Store.
  • Geschwindigkeit: Mia rows/s. Wenn man bedenkt, dass ein Core nur ca. 3 Mia CPU Zyklen pro Sekunde hat, frage ich mich, wie das gerechnet wird...
  • Eliminiere Indices und nutze Column-Store für grosse OLAP Tabellen.
  • Schreiben ist langsam. Wie kriegt man denn die Daten schnell in die DB bei grossen Datenmengen?
  • Scale-out und Scale-Up: Parallelisieren über mehrere Server hinweg.
  • Spiegeln von Duplikaten über Server hinweg. Somit können Joins lokal gemacht werden.
  • In-Memory Workload on (Oracle) Chips möglich: DAX, Database Accelleration Engine.
  • JSON BLOB.
  • Heatmap: Schlaue Guestimates (in der Zukunft).
  • When not to use Oracle in-Memory Database: Siehe Slides.

Die Folien muss ich mir noch organisieren. Klingt total cool. Ich frage mich nur, wie gross/breit ist dieser Anwendungsfall? Ich werde mich wohl bald mal mit dem MariaDB Column Store befassen müssen/wollen.

Oracle ACFS / CloudFS zuverlässig nutzbar?

Ralf Appelbaum und Claudia Gabriel, TEAM GmbH

  • CFS im ASM
  • ACFS = ASM CFS
  • für RAC
  • ASM ~ LVM
  • TS im ASM (somit erinnert mich das ein bissen an etwas clevere Raw-Devices).
  • Backup, Dumps, etc. ins ACFS. Somit sind sie O/S sichtbar und zugreifbar.
  • Fazit war: Nein, ist es nicht!

Ich frage mich nur, warum, man sich das antun will...? Das ist nur wieder ein neues proprietäres Feature, welches nicht KISS ist!

Datenbanken in der Oracle Cloud - Überblick und Best Practices

Manuel Hossfeld, Oracle Deutschland B.V. & Co KG

  • Oracle Cloud ist eine Public Cloud.
  • Arbeitet nur mit ssh Keys.
  • SQL*Net über ssh-Tunnel. Will man das? Kann den SQL*Net kein SSL???
  • Keine Hybrid-Cloud damit machen!
  • Managed MySQL in der Oracle Cloud ist immer noch nicht vorgesehen.
  • Einsatzgebiete: Er sprach nie von produktiver Nutzung...

Wozu braucht man das?

cgroups im Einsatz - Ressource Management mal anders rum

Florian Feicht, Trivadis GmbH

  • Oracle selber scheint das vorzusehen. Siehe Oracle Dokumentation.
  • systemd-cgtop
  • systemd-cgls
  • Oracle init.ora Parameter processor_group_name
  • systemd/code> service!
  • Oracle schreibt ins Alert Log, wenn es nicht klappt. Die Oracle Oracle Instanz fährt nicht hoch, wenn man die Cgroup nicht angelegt hat.

Die Oracle Cracks fanden das cool, hatten aber einige Bedenken (betreffen Optimizer und so). MyEnv für MySQL und MariaDB kann das schon seit Oktober 2014. Wir sind also gut vorn mit dabei.

Taxonomy upgrade extras: mysqlOraclein-memorymemorycgroups

DOAG Datenbank Konferenz 2016

Oli Sennhauser - Tue, 2016-05-10 19:43

Heute war ich auf der DOAG Datenbank 2016 Konferenz in Düsseldorf. Der einzige Vortrag zum Thema MySQL war mein eigener: MySQL für Oracle DBAs. Daher hatte ich die Möglichkeit wieder mal etwas über den Zaun zu linsen. Hier meine Notizen:

Oracle Database in-Memory - What's new and what's comming

Von Andy Rivenes, Senior Principal Product Manager, Oracle Corporation

  • Ist NICHT eine one size fits all Lösung.
  • Für Analytics-Abfragen (DWH, Datamart, BI).
  • Beschleunigt OLTP Workload NICHT.
  • Ist ein Column-Store.
  • In-Memory heisst: weiteren Cache (RAM). Mehr Speicher (RAM) hinzufügen. Column-Store Size. Daten werden partiell doppelt vorgehalten.
  • Beide Formate Row und Column sind vorhanden.
  • Optimizer entscheidet ob Row-Store oder Column-Store verwendet wird.
  • Wird vom DBA pro Tabelle, Partition, Subpartition oder Materialized View festgelegt. 2 - 20 x Kompression.
  • Column-Store wird on demand aufgebaut. Wenn nicht verfügbar, fallback auf Row-Store.
  • Column-Store Advisor.
  • Jeder Core scannt eine Spalte aus dem Column-Store.
  • Geschwindigkeit: Mia rows/s. Wenn man bedenkt, dass ein Core nur ca. 3 Mia CPU Zyklen pro Sekunde hat, frage ich mich, wie das gerechnet wird...
  • Eliminiere Indices und nutze Column-Store für grosse OLAP Tabellen.
  • Schreiben ist langsam. Wie kriegt man denn die Daten schnell in die DB bei grossen Datenmengen?
  • Scale-out und Scale-Up: Parallelisieren über mehrere Server hinweg.
  • Spiegeln von Duplikaten über Server hinweg. Somit können Joins lokal gemacht werden.
  • In-Memory Workload on (Oracle) Chips möglich: DAX, Database Accelleration Engine.
  • JSON BLOB.
  • Heatmap: Schlaue Guestimates (in der Zukunft).
  • When not to use Oracle in-Memory Database: Siehe Slides.

Die Folien muss ich mir noch organisieren. Klingt total cool. Ich frage mich nur, wie gross/breit ist dieser Anwendungsfall? Ich werde mich wohl bald mal mit dem MariaDB Column Store befassen müssen/wollen.

Oracle ACFS / CloudFS zuverlässig nutzbar?

Ralf Appelbaum und Claudia Gabriel, TEAM GmbH

  • CFS im ASM
  • ACFS = ASM CFS
  • für RAC
  • ASM ~ LVM
  • TS im ASM (somit erinnert mich das ein bissen an etwas clevere Raw-Devices).
  • Backup, Dumps, etc. ins ACFS. Somit sind sie O/S sichtbar und zugreifbar.
  • Fazit war: Nein, ist es nicht!

Ich frage mich nur, warum, man sich das antun will...? Das ist nur wieder ein neues proprietäres Feature, welches nicht KISS ist!

Datenbanken in der Oracle Cloud - Überblick und Best Practices

Manuel Hossfeld, Oracle Deutschland B.V. & Co KG

  • Oracle Cloud ist eine Public Cloud.
  • Arbeitet nur mit ssh Keys.
  • SQL*Net über ssh-Tunnel. Will man das? Kann den SQL*Net kein SSL???
  • Keine Hybrid-Cloud damit machen!
  • Managed MySQL in der Oracle Cloud ist immer noch nicht vorgesehen.
  • Einsatzgebiete: Er sprach nie von produktiver Nutzung...

Wozu braucht man das?

cgroups im Einsatz - Ressource Management mal anders rum

Florian Feicht, Trivadis GmbH

  • Oracle selber scheint das vorzusehen. Siehe Oracle Dokumentation.
  • systemd-cgtop
  • systemd-cgls
  • Oracle init.ora Parameter processor_group_name
  • systemd/code> service!
  • Oracle schreibt ins Alert Log, wenn es nicht klappt. Die Oracle Oracle Instanz fährt nicht hoch, wenn man die Cgroup nicht angelegt hat.

Die Oracle Cracks fanden das cool, hatten aber einige Bedenken (betreffen Optimizer und so). MyEnv für MySQL und MariaDB kann das schon seit Oktober 2014. Wir sind also gut vorn mit dabei.

Taxonomy upgrade extras: mysqlOraclein-memorymemorycgroups

DOAG Datenbank Konferenz 2016

Oli Sennhauser - Tue, 2016-05-10 19:43

Heute war ich auf der DOAG Datenbank 2016 Konferenz in Düsseldorf. Der einzige Vortrag zum Thema MySQL war mein eigener: MySQL für Oracle DBAs. Daher hatte ich die Möglichkeit wieder mal etwas über den Zaun zu linsen. Hier meine Notizen:

Oracle Database in-Memory - What's new and what's comming

Von Andy Rivenes, Senior Principal Product Manager, Oracle Corporation

  • Ist NICHT eine one size fits all Lösung.
  • Für Analytics-Abfragen (DWH, Datamart, BI).
  • Beschleunigt OLTP Workload NICHT.
  • Ist ein Column-Store.
  • In-Memory heisst: weiteren Cache (RAM). Mehr Speicher (RAM) hinzufügen. Column-Store Size. Daten werden partiell doppelt vorgehalten.
  • Beide Formate Row und Column sind vorhanden.
  • Optimizer entscheidet ob Row-Store oder Column-Store verwendet wird.
  • Wird vom DBA pro Tabelle, Partition, Subpartition oder Materialized View festgelegt. 2 - 20 x Kompression.
  • Column-Store wird on demand aufgebaut. Wenn nicht verfügbar, fallback auf Row-Store.
  • Column-Store Advisor.
  • Jeder Core scannt eine Spalte aus dem Column-Store.
  • Geschwindigkeit: Mia rows/s. Wenn man bedenkt, dass ein Core nur ca. 3 Mia CPU Zyklen pro Sekunde hat, frage ich mich, wie das gerechnet wird...
  • Eliminiere Indices und nutze Column-Store für grosse OLAP Tabellen.
  • Schreiben ist langsam. Wie kriegt man denn die Daten schnell in die DB bei grossen Datenmengen?
  • Scale-out und Scale-Up: Parallelisieren über mehrere Server hinweg.
  • Spiegeln von Duplikaten über Server hinweg. Somit können Joins lokal gemacht werden.
  • In-Memory Workload on (Oracle) Chips möglich: DAX, Database Accelleration Engine.
  • JSON BLOB.
  • Heatmap: Schlaue Guestimates (in der Zukunft).
  • When not to use Oracle in-Memory Database: Siehe Slides.

Die Folien muss ich mir noch organisieren. Klingt total cool. Ich frage mich nur, wie gross/breit ist dieser Anwendungsfall? Ich werde mich wohl bald mal mit dem MariaDB Column Store befassen müssen/wollen.

Oracle ACFS / CloudFS zuverlässig nutzbar?

Ralf Appelbaum und Claudia Gabriel, TEAM GmbH

  • CFS im ASM
  • ACFS = ASM CFS
  • für RAC
  • ASM ~ LVM
  • TS im ASM (somit erinnert mich das ein bissen an etwas clevere Raw-Devices).
  • Backup, Dumps, etc. ins ACFS. Somit sind sie O/S sichtbar und zugreifbar.
  • Fazit war: Nein, ist es nicht!

Ich frage mich nur, warum, man sich das antun will...? Das ist nur wieder ein neues proprietäres Feature, welches nicht KISS ist!

Datenbanken in der Oracle Cloud - Überblick und Best Practices

Manuel Hossfeld, Oracle Deutschland B.V. & Co KG

  • Oracle Cloud ist eine Public Cloud.
  • Arbeitet nur mit ssh Keys.
  • SQL*Net über ssh-Tunnel. Will man das? Kann den SQL*Net kein SSL???
  • Keine Hybrid-Cloud damit machen!
  • Managed MySQL in der Oracle Cloud ist immer noch nicht vorgesehen.
  • Einsatzgebiete: Er sprach nie von produktiver Nutzung...

Wozu braucht man das?

cgroups im Einsatz - Ressource Management mal anders rum

Florian Feicht, Trivadis GmbH

  • Oracle selber scheint das vorzusehen. Siehe Oracle Dokumentation.
  • systemd-cgtop
  • systemd-cgls
  • Oracle init.ora Parameter processor_group_name
  • systemd/code> service!
  • Oracle schreibt ins Alert Log, wenn es nicht klappt. Die Oracle Oracle Instanz fährt nicht hoch, wenn man die Cgroup nicht angelegt hat.

Die Oracle Cracks fanden das cool, hatten aber einige Bedenken (betreffen Optimizer und so). MyEnv für MySQL und MariaDB kann das schon seit Oktober 2014. Wir sind also gut vorn mit dabei.

Taxonomy upgrade extras: mysqlOraclein-memorymemorycgroups

How to become a certified DBA

Cédric Bruderer - Tue, 2016-05-10 10:16

I recently managed to get my certification as MySQL 5.6 DBA, and was asked to write a blog about it, because I had trouble getting the informations I needed.

You may have figured out too, that Oracle does not really supply you with information about the certification. At least, there is the MySQL documentation. It contains all the information you need.

Further, I recommend to use a virtual linux machine in combination with our tool MyEnv. This way you can simulate multiple scenarios, including replication set-ups, and if one or two servers die during your exercises, nobody gets mad at you.

When learning, make sure to have a look at the following topics:

  • Query tuning
  • Parameters tuning
  • MySQL client tools (mysqldump, mysqladmin, ...)
  • MySQL Audit Plugin
  • How to secure MySQL (Especially, the correct assignment of privileges.)
  • How to use the Performance and Information Schema
  • Partitions
  • Replication
  • Backup and Recovery (Both, physical and logical variant.)


The certification takes 150 minutes and contains 100 questions. 60% of your answers have to be correct, in order to pass. If you keep a pace of one answer per minute, you will also have enough time to go over those answers you were not entirely sure at the first time.

How to become a certified DBA

Cédric Bruderer - Tue, 2016-05-10 10:16

I recently managed to get my certification as MySQL 5.6 DBA, and was asked to write a blog about it, because I had trouble getting the informations I needed.

You may have figured out too, that Oracle does not really supply you with information about the certification. At least, there is the MySQL documentation. It contains all the information you need.

Further, I recommend to use a virtual linux machine in combination with our tool MyEnv. This way you can simulate multiple scenarios, including replication set-ups, and if one or two servers die during your exercises, nobody gets mad at you.

When learning, make sure to have a look at the following topics:

  • Query tuning
  • Parameters tuning
  • MySQL client tools (mysqldump, mysqladmin, ...)
  • MySQL Audit Plugin
  • How to secure MySQL (Especially, the correct assignment of privileges.)
  • How to use the Performance and Information Schema
  • Partitions
  • Replication
  • Backup and Recovery (Both, physical and logical variant.)


The certification takes 150 minutes and contains 100 questions. 60% of your answers have to be correct, in order to pass. If you keep a pace of one answer per minute, you will also have enough time to go over those answers you were not entirely sure at the first time.

How to become a certified DBA

Cédric Bruderer - Tue, 2016-05-10 10:16

I recently managed to get my certification as MySQL 5.6 DBA, and was asked to write a blog about it, because I had trouble getting the informations I needed.

You may have figured out too, that Oracle does not really supply you with information about the certification. At least, there is the MySQL documentation. It contains all the information you need.

Further, I recommend to use a virtual linux machine in combination with our tool MyEnv. This way you can simulate multiple scenarios, including replication set-ups, and if one or two servers die during your exercises, nobody gets mad at you.

When learning, make sure to have a look at the following topics:

  • Query tuning
  • Parameters tuning
  • MySQL client tools (mysqldump, mysqladmin, ...)
  • MySQL Audit Plugin
  • How to secure MySQL (Especially, the correct assignment of privileges.)
  • How to use the Performance and Information Schema
  • Partitions
  • Replication
  • Backup and Recovery (Both, physical and logical variant.)


The certification takes 150 minutes and contains 100 questions. 60% of your answers have to be correct, in order to pass. If you keep a pace of one answer per minute, you will also have enough time to go over those answers you were not entirely sure at the first time.

MariaDB 10.2 Window Function Examples

Shinguz - Mon, 2016-04-18 22:39

MariaDB 10.2 has introduced some Window Functions for analytical queries.

See also: Window Functions, Window Functions, Window function and Rows and Range, Preceding and Following

Function ROW_NUMBER()

Simulate a row number (sequence) top 3

SELECT ROW_NUMBER() OVER (PARTITION BY NULL ORDER BY category_id) AS num , category.category_id FROM category LIMIT 3 ;

or

SELECT ROW_NUMBER() OVER (ORDER BY category_id) AS num , category.category_id FROM category LIMIT 3 ; +-----+-------------+ | num | category_id | +-----+-------------+ | 1 | ACTUAL | | 2 | ADJUSTMENT | | 3 | BUDGET | +-----+-------------+
ROW_NUMBER() per PARTITION SELECT ROW_NUMBER() OVER (PARTITION BY store_type ORDER BY SUM(sf.store_sales) DESC) AS Nbr , s.store_type AS "Store Type", s.store_city AS City, SUM(sf.store_sales) AS Sales FROM store AS s JOIN sales_fact AS sf ON sf.store_id = s.store_id GROUP BY s.store_type, s.store_city ORDER BY s.store_type, Rank ; +-----+---------------------+---------------+------------+ | Nbr | Store Type | City | Sales | +-----+---------------------+---------------+------------+ | 1 | Deluxe Supermarket | Salem | 1091274.68 | | 2 | Deluxe Supermarket | Tacoma | 993823.44 | | 3 | Deluxe Supermarket | Hidalgo | 557076.84 | | 4 | Deluxe Supermarket | Merida | 548297.64 | | 5 | Deluxe Supermarket | Vancouver | 534180.96 | | 6 | Deluxe Supermarket | San Andres | 518044.80 | | 1 | Gourmet Supermarket | Beverly Hills | 619013.24 | | 2 | Gourmet Supermarket | Camacho | 357772.88 | | 1 | Mid-Size Grocery | Yakima | 304590.92 | | 2 | Mid-Size Grocery | Mexico City | 166503.48 | | 3 | Mid-Size Grocery | Victoria | 144827.48 | | 4 | Mid-Size Grocery | Hidalgo | 144272.84 | +-----+---------------------+---------------+------------+
Function RANK()

Ranking of top 10 salaries

SELECT full_name AS Name, salary AS Salary , RANK() OVER(ORDER BY salary DESC) AS Rank FROM employee ORDER BY salary DESC LIMIT 10 ; +-----------------+----------+------+ | Name | Salary | Rank | +-----------------+----------+------+ | Sheri Nowmer | 80000.00 | 1 | | Darren Stanz | 50000.00 | 2 | | Donna Arnold | 45000.00 | 3 | | Derrick Whelply | 40000.00 | 4 | | Michael Spence | 40000.00 | 4 | | Maya Gutierrez | 35000.00 | 6 | | Pedro Castillo | 35000.00 | 6 | | Laurie Borges | 35000.00 | 6 | | Beverly Baker | 30000.00 | 9 | | Roberta Damstra | 25000.00 | 10 | +-----------------+----------+------+
Function DENSE_RANK() SELECT full_name AS Name, salary AS Salary , DENSE_RANK() OVER(ORDER BY salary DESC) AS Rank FROM employee ORDER BY salary DESC LIMIT 10 ; +-----------------+----------+------+ | Name | Salary | Rank | +-----------------+----------+------+ | Sheri Nowmer | 80000.00 | 1 | | Darren Stanz | 50000.00 | 2 | | Donna Arnold | 45000.00 | 3 | | Derrick Whelply | 40000.00 | 4 | | Michael Spence | 40000.00 | 4 | | Maya Gutierrez | 35000.00 | 5 | | Pedro Castillo | 35000.00 | 5 | | Laurie Borges | 35000.00 | 5 | | Beverly Baker | 30000.00 | 6 | | Roberta Damstra | 25000.00 | 7 | +-----------------+----------+------+
Aggregation Windows SELECT full_name AS Name, salary AS Salary , SUM(salary) OVER(ORDER BY salary DESC) AS "Sum sal" FROM employee ORDER BY salary DESC LIMIT 10 ; +-----------------+----------+-----------+ | Name | Salary | Sum sal | +-----------------+----------+-----------+ | Sheri Nowmer | 80000.00 | 80000.00 | | Darren Stanz | 50000.00 | 130000.00 | | Donna Arnold | 45000.00 | 175000.00 | | Derrick Whelply | 40000.00 | 255000.00 | | Michael Spence | 40000.00 | 255000.00 | | Laurie Borges | 35000.00 | 360000.00 | | Maya Gutierrez | 35000.00 | 360000.00 | | Pedro Castillo | 35000.00 | 360000.00 | | Beverly Baker | 30000.00 | 390000.00 | | Roberta Damstra | 25000.00 | 415000.00 | +-----------------+----------+-----------+
Function CUME_DIST() and PERCENT_RANK() SELECT s.store_state AS State, s.store_city AS City, SUM(e.salary) AS Salary , CUME_DIST() OVER (PARTITION BY State ORDER BY Salary) AS CumeDist , PERCENT_RANK() OVER (PARTITION BY State ORDER BY Salary) AS PctRank FROM employee AS e JOIN store AS s on s.store_id = e.store_id WHERE s.store_country = 'USA' GROUP BY s.store_name ORDER BY s.store_state, Salary DESC ; +-------+---------------+-----------+--------------+--------------+ | State | City | Salary | CumeDist | PctRank | +-------+---------------+-----------+--------------+--------------+ | CA | Alameda | 537000.00 | 1.0000000000 | 1.0000000000 | | CA | Los Angeles | 221200.00 | 0.8000000000 | 0.7500000000 | | CA | San Diego | 220200.00 | 0.6000000000 | 0.5000000000 | | CA | Beverly Hills | 191800.00 | 0.4000000000 | 0.2500000000 | | CA | San Francisco | 30520.00 | 0.2000000000 | 0.0000000000 | | OR | Salem | 260220.00 | 1.0000000000 | 1.0000000000 | | OR | Portland | 221200.00 | 0.5000000000 | 0.0000000000 | | WA | Tacoma | 260220.00 | 1.0000000000 | 1.0000000000 | | WA | Spokane | 223200.00 | 0.8571428571 | 0.8333333333 | | WA | Bremerton | 221200.00 | 0.7142857143 | 0.6666666667 | | WA | Seattle | 220200.00 | 0.5714285714 | 0.5000000000 | | WA | Yakima | 74060.00 | 0.4285714286 | 0.3333333333 | | WA | Bellingham | 23220.00 | 0.2857142857 | 0.1666666667 | | WA | Walla Walla | 21320.00 | 0.1428571429 | 0.0000000000 | +-------+---------------+-----------+--------------+--------------+
Function NTILE() SELECT promotion_name, media_type , TO_DAYS(end_date)-TO_DAYS(start_date) AS Duration , NTILE(4) OVER (PARTITION BY promotion_name ORDER BY DURATION) AS quartile , NTILE(5) OVER (PARTITION BY promotion_name ORDER BY DURATION) AS quintile , NTILE(100) OVER (PARTITION BY promotion_name ORDER BY DURATION) AS precentile FROM promotion WHERE promotion_name = 'Weekend Markdown' LIMIT 10 ; +------------------+-------------------------+----------+----------+----------+------------+ | promotion_name | media_type | Duration | quartile | quintile | precentile | +------------------+-------------------------+----------+----------+----------+------------+ | Weekend Markdown | In-Store Coupon | 2 | 1 | 1 | 9 | | Weekend Markdown | Daily Paper | 3 | 3 | 4 | 29 | | Weekend Markdown | Radio | 3 | 4 | 4 | 36 | | Weekend Markdown | Daily Paper, Radio | 2 | 2 | 2 | 13 | | Weekend Markdown | Daily Paper, Radio, TV | 2 | 2 | 3 | 20 | | Weekend Markdown | TV | 2 | 3 | 3 | 26 | | Weekend Markdown | Sunday Paper | 3 | 3 | 4 | 28 | | Weekend Markdown | Daily Paper, Radio, TV | 3 | 3 | 4 | 34 | | Weekend Markdown | Daily Paper | 2 | 1 | 2 | 10 | | Weekend Markdown | Street Handout | 2 | 2 | 2 | 18 | | Weekend Markdown | Bulk Mail | 3 | 4 | 5 | 37 | | Weekend Markdown | Cash Register Handout | 2 | 2 | 2 | 14 | | Weekend Markdown | Daily Paper, Radio, TV | 3 | 3 | 4 | 31 | | Weekend Markdown | Sunday Paper | 2 | 3 | 3 | 27 | | Weekend Markdown | Sunday Paper, Radio, TV | 1 | 1 | 1 | 4 | +------------------+-------------------------+----------+----------+----------+------------+
Taxonomy upgrade extras: mariadbdwhreportingAnalyticsWindow FunctionOLAPData Mart

Define preferred SST donor for Galera Cluster

Cédric Bruderer - Fri, 2016-04-15 18:00

One of our customers recently ran into a problem, where he wanted to have a preferred donor for SST, whenever a node came up. The problem was, that the node did not come up, when the preferred donor was not running.

In the documentation, you can find the parameter wsrep_sst_donor, which prefers the specified node as SST donor. This is great, as long as the donor is actually running.

The problem can be fixed by adding a comma to the end of the value of wsrep_sst_donor, what would look like this:

wsrep_sst_donor="galera2,"

Note the comma at the end of the value. This trailing comma basically tells this node, that galera2 is the preferred donor, if galera2 is not available, any other available node will be used as donor.

You could also specify a secondary node, which is needed to be available for the node to come up:

wsrep_sst_donor="galera2,galera1"

In this case, galera1 wil be used as secondary donor if galera2 is not available. If both are not available, the node will refuse to come up.

Taxonomy upgrade extras: Galera Cluster

Define preferred SST donor for Galera Cluster

Cédric Bruderer - Fri, 2016-04-15 18:00

One of our customers recently ran into a problem, where he wanted to have a preferred donor for SST, whenever a node came up. The problem was, that the node did not come up, when the preferred donor was not running.

In the documentation, you can find the parameter wsrep_sst_donor, which prefers the specified node as SST donor. This is great, as long as the donor is actually running.

The problem can be fixed by adding a comma to the end of the value of wsrep_sst_donor, what would look like this:

wsrep_sst_donor="galera2,"

Note the comma at the end of the value. This trailing comma basically tells this node, that galera2 is the preferred donor, if galera2 is not available, any other available node will be used as donor.

You could also specify a secondary node, which is needed to be available for the node to come up:

wsrep_sst_donor="galera2,galera1"

In this case, galera1 wil be used as secondary donor if galera2 is not available. If both are not available, the node will refuse to come up.

Taxonomy upgrade extras: Galera Cluster

Define preferred SST donor for Galera Cluster

Cédric Bruderer - Fri, 2016-04-15 18:00

One of our customers recently ran into a problem, where he wanted to have a preferred donor for SST, whenever a node came up. The problem was, that the node did not come up, when the preferred donor was not running.

In the documentation, you can find the parameter wsrep_sst_donor, which prefers the specified node as SST donor. This is great, as long as the donor is actually running.

The problem can be fixed by adding a comma to the end of the value of wsrep_sst_donor, what would look like this:

wsrep_sst_donor="galera2,"

Note the comma at the end of the value. This trailing comma basically tells this node, that galera2 is the preferred donor, if galera2 is not available, any other available node will be used as donor.

You could also specify a secondary node, which is needed to be available for the node to come up:

wsrep_sst_donor="galera2,galera1"

In this case, galera1 wil be used as secondary donor if galera2 is not available. If both are not available, the node will refuse to come up.

Taxonomy upgrade extras: Galera Cluster

Past and Future Conferences, and Talks Around MySQL

Jörg Brühe - Mon, 2016-04-11 15:25

Time flies, and my blogging frequency is quite low. More frequent would be better, but knowing myself I'll rather not promise anything ;-)

Still, it is appropriate to write some notes about CeBIT, the "Chemnitzer Linuxtage 2016", and future events.

CeBIT

CeBIT was running from March 14 to 18 (Monday till Friday) in Hannover, Germany, and I will leave the general assessment to the various marketing departments as well as to the regular visitors (to which I do not belong).

In order to meet our current customers as well as potential future ones, FromDual had a booth in the "Open Source Forum". We displayed a Galera Cluster, running on three tiny headless single-board Linux machines, and showed how it reacts to node failures and then recovers all by itself, without any administrator intervention. Many of our visitors were fascinated, because a HA solution would be a good fit in their solution architecture. We had got several stuffed dolphins "Sakila", the traditional MySQL symbol, and all of them found new homes (typically with the words "for my grandchild"). :-)

IMHO, the "Open Source Forum" had deserved a better visitor attraction than it really got - placing it into one hall with document management systems was no good fit, research and development might have been more appropriate.
The forum had an area for talks which were running all five days, I consider John "Maddog" Hall (who had provided an Alpha machine to Linus Torvalds decades ago) and Prof. Klaus Knopper (who is maintaining the "Knoppix" live distribution) the most prominent speakers. FromDual's Oli Sennhauser talked about the new features of MySQL 5.7, you can get the slides via the FromDual download page.

Chemnitzer Linux-Tage

The weekend following CeBIT, March 19 and 20, had been selected for the Chemnitzer Linux-Tage. Like in the previous years, the conference attracted many visitors from all over Germany as well as from some neighbouring countries, and both John Hall and Klaus Knopper had come there directly from Hannover - like me and several others.

As usual, the conference programme covered all aspects of Linux, the headline was "It is your project!". Databases are definitely not one of the major topics there, it is more about overall trends, distributions, communication, and many other aspects.

I delivered a talk about "RPM conventions - a Modern Tower of Bable", and it was well received. I am using various MySQL RPMs (from MySQL AB, Oracle, or RedHat) as examples to show different opinions about packaging, dependencies, installation actions, and compatibility issues, which partly originate from the diverging positions of software developer vs distributor. MySQL was used as a well-known example (but will interest my readers here), most of the items are also applicable to almost any software. Again, the slides (in German) are available on the FromDual web site. Your comments are welcome!

Open Source Data Center Conference

We all know that Open Source has become a major force in computing, so it is no surprise to have it as the subject for various conferences.

One of them is the "Open Source Data Center Conference" "OSDC", to be held in Berlin on April 26 - 28. Open Source database systems are one of the topics, and the programme committee accepted my talk "MySQL-Server in Teamwork - Replication and Galera Cluster". After the conference, I will upload it on the FromDual site and make it available for download.

Now, having told you all this, i will turn to customer issues again ...

Enjoy!

Past and Future Conferences, and Talks Around MySQL

Jörg Brühe - Mon, 2016-04-11 15:25

Time flies, and my blogging frequency is quite low. More frequent would be better, but knowing myself I'll rather not promise anything ;-)

Still, it is appropriate to write some notes about CeBIT, the "Chemnitzer Linuxtage 2016", and future events.

CeBIT

CeBIT was running from March 14 to 18 (Monday till Friday) in Hannover, Germany, and I will leave the general assessment to the various marketing departments as well as to the regular visitors (to which I do not belong).

In order to meet our current customers as well as potential future ones, FromDual had a booth in the "Open Source Forum". We displayed a Galera Cluster, running on three tiny headless single-board Linux machines, and showed how it reacts to node failures and then recovers all by itself, without any administrator intervention. Many of our visitors were fascinated, because a HA solution would be a good fit in their solution architecture. We had got several stuffed dolphins "Sakila", the traditional MySQL symbol, and all of them found new homes (typically with the words "for my grandchild"). :-)

IMHO, the "Open Source Forum" had deserved a better visitor attraction than it really got - placing it into one hall with document management systems was no good fit, research and development might have been more appropriate.
The forum had an area for talks which were running all five days, I consider John "Maddog" Hall (who had provided an Alpha machine to Linus Torvalds decades ago) and Prof. Klaus Knopper (who is maintaining the "Knoppix" live distribution) the most prominent speakers. FromDual's Oli Sennhauser talked about the new features of MySQL 5.7, you can get the slides via the FromDual download page.

Chemnitzer Linux-Tage

The weekend following CeBIT, March 19 and 20, had been selected for the Chemnitzer Linux-Tage. Like in the previous years, the conference attracted many visitors from all over Germany as well as from some neighbouring countries, and both John Hall and Klaus Knopper had come there directly from Hannover - like me and several others.

As usual, the conference programme covered all aspects of Linux, the headline was "It is your project!". Databases are definitely not one of the major topics there, it is more about overall trends, distributions, communication, and many other aspects.

I delivered a talk about "RPM conventions - a Modern Tower of Bable", and it was well received. I am using various MySQL RPMs (from MySQL AB, Oracle, or RedHat) as examples to show different opinions about packaging, dependencies, installation actions, and compatibility issues, which partly originate from the diverging positions of software developer vs distributor. MySQL was used as a well-known example (but will interest my readers here), most of the items are also applicable to almost any software. Again, the slides (in German) are available on the FromDual web site. Your comments are welcome!

Open Source Data Center Conference

We all know that Open Source has become a major force in computing, so it is no surprise to have it as the subject for various conferences.

One of them is the "Open Source Data Center Conference" "OSDC", to be held in Berlin on April 26 - 28. Open Source database systems are one of the topics, and the programme committee accepted my talk "MySQL-Server in Teamwork - Replication and Galera Cluster". After the conference, I will upload it on the FromDual site and make it available for download.

Now, having told you all this, i will turn to customer issues again ...

Enjoy!

Past and Future Conferences, and Talks Around MySQL

Jörg Brühe - Mon, 2016-04-11 15:25

Time flies, and my blogging frequency is quite low. More frequent would be better, but knowing myself I'll rather not promise anything ;-)

Still, it is appropriate to write some notes about CeBIT, the "Chemnitzer Linuxtage 2016", and future events.

CeBIT

CeBIT was running from March 14 to 18 (Monday till Friday) in Hannover, Germany, and I will leave the general assessment to the various marketing departments as well as to the regular visitors (to which I do not belong).

In order to meet our current customers as well as potential future ones, FromDual had a booth in the "Open Source Forum". We displayed a Galera Cluster, running on three tiny headless single-board Linux machines, and showed how it reacts to node failures and then recovers all by itself, without any administrator intervention. Many of our visitors were fascinated, because a HA solution would be a good fit in their solution architecture. We had got several stuffed dolphins "Sakila", the traditional MySQL symbol, and all of them found new homes (typically with the words "for my grandchild"). :-)

IMHO, the "Open Source Forum" had deserved a better visitor attraction than it really got - placing it into one hall with document management systems was no good fit, research and development might have been more appropriate.
The forum had an area for talks which were running all five days, I consider John "Maddog" Hall (who had provided an Alpha machine to Linus Torvalds decades ago) and Prof. Klaus Knopper (who is maintaining the "Knoppix" live distribution) the most prominent speakers. FromDual's Oli Sennhauser talked about the new features of MySQL 5.7, you can get the slides via the FromDual download page.

Chemnitzer Linux-Tage

The weekend following CeBIT, March 19 and 20, had been selected for the Chemnitzer Linux-Tage. Like in the previous years, the conference attracted many visitors from all over Germany as well as from some neighbouring countries, and both John Hall and Klaus Knopper had come there directly from Hannover - like me and several others.

As usual, the conference programme covered all aspects of Linux, the headline was "It is your project!". Databases are definitely not one of the major topics there, it is more about overall trends, distributions, communication, and many other aspects.

I delivered a talk about "RPM conventions - a Modern Tower of Bable", and it was well received. I am using various MySQL RPMs (from MySQL AB, Oracle, or RedHat) as examples to show different opinions about packaging, dependencies, installation actions, and compatibility issues, which partly originate from the diverging positions of software developer vs distributor. MySQL was used as a well-known example (but will interest my readers here), most of the items are also applicable to almost any software. Again, the slides (in German) are available on the FromDual web site. Your comments are welcome!

Open Source Data Center Conference

We all know that Open Source has become a major force in computing, so it is no surprise to have it as the subject for various conferences.

One of them is the "Open Source Data Center Conference" "OSDC", to be held in Berlin on April 26 - 28. Open Source database systems are one of the topics, and the programme committee accepted my talk "MySQL-Server in Teamwork - Replication and Galera Cluster". After the conference, I will upload it on the FromDual site and make it available for download.

Now, having told you all this, i will turn to customer issues again ...

Enjoy!

Galera Cache sizing

Shinguz - Mon, 2016-04-04 22:03

To synchronize the data between the Galera Cluster and a new or re-entering Galera node Galera Cluster uses 2 different mechanisms:

  • For full synchronization of data: Snapshot State Transfer (SST).
  • For delta synchronization of data: Incremental State Transfer (IST).

The Incremental State Transfer (IST) is relevant when a node is already known to the Galera Cluster and just left the cluster short time ago. This typically happens in a maintenance window during a rolling cluster restart.

The Galera Cache is a round-robin file based cache that keeps all the write-sets (= transactions + meta data) for a certain amount of time. This time, which should be bigger than your planned maintenance window, depends on the size of the Galera Cache (default 128 Mbyte) and the traffic which will happen during your maintenance window.

If your traffic is bigger than the Galera Cache can keep Galera Cluster will fall-back from IST to SST which is a very expensive operation for big databases.

The size of the Galera Cache can be calculated of the delta of the sum of the following 2 Galera status informations before and after the maintenance window:

Galera Cache size = delta(wsrep_replicated_bytes + wsrep_received_bytes)

Ideally you determine these values before your change happens in a time window where you have roughly the same traffic as during your maintenance window.

If you do not have a Galera Cluster in place yet or if you do not have those values available you can also use the numbers of the traffic written to the binary log or the number of the traffic written to InnoDB transaction log (Innodb_os_log_written).

As a rough estimate we have evaluated the following formulas for you:

Binary Log Traffic x 1.3 = Wsrep traffic (+/- 10%)

or

InnoDB Log File traffic x 0.6 = Wsrep traffic (+/- 10%)
Taxonomy upgrade extras: Galera Clustercachesizing

FromDual Nagios and Icinga plug-ins v1.0.1 for MySQL/MariaDB released

FromDual.en - Tue, 2016-02-23 18:27

FromDual has the pleasure to announce the release of the new version 1.0.1 of the FromDual Nagios and Icinga plug-ins for MySQL, Galera Cluster and MariaDB.

Download

The new FromDual Nagios plug-ins can be downloaded here.

In the inconceivable case that you find a bug in the FromDual Nagios plug-ins please report it to our bug tracker.

Any feedback, statements and testimonials are welcome as well! Please send them to feedback@fromdual.com.

Changes in Nagios plug-ins 1.0.1
  • Help adapted to new 5.7 conventions for creating user in check_repl_mysql_heartbeat.pl
  • Output can be formatted for Centreon, Icinga and Nagios now in perf_mysql.pl
  • Support for Galera Cluster implemented in perf_mysql.pl
Taxonomy upgrade extras: nagiosicingaplug-inmysqlmariadbpercona serverGalera ClustermonitoringOperationsrelease

FromDual Nagios and Icinga plug-ins v1.0.1 for MySQL/MariaDB released

FromDual.en - Tue, 2016-02-23 18:27

FromDual has the pleasure to announce the release of the new version 1.0.1 of the FromDual Nagios and Icinga plug-ins for MySQL, Galera Cluster and MariaDB.

Download

The new FromDual Nagios plug-ins can be downloaded here.

In the inconceivable case that you find a bug in the FromDual Nagios plug-ins please report it to our bug tracker.

Any feedback, statements and testimonials are welcome as well! Please send them to feedback@fromdual.com.

Changes in Nagios plug-ins 1.0.1
  • Help adapted to new 5.7 conventions for creating user in check_repl_mysql_heartbeat.pl
  • Output can be formatted for Centreon, Icinga and Nagios now in perf_mysql.pl
  • Support for Galera Cluster implemented in perf_mysql.pl
Taxonomy upgrade extras: nagiosicingaplug-inmysqlmariadbpercona serverGalera ClustermonitoringOperationsrelease

FromDual Nagios and Icinga plug-ins v1.0.1 for MySQL/MariaDB released

FromDual.en - Tue, 2016-02-23 18:27

FromDual has the pleasure to announce the release of the new version 1.0.1 of the FromDual Nagios and Icinga plug-ins for MySQL, Galera Cluster and MariaDB.

Download

The new FromDual Nagios plug-ins can be downloaded here.

In the inconceivable case that you find a bug in the FromDual Nagios plug-ins please report it to our bug tracker.

Any feedback, statements and testimonials are welcome as well! Please send them to feedback@fromdual.com.

Changes in Nagios plug-ins 1.0.1
  • Help adapted to new 5.7 conventions for creating user in check_repl_mysql_heartbeat.pl
  • Output can be formatted for Centreon, Icinga and Nagios now in perf_mysql.pl
  • Support for Galera Cluster implemented in perf_mysql.pl
Taxonomy upgrade extras: nagiosicingaplug-inmysqlmariadbpercona serverGalera ClustermonitoringOperationsrelease

Mit FromDual an die CeBIT 2016 - Tickets

FromDual.de - Tue, 2016-02-16 21:49

Besuchen Sie uns vom 14. bis 18. März an der CeBIT 2016 in Hannover. FromDual präsentiert die neusten Produkte rund um MySQL in der Halle 3 am Stand D36 / 630 im Open Source Park.

Wir vergeben kostenlos Eintrittskarten für die ersten 50 Interessenten. "Dè Schnèller isch dè g'schwinder...". Tickets erhalten Sie unter: contact@fromdual.com

Kommen Sie uns besuchen, lassen Sie sich von uns zeigen, welche neuen Trends es im MySQL Ökosystem gibt und wie wir die mit FromDual Tools zu adressieren planen.

Sie können einen Galera Cluster live erleben. Zudem zeigen wir den FromDual Performance Monitor für MySQL und MariaDB, das Ops Center für MySQL und MariaDB sowie die neue MyEnv Datenbank-Container-Funktionalität für Ihre private oder public MySQL Cloud.

Zudem stellen wir in einem Vortrag die neuen MySQL 5.7 Funktionalitäten vor.

Freundliche Grüsse,
Ihr FromDual Team

Taxonomy upgrade extras: cebit

Mit FromDual an die CeBIT 2016 - Tickets

FromDual.de - Tue, 2016-02-16 21:49

Besuchen Sie uns vom 14. bis 18. März an der CeBIT 2016 in Hannover. FromDual präsentiert die neusten Produkte rund um MySQL in der Halle 3 am Stand D36 / 630 im Open Source Park.

Wir vergeben kostenlos Eintrittskarten für die ersten 50 Interessenten. "Dè Schnèller isch dè g'schwinder...". Tickets erhalten Sie unter: contact@fromdual.com

Kommen Sie uns besuchen, lassen Sie sich von uns zeigen, welche neuen Trends es im MySQL Ökosystem gibt und wie wir die mit FromDual Tools zu adressieren planen.

Sie können einen Galera Cluster live erleben. Zudem zeigen wir den FromDual Performance Monitor für MySQL und MariaDB, das Ops Center für MySQL und MariaDB sowie die neue MyEnv Datenbank-Container-Funktionalität für Ihre private oder public MySQL Cloud.

Zudem stellen wir in einem Vortrag die neuen MySQL 5.7 Funktionalitäten vor.

Freundliche Grüsse,
Ihr FromDual Team

Taxonomy upgrade extras: cebit

Pages

Subscribe to FromDual aggregator