Skip to content

Instantly share code, notes, and snippets.

View and800's full-sized avatar

Andrii Maletskyi and800

  • Kyiv
  • 09:13 (UTC +03:00)
View GitHub Profile
@and800
and800 / disksize.sql
Created June 17, 2022 14:53
postgres disk size per table
SELECT *, pg_size_pretty(total_bytes) AS total
, pg_size_pretty(index_bytes) AS INDEX
, pg_size_pretty(toast_bytes) AS toast
, pg_size_pretty(table_bytes) AS TABLE
FROM (
SELECT *, total_bytes-index_bytes-COALESCE(toast_bytes,0) AS table_bytes
FROM (
SELECT c.oid,nspname AS table_schema, relname AS TABLE_NAME
, c.reltuples AS row_estimate
, pg_total_relation_size(c.oid) AS total_bytes
@and800
and800 / Dockerfile
Last active October 16, 2016 13:15
Cron Docker image example
FROM debian:jessie
RUN apt-get update && apt-get install -y --no-install-recommends cron
COPY crontab.txt /etc/crontab
RUN chmod 644 /etc/crontab
CMD ["cron", "-f"]