User Tools

Site Tools


sysadmin:postgresql

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
sysadmin:postgresql [2014/11/25 08:48] – wiki syntax ferodasysadmin:postgresql [2014/11/25 17:17] – occupazione db feroda
Line 72: Line 72:
     * [5] = ... tabelle vuote     * [5] = ... tabelle vuote
  
-====== Occupazione disco per tabelle ======+====== Occupazione disco ====== 
 + 
 +===== Database ===== 
 + 
 +Lo restituisce pure in formato carino :) 
 + 
 +# select (pg_database_size(current_database())/(1024*1024))::text || ' MB' as db_size; 
 + 
 +===== Tabelle =====
  
 Restituisce un elenco ordinato in modo discendente di: Restituisce un elenco ordinato in modo discendente di:
Line 96: Line 104:
             FROM information_schema.tables              FROM information_schema.tables 
             WHERE table_schema NOT IN ('information_schema', 'pg_catalog'             WHERE table_schema NOT IN ('information_schema', 'pg_catalog'
-        ORDER BY size DESC, total_size DESC LIMIT 20+        ORDER BY size DESC, total_size DESC
     ) AS basic_infos      ) AS basic_infos 
         JOIN pg_class         JOIN pg_class