This repository has been archived by the owner on Dec 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(schema): sort queries into subdirs
- Loading branch information
Showing
15 changed files
with
73 additions
and
70 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
18 changes: 18 additions & 0 deletions
18
schema/query/alert-mem-slow.sql → schema/query/alert/instance-memory.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
schema/query/alert-root-slow.sql → schema/query/alert/instance-root.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-- get chunk sizes | ||
SELECT | ||
hypertable_name, | ||
chunk_name, | ||
compressed_total_bytes, | ||
uncompressed_total_bytes | ||
FROM timescaledb_information.compressed_chunk_stats | ||
WHERE compression_status = 'Compressed'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- get compression ratio | ||
SELECT | ||
hypertable_name, | ||
1 - AVG(pg_size_bytes(compressed_total_bytes)::float / pg_size_bytes(uncompressed_total_bytes)) AS compression_ratio | ||
FROM timescaledb_information.compressed_chunk_stats | ||
WHERE compression_status = 'Compressed' | ||
GROUP BY hypertable_name; |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
-- get labels size | ||
SELECT | ||
nspname || '.' || relname AS "relation", | ||
pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size" | ||
FROM pg_class C | ||
LEFT JOIN pg_namespace N | ||
ON (N.oid = C.relnamespace) | ||
WHERE | ||
nspname NOT IN ('pg_catalog', 'information_schema') AND | ||
C.relkind <> 'i' AND | ||
nspname !~ '^pg_toast' AND | ||
relname LIKE 'metric%' | ||
ORDER BY pg_total_relation_size(C.oid) DESC; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-- get table sizes | ||
SELECT | ||
CONCAT(table_schema, '.', table_name), | ||
num_dimensions, | ||
num_chunks, | ||
total_size | ||
FROM timescaledb_information.hypertable; | ||
-- this can have a WHERE table_name LIKE 'metric%', but that will | ||
-- omit compressed and aggregate hypertables from the list |
File renamed without changes.