SELECT COUNT(*) is slow in InnoDB
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@547 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
f22e16c919
commit
897b80ae17
|
@ -185,10 +185,10 @@ if (isset($_GET["download"])) {
|
||||||
echo '<thead><tr><td><input type="checkbox" onclick="var elems = this.form.elements; for (var i=0; elems.length > i; i++) if (elems[i].name == \'tables[]\') elems[i].checked = this.checked;" /></td><th>' . lang('Table') . '</th><td>' . lang('Engine') . '</td><td>' . lang('Comment') . '</td><td>' . lang('Collation') . '</td><td>' . lang('Data Length') . '</td><td>' . lang('Index Length') . '</td><td>' . lang('Data Free') . '</td><td>' . lang('Auto Increment') . '</td><td>' . lang('Rows') . "</td></tr></thead>\n";
|
echo '<thead><tr><td><input type="checkbox" onclick="var elems = this.form.elements; for (var i=0; elems.length > i; i++) if (elems[i].name == \'tables[]\') elems[i].checked = this.checked;" /></td><th>' . lang('Table') . '</th><td>' . lang('Engine') . '</td><td>' . lang('Comment') . '</td><td>' . lang('Collation') . '</td><td>' . lang('Data Length') . '</td><td>' . lang('Index Length') . '</td><td>' . lang('Data Free') . '</td><td>' . lang('Auto Increment') . '</td><td>' . lang('Rows') . "</td></tr></thead>\n";
|
||||||
while ($row = $result->fetch_assoc()) {
|
while ($row = $result->fetch_assoc()) {
|
||||||
table_comment($row);
|
table_comment($row);
|
||||||
echo '<tr class="nowrap"><td>' . (isset($row["Rows"]) ? '<input type="checkbox" name="tables[]" value="' . htmlspecialchars($row["Name"]) . '"' . (in_array($row["Name"], (array) $_POST["tables"], true) ? ' checked="checked"' : '') . ' /></td><th><a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . "</a></th><td>$row[Engine]</td><td>" . htmlspecialchars($row["Comment"]) . "</td><td>$row[Collation]" : ' </td><th><a href="' . htmlspecialchars($SELF) . 'view=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . '</a></th><td colspan="7">' . lang('View'));
|
echo '<tr class="nowrap"><td>' . (isset($row["Rows"]) ? '<input type="checkbox" name="tables[]" value="' . htmlspecialchars($row["Name"]) . '"' . (in_array($row["Name"], (array) $_POST["tables"], true) ? ' checked="checked"' : '') . ' /></td><th><a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . "</a></th><td>$row[Engine]</td><td>" . htmlspecialchars($row["Comment"]) . "</td><td>$row[Collation]" : ' </td><th><a href="' . htmlspecialchars($SELF) . 'view=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . '</a></th><td colspan="8"><a href="' . htmlspecialchars($SELF) . "select=" . urlencode($row["Name"]) . '">' . lang('View') . '</a>');
|
||||||
$row["count"] = $mysql->result($mysql->query("SELECT COUNT(*) FROM " . idf_escape($row["Name"])));
|
foreach ((isset($row["Rows"]) ? array("Data_length" => "create", "Index_length" => "indexes", "Data_free" => "edit", "Auto_increment" => "create", "Rows" => "select") : array()) as $key => $link) {
|
||||||
foreach ((isset($row["Rows"]) ? array("Data_length" => "create", "Index_length" => "indexes", "Data_free" => "edit", "Auto_increment" => "create") : array()) + array("count" => "select") as $key => $link) {
|
$val = number_format($row[$key], 0, '.', lang(','));
|
||||||
echo '</td><td align="right">' . (strlen($row[$key]) ? '<a href="' . htmlspecialchars("$SELF$link=") . urlencode($row["Name"]) . '">' . number_format($row[$key], 0, '.', lang(',')) . '</a>' : ' ');
|
echo '</td><td align="right">' . (strlen($row[$key]) ? '<a href="' . htmlspecialchars("$SELF$link=") . urlencode($row["Name"]) . '">' . ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? lang('around %s', $val) : $val) . '</a>' : ' ');
|
||||||
}
|
}
|
||||||
echo "</td></tr>\n";
|
echo "</td></tr>\n";
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,6 +136,7 @@ $translations = array(
|
||||||
'Event' => 'Událost',
|
'Event' => 'Událost',
|
||||||
'MySQL version: %s through PHP extension %s' => 'Verze MySQL: %s přes PHP extenzi %s',
|
'MySQL version: %s through PHP extension %s' => 'Verze MySQL: %s přes PHP extenzi %s',
|
||||||
'%d row(s)' => array('%d řádek', '%d řádky', '%d řádků'),
|
'%d row(s)' => array('%d řádek', '%d řádky', '%d řádků'),
|
||||||
|
'around %s' => 'přibližně %s',
|
||||||
'ON UPDATE CURRENT_TIMESTAMP' => 'Při změně aktuální čas',
|
'ON UPDATE CURRENT_TIMESTAMP' => 'Při změně aktuální čas',
|
||||||
'Remove' => 'Odebrat',
|
'Remove' => 'Odebrat',
|
||||||
'Are you sure?' => 'Opravdu?',
|
'Are you sure?' => 'Opravdu?',
|
||||||
|
|
|
@ -136,6 +136,7 @@ $translations = array(
|
||||||
'Event' => 'Ereignis',
|
'Event' => 'Ereignis',
|
||||||
'MySQL version: %s through PHP extension %s' => 'Version MySQL: %s, mit PHP-Erweiterung %s',
|
'MySQL version: %s through PHP extension %s' => 'Version MySQL: %s, mit PHP-Erweiterung %s',
|
||||||
'%d row(s)' => array('%d Datensatz', '%d Datensätze'),
|
'%d row(s)' => array('%d Datensatz', '%d Datensätze'),
|
||||||
|
'around %s' => 'ungefähren %s',
|
||||||
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
|
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
|
||||||
'Remove' => 'Entfernen',
|
'Remove' => 'Entfernen',
|
||||||
'Are you sure?' => 'Sind Sie sicher ?',
|
'Are you sure?' => 'Sind Sie sicher ?',
|
||||||
|
|
|
@ -136,6 +136,7 @@ $translations = array(
|
||||||
'Event' => 'Evento',
|
'Event' => 'Evento',
|
||||||
'MySQL version: %s through PHP extension %s' => 'Versión MySQL: %s a través de extensión PHP %s',
|
'MySQL version: %s through PHP extension %s' => 'Versión MySQL: %s a través de extensión PHP %s',
|
||||||
'%d row(s)' => array('%d fila', '%d filas'),
|
'%d row(s)' => array('%d fila', '%d filas'),
|
||||||
|
'around %s' => 'acaso %s',
|
||||||
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
|
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
|
||||||
'Remove' => 'Eliminar',
|
'Remove' => 'Eliminar',
|
||||||
'Are you sure?' => 'Está seguro?',
|
'Are you sure?' => 'Está seguro?',
|
||||||
|
|
|
@ -135,6 +135,7 @@ $translations = array(
|
||||||
'Time' => 'Aeg',
|
'Time' => 'Aeg',
|
||||||
'Event' => 'Sündmus',
|
'Event' => 'Sündmus',
|
||||||
'%d row(s)' => array('%d rida', '%d rida'),
|
'%d row(s)' => array('%d rida', '%d rida'),
|
||||||
|
'around %s' => 'umbes %s',
|
||||||
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
|
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
|
||||||
'Remove' => 'Eemalda',
|
'Remove' => 'Eemalda',
|
||||||
'Are you sure?' => 'Kas oled kindel?',
|
'Are you sure?' => 'Kas oled kindel?',
|
||||||
|
|
|
@ -135,6 +135,7 @@ $translations = array(
|
||||||
'Time' => 'Temps',
|
'Time' => 'Temps',
|
||||||
'Event' => 'Évènement',
|
'Event' => 'Évènement',
|
||||||
'%d row(s)' => array('%d ligne', '%d lignes'),
|
'%d row(s)' => array('%d ligne', '%d lignes'),
|
||||||
|
'around %s' => 'autour %s',
|
||||||
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
|
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
|
||||||
'Remove' => 'Effacer',
|
'Remove' => 'Effacer',
|
||||||
'Are you sure?' => 'Êtes-vous certain?',
|
'Are you sure?' => 'Êtes-vous certain?',
|
||||||
|
|
|
@ -136,6 +136,7 @@ $translations = array(
|
||||||
'Event' => 'Evento',
|
'Event' => 'Evento',
|
||||||
'MySQL version: %s through PHP extension %s' => 'Versione MySQL: %s via estensione PHP %s',
|
'MySQL version: %s through PHP extension %s' => 'Versione MySQL: %s via estensione PHP %s',
|
||||||
'%d row(s)' => array('%d riga', '%d righe'),
|
'%d row(s)' => array('%d riga', '%d righe'),
|
||||||
|
'around %s' => 'su %s',
|
||||||
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
|
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
|
||||||
'Remove' => 'Rimuovi',
|
'Remove' => 'Rimuovi',
|
||||||
'Are you sure?' => 'Sicuro?',
|
'Are you sure?' => 'Sicuro?',
|
||||||
|
|
|
@ -136,6 +136,7 @@ $translations = array(
|
||||||
'Event' => 'Event',
|
'Event' => 'Event',
|
||||||
'MySQL version: %s through PHP extension %s' => 'MySQL versie: %s met PHP extensie %s',
|
'MySQL version: %s through PHP extension %s' => 'MySQL versie: %s met PHP extensie %s',
|
||||||
'%d row(s)' => array('%d rij', '%d rijen'),
|
'%d row(s)' => array('%d rij', '%d rijen'),
|
||||||
|
'around %s' => 'ongeveer %s',
|
||||||
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
|
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
|
||||||
'Remove' => 'Verwijderen',
|
'Remove' => 'Verwijderen',
|
||||||
'Are you sure?' => 'Weet u het zeker?',
|
'Are you sure?' => 'Weet u het zeker?',
|
||||||
|
|
|
@ -136,6 +136,7 @@ $translations = array(
|
||||||
'Event' => 'Udalosť',
|
'Event' => 'Udalosť',
|
||||||
'MySQL version: %s through PHP extension %s' => 'Verzia MySQL: %s cez PHP rozšírenie %s',
|
'MySQL version: %s through PHP extension %s' => 'Verzia MySQL: %s cez PHP rozšírenie %s',
|
||||||
'%d row(s)' => array('%d riadok', '%d riadky', '%d riadkov'),
|
'%d row(s)' => array('%d riadok', '%d riadky', '%d riadkov'),
|
||||||
|
'around %s' => 'približne %s',
|
||||||
'ON UPDATE CURRENT_TIMESTAMP' => 'Pri zmene aktuálny čas',
|
'ON UPDATE CURRENT_TIMESTAMP' => 'Pri zmene aktuálny čas',
|
||||||
'Remove' => 'Odobrať',
|
'Remove' => 'Odobrať',
|
||||||
'Are you sure?' => 'Naozaj?',
|
'Are you sure?' => 'Naozaj?',
|
||||||
|
|
|
@ -136,6 +136,7 @@ $translations = array(
|
||||||
'Event' => '事件',
|
'Event' => '事件',
|
||||||
'MySQL version: %s through PHP extension %s' => 'MySQL 版本: %s 通过 PHP 扩展 %s',
|
'MySQL version: %s through PHP extension %s' => 'MySQL 版本: %s 通过 PHP 扩展 %s',
|
||||||
'%d row(s)' => '%d 行',
|
'%d row(s)' => '%d 行',
|
||||||
|
'around %s' => '附近的 %s',
|
||||||
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
|
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
|
||||||
'Remove' => '移除',
|
'Remove' => '移除',
|
||||||
'Are you sure?' => '你确定吗?',
|
'Are you sure?' => '你确定吗?',
|
||||||
|
|
Loading…
Reference in a new issue