"cydatamatt@gmail.com" <cydatamatt@gmail.com> writes:
> We currently have around 400,000 tables
> and I would estimate that the vast majority of these tables are
> relatively small (less than 200 rows).
Stop right there, and go redesign your schema. This is unbelievably
wrong :-(
regards, tom lane