Add approximate row count for PostgreSQL driver

This commit is contained in:
Ivan Masár
2012-05-11 12:41:31 +02:00
committed by Jakub Vrana
parent 20e11be093
commit 0e31b09543
3 changed files with 6 additions and 2 deletions

View File

@@ -13,7 +13,10 @@ if ($_GET["script"] == "db") {
foreach ($sums + array("Auto_increment" => 0, "Rows" => 0) as $key => $val) {
if ($table_status[$key] != "") {
$val = number_format($table_status[$key], 0, '.', lang(','));
json_row("$key-$id", ($key == "Rows" && $table_status["Engine"] == "InnoDB" && $val ? "~ $val" : $val));
json_row("$key-$id", ($key == "Rows" && $val && (
$table_status["Engine"] == "InnoDB" || // MySQL InnoDB
$table_status["Engine"] == "table" // PostgreSQL table reltype
) ? "~ $val" : $val));
if (isset($sums[$key])) {
$sums[$key] += ($table_status["Engine"] != "InnoDB" || $key != "Data_free" ? $table_status[$key] : 0);
}