Fast way of getting count of all rows in a very long table: (https://stackoverflow.com/a/7945274)
SELECT reltuples::bigint AS estimate FROM pg_class where relname='mytable';
OR
SELECT reltuples::bigint AS estimate FROM pg_class WHERE oid = 'myschema.mytable'::regclass;
(if there's a schema)
and fast way of getting count of rows across all partitions (https://stackoverflow.com/a/30594273):
SELECT
SUM(child.reltuples) AS number_of_records_all_partitions
FROM pg_inherits
JOIN pg_class parent ON pg_inherits.inhparent = parent.oid
JOIN pg_class child ON pg_inherits.inhrelid = child.oid
JOIN pg_namespace nmsp_parent ON nmsp_parent.oid = parent.relnamespace
JOIN pg_namespace nmsp_child ON nmsp_child.oid = child.relnamespace
WHERE parent.relname = 'my_table_name';
cgroups error in docker then do this as temporary fix docker/for-linux#219 (comment) OR here it is
Temp fix:
sudo mkdir /sys/fs/cgroup/systemd
sudo mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd