I hereby claim:
- I am mcorsen on github.
- I am macorsen (https://keybase.io/macorsen) on keybase.
- I have a public key ASBv2-qM9sxjyd5CjC0uhCx9L01sra9fA9bc90MJNmQlmAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
-- Size of all schemas ordered by percent of total size | |
SELECT schema_name, | |
pg_size_pretty(sum(table_size)::bigint), | |
(sum(table_size) / pg_database_size(current_database())) * 100 AS percent | |
FROM ( | |
SELECT pg_catalog.pg_namespace.nspname as schema_name, | |
pg_relation_size(pg_catalog.pg_class.oid) as table_size | |
FROM pg_catalog.pg_class | |
JOIN pg_catalog.pg_namespace ON relnamespace = pg_catalog.pg_namespace.oid | |
) t |
SELECT | |
table_name, | |
pg_size_pretty(table_size) AS table_size, | |
pg_size_pretty(indexes_size) AS indexes_size, | |
pg_size_pretty(total_size) AS total_size | |
FROM ( | |
SELECT | |
table_name, | |
pg_table_size(table_name) AS table_size, | |
pg_indexes_size(table_name) AS indexes_size, |
SELECT pg_database.datname, | |
pg_size_pretty(pg_database_size(pg_database.datname)) AS size | |
FROM pg_database | |
ORDER BY pg_database_size(pg_database.datname) DESC; |
SELECT usename, client_addr, waiting, backend_start, query_start, procpid, current_query | |
FROM pg_stat_activity | |
ORDER BY usename, client_addr, backend_start; |
SELECT | |
l1.relation::regclass AS blocked_relation, | |
l1.pid AS blocked_pid, | |
a1.usename AS blocked_user, | |
a1.current_query AS blocked_query, | |
now() - a1.query_start AS blocked_time, | |
l2.pid AS blocking_pid, | |
a2.usename AS blocking_user, | |
a2.current_query AS blocking_query, | |
l2.virtualtransaction, |
#!/bin/bash | |
# | |
# chkconfig: 2345 90 12 | |
# description: Description of service here | |
# | |
### BEGIN INIT INFO | |
# Provides: Short service name here | |
# Required-Start: $remote_fs $network $syslog | |
# Required-Stop: $remote_fs $network $syslog | |
# Default-Start: 3 5 |
#!/bin/bash | |
if [[ $# -lt 3 ]] | |
then | |
echo "Usage: $0: <dir> <file pattern> <num days old>" | |
exit 1 | |
fi | |
dir=$1 | |
file_pattern=$2 |