From 338686589beec07fb4ae643d444964d5700c0426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 7 Apr 2016 08:46:43 +0200 Subject: [PATCH] Filter in use tables at MySQL server to improve performance on big servers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- libraries/Util.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libraries/Util.php b/libraries/Util.php index 26120be4e2..089e7deb15 100644 --- a/libraries/Util.php +++ b/libraries/Util.php @@ -4652,7 +4652,7 @@ class Util // Special speedup for newer MySQL Versions (in 4.0 format changed) if (true === $cfg['SkipLockedTables']) { $db_info_result = $GLOBALS['dbi']->query( - 'SHOW OPEN TABLES FROM ' . Util::backquote($db) . ';' + 'SHOW OPEN TABLES FROM ' . Util::backquote($db) . ' WHERE In_use > 0;' ); // Blending out tables in use @@ -4786,10 +4786,7 @@ class Util $sot_cache = $tables = array(); while ($tmp = $GLOBALS['dbi']->fetchAssoc($db_info_result)) { - // if in use, memorize table name - if ($tmp['In_use'] > 0) { - $sot_cache[$tmp['Table']] = true; - } + $sot_cache[$tmp['Table']] = true; } $GLOBALS['dbi']->freeResult($db_info_result);