Fix index length with Postgresql
This commit is contained in:
parent
1a6186648c
commit
4c78976cba
|
@ -244,7 +244,7 @@ ORDER BY 1";
|
||||||
|
|
||||||
function table_status($name = "") {
|
function table_status($name = "") {
|
||||||
$return = array();
|
$return = array();
|
||||||
foreach (get_rows("SELECT relname AS \"Name\", CASE relkind WHEN 'r' THEN 'table' WHEN 'mv' THEN 'materialized view' WHEN 'f' THEN 'foreign table' ELSE 'view' END AS \"Engine\", pg_relation_size(oid) AS \"Data_length\", pg_total_relation_size(oid) - pg_relation_size(oid) AS \"Index_length\", obj_description(oid, 'pg_class') AS \"Comment\", relhasoids::int AS \"Oid\", reltuples as \"Rows\"
|
foreach (get_rows("SELECT relname AS \"Name\", CASE relkind WHEN 'r' THEN 'table' WHEN 'mv' THEN 'materialized view' WHEN 'f' THEN 'foreign table' ELSE 'view' END AS \"Engine\", pg_relation_size(oid) AS \"Data_length\", pg_indexes_size(oid) AS \"Index_length\", obj_description(oid, 'pg_class') AS \"Comment\", relhasoids::int AS \"Oid\", reltuples as \"Rows\"
|
||||||
FROM pg_class
|
FROM pg_class
|
||||||
WHERE relkind IN ('r','v','mv','f')
|
WHERE relkind IN ('r','v','mv','f')
|
||||||
AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema())
|
AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema())
|
||||||
|
|
Loading…
Reference in a new issue