1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
SET client_min_messages TO error;
CREATE TABLE DatabaseDiskUtilization (
date_created timestamp without time zone
DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') NOT NULL,
namespace text NOT NULL,
name text NOT NULL,
sub_namespace text,
sub_name text,
kind char NOT NULL,
sort text NOT NULL,
table_len bigint NOT NULL,
tuple_count bigint NOT NULL,
tuple_len bigint NOT NULL,
tuple_percent float8 NOT NULL,
dead_tuple_count bigint NOT NULL,
dead_tuple_len bigint NOT NULL,
dead_tuple_percent float8 NOT NULL,
free_space bigint NOT NULL,
free_percent float8 NOT NULL,
CONSTRAINT databasediskutilization_pkey PRIMARY KEY (date_created, sort)
) WITH (fillfactor=100);
CREATE OR REPLACE VIEW LatestDatabaseDiskUtilization AS
SELECT * FROM DatabaseDiskUtilization
WHERE date_created = (SELECT max(date_created) FROM DatabaseDiskUtilization);
INSERT INTO LaunchpadDatabaseRevision VALUES (2208, 43, 0);
|