How to check the size of table in postgresql - 在PostgreSQL 如何查詢資料庫Table大小

May 5, 2024·
Chi Yau
Chi Yau
· 1 min read
post PostgreSQL

之前介紹了如何查詢PostgreSQL資料庫大小
但是其實可能只是某幾個Table 佔用位置的大小會比較多
所以便找了一個 SQL Statement 來查詢Table 的大小

解法方法:

select pg_size_pretty(pg_table_size('[TABLE_NAME]'));

Query to check PostgreSQL table size
Query to check PostgreSQL table size

Hope you find it useful

Chi Yau
Authors
App Dev
I’m Chi, a passionate tech enthusiast exploring the latest innovations in GenAI, LLMs, web development, performance tuning, and cybersecurity. As a tech guy at a startup, I aim to share my experiences, insights, and lessons learned in the fast-paced world of technology. Join me on this journey as we dive into the exciting challenges and triumphs of building and scaling tech solutions!