Re: SQL statement logging: picking up strange queries from "pg_catalog" - Mailing list pgsql-general

From Tom Lane
Subject Re: SQL statement logging: picking up strange queries from "pg_catalog"
Date
Msg-id 18060.1278197371@sss.pgh.pa.us
Whole thread Raw
In response to SQL statement logging: picking up strange queries from "pg_catalog"  (Graham Leggett <minfrin@sharp.fm>)
Responses Re: SQL statement logging: picking up strange queries from "pg_catalog"
List pgsql-general
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

pgsql-general by date:

Previous
From: Graham Leggett
Date:
Subject: SQL statement logging: picking up strange queries from "pg_catalog"
Next
From: Graham Leggett
Date:
Subject: Re: SQL statement logging: picking up strange queries from "pg_catalog"