From 87fcb715a5c7a626ce5c6a8c6dd25f21d5a0ff2c Mon Sep 17 00:00:00 2001 From: Steve Alberty Date: Sun, 10 Jun 2001 12:54:32 +0000 Subject: [PATCH] add output of table size, speedup on high loaded server --- db_details.php3 | 52 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 7 deletions(-) diff --git a/db_details.php3 b/db_details.php3 index 277903866..fd1329dca 100755 --- a/db_details.php3 +++ b/db_details.php3 @@ -15,10 +15,53 @@ else $tables = mysql_list_tables($db); $num_tables = @mysql_numrows($tables); +if (MYSQL_MAJOR_VERSION>=3.23){ + $query="show table status from $db"; + $result=mysql_query($query); +} + if($num_tables == 0) { echo $strNoTablesFound; } +// shows all tables faster on high traffic sites +// and views table size - staybyte - 9 June 2001 +else if (MYSQL_MAJOR_VERSION>=3.23 && $result!=false && mysql_num_rows($result)>0){ + echo "\n"; + echo ""; + echo ""; + echo ""; + // temporary + if (!empty($strSize)) echo ""; + else echo ""; + $i=0; + while ($sts_data=mysql_fetch_array($result)){ + $table=$sts_data["Name"]; + $query = "?server=$server&lang=$lang&db=$db&table=$table&goto=db_details.php3"; + $bgcolor = $cfgBgcolorOne; + $i++ % 2 ? 0: $bgcolor = $cfgBgcolorTwo; + echo "\n"; +?> + + + + + + + +".$sts_data["Rows"]."\n"; + $tblsize=$sts_data["Data_length"]+$sts_data["Index_length"]; + if ($tblsize>1000000000) $tblsize_format=number_format(round($tblsize/107374182.4)/10,1,','.')." GB"; + else if ($tblsize>1000000) $tblsize_format=number_format(round($tblsize/104857.6)/10,1,','.')." MB"; + else if ($tblsize>1000) $tblsize_format=number_format(round($tblsize/102.4)/10,1)." KB"; + echo "\n"; + echo "\n"; + } + echo "
".UCFirst($strTable)."$strAction$strRecords$strSize 
&pos=0">&zero_rows=">&zero_rows=">  "; + echo ""; + echo $tblsize_format."
\n"; +} else { $i = 0; @@ -137,17 +180,13 @@ if($cfgBookmark['db'] && $cfgBookmark['table']) + + - - - - - - @@ -176,6 +215,5 @@ if($cfgBookmark['db'] && $cfgBookmark['table'])