Is there a way I can analyze all the tables in a schema with one command? This one doesn't work:
Code: Select all
dbadmin=> select analyze_statistics('mydata_wh');
ERROR 2065: analyze_statistics: Invalid table/projection/column mydata_wh
Moderator: NorbertKrupa
Code: Select all
dbadmin=> select analyze_statistics('mydata_wh');
ERROR 2065: analyze_statistics: Invalid table/projection/column mydata_wh
Code: Select all
select analyze_statistics('');
Code: Select all
dbadmin=> \t
Tuples only is off.
dbadmin=> \t
Showing only tuples.
dbadmin=> \o /usr/home/dbadmin/analyze.sql
dbadmin=> select 'select analyze_statistics(''' || table_schema || '.' || table_name || ''');' from tables where table_schema = 'myschema';
dbadmin=> \o
dbadmin=> \i /usr/home/dbadmin/analyze.sql
0
0
0
0
0
0
0
etc...