Hi all,
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?
Here is a sample of the log:
2010-07-03 23:49:31 SAST LOG: execute <unnamed>: SELECT attnotnull
FROM pg_catalog.pg_attribute WHERE attrelid = $1 AND attnum = $2
2010-07-03 23:49:31 SAST DETAIL: parameters: $1 = '29427', $2 = '4'
2010-07-03 23:49:31 SAST LOG: execute <unnamed>: SELECT def.adsrc
FROM pg_catalog.pg_class c JOIN pg_catalog.pg_attribute a ON
(a.attrelid=c.oid) LEFT JOIN pg_catalog.pg_attrdef def ON
(a.attrelid=def.adrelid AND a.attnum = def.adnum) WHERE c.oid = $1 and
a.attnum = $2 AND def.adsrc LIKE '%nextval(%'
2010-07-03 23:49:31 SAST DETAIL: parameters: $1 = '29427', $2 = '4'
2010-07-03 23:49:31 SAST LOG: execute <unnamed>: SELECT attnotnull
FROM pg_catalog.pg_attribute WHERE attrelid = $1 AND attnum = $2
2010-07-03 23:49:31 SAST DETAIL: parameters: $1 = '29427', $2 = '5'
2010-07-03 23:49:31 SAST LOG: execute <unnamed>: SELECT def.adsrc
FROM pg_catalog.pg_class c JOIN pg_catalog.pg_attribute a ON
(a.attrelid=c.oid) LEFT JOIN pg_catalog.pg_attrdef def ON
(a.attrelid=def.adrelid AND a.attnum = def.adnum) WHERE c.oid = $1 and
a.attnum = $2 AND def.adsrc LIKE '%nextval(%'
2010-07-03 23:49:31 SAST DETAIL: parameters: $1 = '29427', $2 = '5'
2010-07-03 23:49:31 SAST LOG: execute <unnamed>: SELECT attnotnull
FROM pg_catalog.pg_attribute WHERE attrelid = $1 AND attnum = $2
2010-07-03 23:49:31 SAST DETAIL: parameters: $1 = '29427', $2 = '8'
2010-07-03 23:49:31 SAST LOG: execute <unnamed>: SELECT def.adsrc
FROM pg_catalog.pg_class c JOIN pg_catalog.pg_attribute a ON
(a.attrelid=c.oid) LEFT JOIN pg_catalog.pg_attrdef def ON
(a.attrelid=def.adrelid AND a.attnum = def.adnum) WHERE c.oid = $1 and
a.attnum = $2 AND def.adsrc LIKE '%nextval(%'
2010-07-03 23:49:31 SAST DETAIL: parameters: $1 = '29427', $2 = '8'
2010-07-03 23:49:31 SAST LOG: execute <unnamed>: SELECT attnotnull
FROM pg_catalog.pg_attribute WHERE attrelid = $1 AND attnum = $2
2010-07-03 23:49:31 SAST DETAIL: parameters: $1 = '29427', $2 = '9'
2010-07-03 23:49:31 SAST LOG: execute <unnamed>: SELECT def.adsrc
FROM pg_catalog.pg_class c JOIN pg_catalog.pg_attribute a ON
(a.attrelid=c.oid) LEFT JOIN pg_catalog.pg_attrdef def ON
(a.attrelid=def.adrelid AND a.attnum = def.adnum) WHERE c.oid = $1 and
a.attnum = $2 AND def.adsrc LIKE '%nextval(%'
2010-07-03 23:49:31 SAST DETAIL: parameters: $1 = '29427', $2 = '9'
2010-07-03 23:49:31 SAST LOG: execute <unnamed>: SELECT attnotnull
FROM pg_catalog.pg_attribute WHERE attrelid = $1 AND attnum = $2
2010-07-03 23:49:31 SAST DETAIL: parameters: $1 = '29427', $2 = '7'
2010-07-03 23:49:31 SAST LOG: execute <unnamed>: SELECT def.adsrc
FROM pg_catalog.pg_class c JOIN pg_catalog.pg_attribute a ON
(a.attrelid=c.oid) LEFT JOIN pg_catalog.pg_attrdef def ON
(a.attrelid=def.adrelid AND a.attnum = def.adnum) WHERE c.oid = $1 and
a.attnum = $2 AND def.adsrc LIKE '%nextval(%'
2010-07-03 23:49:31 SAST DETAIL: parameters: $1 = '29427', $2 = '7'
2010-07-03 23:49:31 SAST LOG: execute <unnamed>: SELECT attnotnull
FROM pg_catalog.pg_attribute WHERE attrelid = $1 AND attnum = $2
2010-07-03 23:49:31 SAST DETAIL: parameters: $1 = '29427', $2 = '10'
2010-07-03 23:49:31 SAST LOG: execute <unnamed>: SELECT def.adsrc
FROM pg_catalog.pg_class c JOIN pg_catalog.pg_attribute a ON
(a.attrelid=c.oid) LEFT JOIN pg_catalog.pg_attrdef def ON
(a.attrelid=def.adrelid AND a.attnum = def.adnum) WHERE c.oid = $1 and
a.attnum = $2 AND def.adsrc LIKE '%nextval(%'
2010-07-03 23:49:31 SAST DETAIL: parameters: $1 = '29427', $2 = '10'
2010-07-03 23:49:31 SAST LOG: execute <unnamed>: SELECT attnotnull
FROM pg_catalog.pg_attribute WHERE attrelid = $1 AND attnum = $2
2010-07-03 23:49:31 SAST DETAIL: parameters: $1 = '29427', $2 = '6'
2010-07-03 23:49:31 SAST LOG: execute <unnamed>: SELECT def.adsrc
FROM pg_catalog.pg_class c JOIN pg_catalog.pg_attribute a ON
(a.attrelid=c.oid) LEFT JOIN pg_catalog.pg_attrdef def ON
(a.attrelid=def.adrelid AND a.attnum = def.adnum) WHERE c.oid = $1 and
a.attnum = $2 AND def.adsrc LIKE '%nextval(%'
2010-07-03 23:49:31 SAST DETAIL: parameters: $1 = '29427', $2 = '6'
Regards,
Graham
--
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general