disable table stats for MySQL 5 by default
This commit is contained in:
@@ -6,6 +6,8 @@ $Id$
|
|||||||
$Source$
|
$Source$
|
||||||
|
|
||||||
2006-04-12 Sebastian Mendel <cybot_tm@users.sourceforge.net>
|
2006-04-12 Sebastian Mendel <cybot_tm@users.sourceforge.net>
|
||||||
|
* server_databases.php, libraries/database_interface.lib.php:
|
||||||
|
disable table stats for MySQL 5 by default
|
||||||
* server_databases.php:
|
* server_databases.php:
|
||||||
use new functionality of PMA_DBI_get_databases_full() to limit display
|
use new functionality of PMA_DBI_get_databases_full() to limit display
|
||||||
* libraries/database_interface.lib.php:
|
* libraries/database_interface.lib.php:
|
||||||
|
@@ -453,7 +453,9 @@ function PMA_DBI_get_databases_full($database = null, $force_stats = false,
|
|||||||
// for PMA bc:
|
// for PMA bc:
|
||||||
// `SCHEMA_FIELD_NAME` AS `SHOW_TABLE_STATUS_FIELD_NAME`
|
// `SCHEMA_FIELD_NAME` AS `SHOW_TABLE_STATUS_FIELD_NAME`
|
||||||
$sql = '
|
$sql = '
|
||||||
SELECT `information_schema`.`SCHEMATA`.*,
|
SELECT `information_schema`.`SCHEMATA`.*';
|
||||||
|
if ($force_stats) {
|
||||||
|
$sql .= ',
|
||||||
COUNT(`information_schema`.`TABLES`.`TABLE_SCHEMA`)
|
COUNT(`information_schema`.`TABLES`.`TABLE_SCHEMA`)
|
||||||
AS `SCHEMA_TABLES`,
|
AS `SCHEMA_TABLES`,
|
||||||
SUM(`information_schema`.`TABLES`.`TABLE_ROWS`)
|
SUM(`information_schema`.`TABLES`.`TABLE_ROWS`)
|
||||||
@@ -468,11 +470,17 @@ function PMA_DBI_get_databases_full($database = null, $force_stats = false,
|
|||||||
+ `information_schema`.`TABLES`.`INDEX_LENGTH`)
|
+ `information_schema`.`TABLES`.`INDEX_LENGTH`)
|
||||||
AS `SCHEMA_LENGTH`,
|
AS `SCHEMA_LENGTH`,
|
||||||
SUM(`information_schema`.`TABLES`.`DATA_FREE`)
|
SUM(`information_schema`.`TABLES`.`DATA_FREE`)
|
||||||
AS `SCHEMA_DATA_FREE`
|
AS `SCHEMA_DATA_FREE`';
|
||||||
FROM `information_schema`.`SCHEMATA`
|
}
|
||||||
|
$sql .= '
|
||||||
|
FROM `information_schema`.`SCHEMATA`';
|
||||||
|
if ($force_stats) {
|
||||||
|
$sql .= '
|
||||||
LEFT JOIN `information_schema`.`TABLES`
|
LEFT JOIN `information_schema`.`TABLES`
|
||||||
ON `information_schema`.`TABLES`.`TABLE_SCHEMA`
|
ON `information_schema`.`TABLES`.`TABLE_SCHEMA`
|
||||||
= `information_schema`.`SCHEMATA`.`SCHEMA_NAME`
|
= `information_schema`.`SCHEMATA`.`SCHEMA_NAME`';
|
||||||
|
}
|
||||||
|
$sql .= '
|
||||||
' . $sql_where_schema . '
|
' . $sql_where_schema . '
|
||||||
GROUP BY `information_schema`.`SCHEMATA`.`SCHEMA_NAME`
|
GROUP BY `information_schema`.`SCHEMATA`.`SCHEMA_NAME`
|
||||||
ORDER BY ' . PMA_backquote($sort_by) . ' ' . $sort_order
|
ORDER BY ' . PMA_backquote($sort_by) . ' ' . $sort_order
|
||||||
|
@@ -351,7 +351,6 @@ if ($databases_count > 0) {
|
|||||||
PMA_buttonOrImage( 'drop_selected_dbs', 'mult_submit', 'drop_selected_dbs', $strDrop, 'b_deltbl.png' );
|
PMA_buttonOrImage( 'drop_selected_dbs', 'mult_submit', 'drop_selected_dbs', $strDrop, 'b_deltbl.png' );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( PMA_MYSQL_INT_VERSION < 50002 ) {
|
|
||||||
echo '<ul><li id="li_switch_dbstats"><strong>' . "\n";
|
echo '<ul><li id="li_switch_dbstats"><strong>' . "\n";
|
||||||
if ( empty( $dbstats ) ) {
|
if ( empty( $dbstats ) ) {
|
||||||
echo ' <a href="./server_databases.php?' . $url_query . '&dbstats=1"'
|
echo ' <a href="./server_databases.php?' . $url_query . '&dbstats=1"'
|
||||||
@@ -366,7 +365,6 @@ if ($databases_count > 0) {
|
|||||||
.' <div class="warning">'
|
.' <div class="warning">'
|
||||||
. $strDatabasesStatsHeavyTraffic . '</div></li>' . "\n"
|
. $strDatabasesStatsHeavyTraffic . '</div></li>' . "\n"
|
||||||
.'</ul>' . "\n";
|
.'</ul>' . "\n";
|
||||||
}
|
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
} else {
|
} else {
|
||||||
echo $strNoDatabases;
|
echo $strNoDatabases;
|
||||||
|
Reference in New Issue
Block a user