Skip to content

Instantly share code, notes, and snippets.

@jdvor
jdvor / sg.md
Last active October 27, 2020 09:12
table description
account List of accounts with access to DES Portal and SmartGrid.API.
account__device Just the mapping table between Account and Device tables.
account__permission_role Just the mapping table between Account and PermissionRole tables.
adapter List of device adapters.
alerts Triggered alerts per device.
apikey SmartGrid.Api API keys.
automat_group_internal_beats Cron expressions per group of devices
@jdvor
jdvor / pgsql_object_size.sql
Created March 12, 2019 19:15
Get list of big objects (tables, indexes) in PostgreSQL database. The list is sorted by size descending.
SELECT
relname AS objectname,
relkind AS objecttype,
reltuples AS "#entries", pg_size_pretty(relpages::bigint*8*1024) AS size
FROM pg_class
WHERE relpages >= 8
ORDER BY relpages DESC;