mysqldump -uroot unusable for multi-database operations, checks all databases and tables when dumping a single DB

Description

When using mysqldump -uroot, this initiates a very, very resource intensive recursive check of every single database and table on the system.

On a system with some 12k databases and 540k .frm files, this takes a long, long time.

(The following output has substituted "censored" for the real username.)

Using mysqldump -ucensored takes next to no time at all, and does not last for long enough that I can even see the query running.

The issue does not appear to be present in MySQL 5.5.36 server as delivered by Oracle, but it occurs also when using mysqldump from that version, and therefore seems like it is in the server code, not the client code.

Someone else have asked this as a question on serverfault.com also, so I'm not the only one experiencing the issue:

http://serverfault.com/questions/574646/mariadb-10-0-slow-work-mysqldump

Here is the relevant excerpt from SHOW FULL PROCESSLIST for my use case:

And here is some sample output from strace, showing what's going on:

Environment

Debian 7.4 (Wheezy), Linux mysql06 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64 GNU/Linux
deb http://mariadb.mirror.nucleus.be//repo/10.0/debian wheezy main
deb-src http://mariadb.mirror.nucleus.be//repo/10.0/debian wheezy main

Assignee

Sergei Petrunia

Reporter

Jan Ingvoldstad

Fix versions

Affects versions

Priority

Major
Configure