1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 01:24:17 +02:00

Simplify slow queries

This commit is contained in:
Jakub Vrana
2012-08-19 21:55:00 -07:00
parent 72b801513b
commit ea6d6e0d44
4 changed files with 19 additions and 38 deletions

View File

@@ -405,9 +405,7 @@ if (!$columns) {
$found_rows = found_rows($table_status, $where);
if ($found_rows < max(1e4, 2 * ($page + 1) * $limit)) {
// slow with big tables
$kill = kill_timeout();
$found_rows = @$connection->result("/* Adminer $kill */ SELECT COUNT(*) FROM " . table($TABLE) . ($where ? " WHERE " . implode(" AND ", $where) : "")); // @ - may be kill
cancel_kill_timeout();
$found_rows = reset(slow_query("SELECT COUNT(*) FROM " . table($TABLE) . ($where ? " WHERE " . implode(" AND ", $where) : "")));
} else {
$exact_count = false;
}