> Hi All: > > Does postgresql support schema analyze. I could not find > analyze schema anywhere. Can we create a function to run > analyze and reindex on all objects in the schema. Any > suggestions or ideas.
Yes "we" certainly can...
begin;
create function foo(sch text) returns void as
$$ declare sql text;
begin
for sql in select format('analyze verbose %s.%s', schemaname, tablename) from pg_tables where schemaname = sch