mirror of
https://github.com/pgpointcloud/pointcloud.git
synced 2025-12-08 20:36:04 +00:00
Add relation sizes (main, toasts, indexes)
This commit is contained in:
parent
022708bcba
commit
c052d38e0b
@ -125,6 +125,21 @@ foreach $a (@ARGV) {
|
||||
print "\n[$tn:$col]\n";
|
||||
|
||||
my $info = query(<<"EOF"
|
||||
select pg_size_pretty(pg_relation_size('${tn}')), -- main
|
||||
-- toasts
|
||||
pg_size_pretty(pg_table_size('${tn}')-pg_relation_size('${tn}')),
|
||||
-- indexes
|
||||
pg_size_pretty(pg_total_relation_size('${tn}')-pg_table_size('${tn}')),
|
||||
-- total
|
||||
pg_size_pretty(pg_total_relation_size('${tn}'))
|
||||
EOF
|
||||
);
|
||||
my @info = split '\|', $info;
|
||||
|
||||
print ' Relation size: ' . $info[0] . ' + ' . $info[1]
|
||||
. ' + ' . $info[2] . ' = ' . $info[3] . " (M+T+I)\n";
|
||||
|
||||
$info = query(<<"EOF"
|
||||
SELECT CASE WHEN attstorage = 'm' THEN 'main'
|
||||
WHEN attstorage = 'e' THEN 'external'
|
||||
WHEN attstorage = 'p' THEN 'plain'
|
||||
@ -193,7 +208,7 @@ from \"${tn}\"
|
||||
EOF
|
||||
);
|
||||
|
||||
my @info = split '\|', $info;
|
||||
@info = split '\|', $info;
|
||||
#print ' Info: ' . join(',', @info) . "\n";
|
||||
print ' Total patch column size: ' . $info[7] . "\n";
|
||||
print ' Patches: ' . $info[0] . "\n";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user