Tebak-tebakan lucu (part 3)

A : Apa beda matahari sama bulan?
B : Matahari ada diskon, bulan enggak ada

A : Apa bedanya balapan kuda sama balapan motor ?
B : Kalau balapan kuda ada tempat parkir motor, kalau balapan motor ngga ada tempat parkir kudanya

A : Kuda apa yg paling capek..??
B : kuda..ki gunung sambil jongkok

A : Kecoa apa yang masuk rumah sakit?
B : Kecoalakaan lalu lintas

Continue reading

Get Postgresql DB size and table sizes

Get DB Size:

SELECT pg_size_pretty(pg_database_size(‘databasename’)) As fulldbsize;

 

Get All Table size from one Database:

SELECT schemaname, tablename,
pg_size_pretty(size) AS size_pretty,
pg_size_pretty(total_size) AS total_size_pretty
FROM (SELECT *,
pg_relation_size(schemaname||’.’||tablename) AS size,
pg_total_relation_size(schemaname||’.’||tablename) AS total_size
FROM pg_tables) AS TABLES
WHERE schemaname=’public’
ORDER BY total_size DESC;