MySQL Tech-Feed (en)

Dropped Tables with FromDual Backup Manager

Shinguz - Fri, 2019-05-24 07:23

Some applications have the bad behaviour to CREATE or DROP tables while our FromDual Backup Manager (bman) backup is running.

This leads to the following bman error message:

/opt/mysql/product/5.7.26/bin/mysqldump --user=dba --host=migzm96i --port=3306 --all-databases --quick --single-transaction --flush-logs --triggers --routines --hex-blob --events | tee >(md5sum --binary >/tmp/checksum.23357.md5) | gzip -1
to Destination: /var/mysql/dumps/mysql96i/daily/bck_mysql96i_full_2019-05-22_06-50-01.sql.gz …

FromDual Ops Center for MariaDB and MySQL 0.9.1 has been released

Shinguz - Tue, 2019-05-07 17:12

FromDual has the pleasure to announce the release of the new version 0.9.1 of its popular FromDual Ops Center for MariaDB and MySQL focmm.

The FromDual Ops Center for MariaDB and MySQL (focmm) helps DBA’s and System Administrators to manage MariaDB and MySQL database farms. Ops Center makes DBA and Admins life easier!

The main task of Ops Center is to support you in your daily MySQL and MariaDB operation tasks. More information about FromDual Ops Center you can find here.

Download

The new FromDual Ops …


FromDual Ops Center for MariaDB and MySQL 0.9 has been released

Shinguz - Tue, 2019-04-30 09:17

Caution: We have introduced an evil bug which prohibits installation of focmm. Sorry! Somehow it did pass our QA. To fix this bug update file lib/Upgrade.inc on Line 1965 as follows:

- $sql = sprintf("REPLACE INTO `focmm_configuration` (`key`, `value`) VALUES ('%s', '%s'), ('%s', '%s'), ('%s', '%s')"
+ $sql = sprintf("REPLACE INTO `focmm_configuration` (`key`, `value`) VALUES ('%s', '%s'), ('%s', '%s')"

In the meanwhile we prepare a new release.


FromDual has the pleasure to announce …


MariaDB Prepared Statements, Transactions and Multi-Row Inserts

Shinguz - Mon, 2019-04-15 18:09

Last week at the MariaDB/MySQL Developer Training we had one participant asking some tricky questions I did not know the answer by heart.

Also MariaDB documentation was not too verbose (here and here).

So time to do some experiments:

Prepared Statements and Multi-Row Inserts

SQL> PREPARE stmt1 FROM 'INSERT INTO `test`.`test` (`data`) VALUES (?), (?), (?)';
Statement prepared
SQL> SET @d1 = 'Bli';
SQL> SET @d2 = 'Bla';
SQL> SET @d3 = 'Blub';
SQL> EXECUTE stmt1 USING @d1, @d2, @d3;
Query OK, 3 …

Understanding InnoDB - Buffer Pool Flushing

Shinguz - Mon, 2019-04-08 20:31

InnoDB Page Cleaner Thread

The InnoDB Page Cleaner Thread is an InnoDB background thread that flushes dirty pages from the InnoDB Buffer Pool to disk. Prior MySQL 5.6 this action was performed by the InnoDB Master Thread.

SQL> SELECT thread_id, name, type
  FROM performance_schema.threads
 WHERE name LIKE 'thread/innodb/page%'
    OR name LIKE 'thread/innodb/srv_master%';
+-----------+-----------------------------------+------------+
| thread_id | name                              | type       | …

MySQL - MariaDB migration

Shinguz - Sun, 2019-04-07 21:37

Uptime of a MariaDB Galera Cluster

Shinguz - Fri, 2019-03-15 17:58

A while ago somebody on Google Groups asked for the Uptime of a Galera Cluster. The answer is easy… Wait, no! Not so easy… The uptime of a Galera Node is easy (or not?). But Uptime of the whole Galera Cluster?

My answer then was: “Grep the error log.” My answer now is still: “Grep the error log.” But slightly different:

$ grep 'view(view_id' *
2019-03-07 16:10:26 [Note] WSREP: view(view_id(PRIM,0e0a2851,1) memb {
2019-03-07 16:14:37 [Note] WSREP: …

Linux system calls of MySQL process

Shinguz - Fri, 2019-03-15 17:06

We had the problem today that a MySQL Galera Cluster node with the multi-tenancy pattern caused a lot of system time (sy 75%, load average about 30 (you really must read this article by Brendan Gregg, it is worth it!)) so we wanted to find what system calls are being used to see what could cause this issue (to verify if it is a TOC or a TDC problem:

$ sudo strace -c -p $(pidof -s mysqld) -f -e trace=all
Process 5171 attached with 41 threads
Process 16697 attached
^C
Process 5171 detached
...
Process 5333 …

MariaDB and MySQL Database Consolidation

Shinguz - Thu, 2019-03-14 23:05

We see at various customers the request for consolidating their MariaDB and MySQL infrastructure. The advantage of such a measure is clear in the first step: Saving costs! And this request comes typically from managers. But what we unfortunately see rarely is to question this request from the IT engineering perspective. Because it comes, as anything in life, with some “costs”. So, saving costs with consolidation on one side comes with “costs” for operation complexity on the other …


MariaDB and MySQL consulting by plane

Shinguz - Fri, 2019-03-01 15:27

Since January 2019 FromDual tries to contribute actively a little bit against global warming too.

The best for the climate would be to NOT travel to the customer at all! For this cases we have our FromDual remote-DBA services for MariaDB and MySQL.

But sometimes customer wants or needs us on-site for our FromDual in-house trainings or our FromDual on-site consulting engagements. In these cases we try to travel by train. Travelling by train is after walking or travelling by bicycle the most climate friendly …


FromDual Backup and Recovery Manager for MariaDB and MySQL 2.1.0 has been released

Shinguz - Fri, 2019-02-22 17:14

FromDual has the pleasure to announce the release of the new version 2.1.0 of its popular Backup and Recovery Manager for MariaDB and MySQL (brman).

The new FromDual Backup and Recovery Manager can be downloaded from here. How to install and use the Backup and Recovery Manager is describe in FromDual Backup and Recovery Manager (brman) installation guide.

In the inconceivable case that you find a bug in the FromDual Backup and Recovery Manager please report it to the FromDual Bugtracker or just send us an …


MySQL Enterprise Backup Support Matrix

Shinguz - Tue, 2019-02-19 19:13

MySQL Enterprise Backup (MEB) is a bit limited related to support of older MySQL versions. So you should consider the following release matrix:

MEB/MySQLSupported 5.5  5.6  5.7  8.0 
3.11.xNOxx
3.12.xYESxx
4.0.xNOx
4.1.xYESx
8.0.xYES8.0.x*


* MySQL Enterprise Backup 8.0.15 only supports MySQL 8.0.15. For earlier versions of MySQL 8.0, use the MySQL Enterprise Backup version with the same version number as the server.

MySQL Enterprise Backup is available for …


FromDual Enterprise Tools License

Shinguz - Mon, 2019-02-18 22:10

The FromDual Enterprise Tools are licensed under a FromDual commercial license. The one exception is MyEnv which is licensed under GPLv2.

MyEnv

MyEnv is licensed under GPLv2.

FromDual Enterprise Tools

The FromDual Enterprise Tools are free of costs for non-commercial and non-profit use. If FromDual considers your usage as non-commercial or non-profit must be discussed. Just testing the functionality of the software for evaluation or learning purposes FromDual considers as non-commercial usage.

The following …


Upgrade MySQL 5.7 to MySQL 8.0

Shinguz - Tue, 2019-02-05 14:30

Early adopters of our customers are considering to upgrade to MySQL 8.0. To be prepared we have created a check-list:

  • RTFM: Upgrading MySQL. Really! This time is different than all the years before…
  • Upgrade Path:
    • Only Upgrade from 5.7 to 8.0 is supported (skipping 5.7 is NOT supported!). So Upgrade to 5.7 first!
    • Only Upgrade between GA releases (5.7.9+, 8.0.11+) is supported.
    • Recommended: Upgrade to newest 5.7 first (5.7.25).
  • Check for Incompatibility Changes, Deprecated and Removed Features: …

Using tmux for MariaDB database support and surveillance

Shinguz - Tue, 2018-12-25 16:14

See also Byobu.

See also our older article: Using screen for support and/or surveillance.

First simple steps

The command tmux starts a tmux server and opens a new session with a (pseudo) terminal:

shell> tmux
tmux1.png

To leave a tmux session again just type Ctrl+d inside your tmux session or:

tmux> exit

If you want to give a tmux session a specific name you can start tmux as follows to created a named session:

shell> tmux new -s mariadb

or if you are already inside tmux:

tmux> Ctrl+b $

followed by a …


To NULL, or not to NULL, that is the question!

Shinguz - Fri, 2018-12-14 08:33

As we already stated in earlier articles in this blog
[1 and 2
] it is a good idea to use NULL values properly in MariaDB and MySQL.

One of my Mantras in MariaDB performance tuning is: Smaller tables lead to faster queries! One consequence out of this is to store NULL values instead of some dummy values into the columns if the value is not known (NULL: undefined/unknown).

To show how this helps related to space used by a table we created a little example:

CREATE TABLE big_null1 (
  id INT UNSIGNED NOT NULL …

Re: MariaDB indexing of NULL values

Shinguz - Sun, 2018-12-09 11:43

Yes, I am aware that this is not a NULL issue. I hope my blog did not tell that this is be cause of NULL.

> Well, its title is "Indexing of NULL values", so if one takes that at face value, I'm afraid they will think it's about special treatment of NULL values :-).

The problem is, that MariaDB (and MySQL) chooses the wrong query execution plan for columns with low cardinality and chooses a 3 times slower plan (Index Lookup instead of FTS).

> Yes, agree.
(For me it is 2.2x slower. I would say …


MariaDB indexing of NULL values

Shinguz - Sun, 2018-12-09 11:33

Hello,

Just wanted to say that the post misses the point. The problem is not NULL values as such. the problem is:

  • A) InnoDB returns very optimistic estimates for low-cardinality values and
  • B) cost model is not fully adequate.

Here is an example demonstrating the same effect with a non-NULL value: https://gist.github.com/spetrunia/2c6ea05ed6b0c1ffa14fa8eac6b72029 . We still get 400K rows as an estimate (instead if 990K) . The estimate is provided by InnoDB.

Let's try it with MyRocks storage …


UNDO logs in InnoDB system tablespace ibdata1

Shinguz - Wed, 2018-12-05 21:55

We see sometimes at customers that they have very big InnoDB system tablespace files (ibdata1) although they have set innodb_file_per_table = 1.

So we want to know what else is stored in the InnoDB system tablespace file ibdata1 to see what we can do against this unexpected growth.

First let us check the size of the ibdata1 file:

$ ll ibdata1
-rw-rw---- 1 mysql mysql 109064486912 Dez  5 19:10 ibdata1

The InnoDB system tablespace is about 101.6 Gibyte in size. This is exactly 6'656'768 InnoDB blocks of 16 …


MariaDB indexing of NULL values

Shinguz - Thu, 2018-11-29 20:10

In the recent MariaDB DBA advanced training class the question came up if MariaDB can make use of an index when searching for NULL values… And to be honest I was not sure any more. So instead of reading boring documentation I did some little tests:

Search for NULL

First I started with a little test data set. Some of you might already know it:

CREATE TABLE null_test (
  id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
, data VARCHAR(32) DEFAULT NULL
, ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP() 
); …

Pages

Subscribe to FromDual aggregator - MySQL Tech-Feed (en)