Created
January 16, 2026 09:53
-
-
Save dcube9/4a652c2b5d7ad2a4a257c6b9de596daf to your computer and use it in GitHub Desktop.
POSTGRESQL - Conta i record di tutte le tabelle di un database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- 1) Aggiorna le statistiche di tutte le tabelle del database corrente | |
| ANALYZE; | |
| -- 2) Leggi le stime aggiornate per tutte le tabelle utente | |
| SELECT | |
| schemaname AS schema_name, | |
| relname AS table_name, | |
| n_live_tup AS row_count_estimated | |
| FROM pg_stat_user_tables | |
| ORDER BY schemaname, relname; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment