Graham Leggett <minfrin@sharp.fm> writes:
> I am currently trying to analyse some performance problems within my
> postgresql v8.4.4 database, and after successfully turning sql
> statement logging on, I discover thousands and thousands of queries
> being made what looks like an internal postgresql set of tables in a
> database called "pg_catalog".
> These queries vastly outnumber the queries to the real database, which
> are lost in the noise.
> Does anyone recognise what these statements are for, whether they are
> necessary, and if they aren't necessary, how to switch them off?
I'd bet that you are using a client-side driver that feels a need to
fetch metadata about the tables it's working with. JDBC or ODBC maybe?
A reasonable driver would cache such information, so if there are enough
of these to present a performance issue, maybe the problem is you're
using too short-lived database connections.
regards, tom lane