"Joe Maldonado" <jmaldonado@webehosting.biz> writes
> I suspect that pg_class has too many pages (49182 as below) and for
> some reason the above commands spend a lot of time updating it.
> vacuum/analyze on pg_class has not helped. Also, since the time taken
> for these commands is not consistently fast or slow, I'm puzzled.
>
Statistics (reltuples, relpages) from pg_class is not always fresh. If you
want to "reduce" the size of table, run vacuum with "full" option. Also, you
may want to examine that the time is not caused by checkpoints or locks.
Regards,
Qingqing