291 pg_toast_temp schemas?

Started by Josh Berkusalmost 14 years ago7 messagesbugs
Jump to latest
#1Josh Berkus
josh@agliodbs.com

summary: database has 291 empty pg_toast_temp schemas.
severity: head-scratcher
version: 9.0.7
platform: RHEL6

description:

* medium-large production database (300GB)
* does data collection and analytics
* lately has been having chronic lock-blocking issues
* does many, daily batch jobs which involve the creation of many temp
tables.

Today, while investigating the lock-blocking issues, I noticed that the
db has pg_toast_temp_1 through 291. All of these schema are completely
empty:

breakpad=# select schemaname, relname from pg_stat_all_tables where
schemaname LIKE 'pg_toast_temp_%';
schemaname | relname
------------+---------

... so, apparently we still have an issue with cleaning up pg_toast_temp
schema?

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Josh Berkus (#1)
Re: 291 pg_toast_temp schemas?

Josh Berkus <josh@agliodbs.com> writes:

summary: database has 291 empty pg_toast_temp schemas.

If your max_connections is 300 or more, this isn't surprising in the
least.

... so, apparently we still have an issue with cleaning up pg_toast_temp
schema?

If they are empty, no we don't have a problem with cleaning them up.
The pg_namespace entries are deliberately left there across sessions,
to avoid useless catalog churn.

regards, tom lane

#3Josh Berkus
josh@agliodbs.com
In reply to: Tom Lane (#2)
Re: 291 pg_toast_temp schemas?

On 4/26/12 11:22 AM, Tom Lane wrote:

Josh Berkus <josh@agliodbs.com> writes:

summary: database has 291 empty pg_toast_temp schemas.

If your max_connections is 300 or more, this isn't surprising in the
least.

Yes, they are.

... so, apparently we still have an issue with cleaning up pg_toast_temp
schema?

If they are empty, no we don't have a problem with cleaning them up.
The pg_namespace entries are deliberately left there across sessions,
to avoid useless catalog churn.

Aha, ok. Should I add a FAQ item about this?

Also, have we discussed maybe hiding these schemas from \dn?

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

#4Jaime Casanova
jcasanov@systemguards.com.ec
In reply to: Josh Berkus (#3)
Re: 291 pg_toast_temp schemas?

On Thu, Apr 26, 2012 at 5:35 PM, Josh Berkus <josh@agliodbs.com> wrote:

Also, have we discussed maybe hiding these schemas from \dn?

+1 from this idea... maybe do them visible only on \dn+

--
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte 24x7 y capacitación

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Josh Berkus (#3)
Re: 291 pg_toast_temp schemas?

Josh Berkus <josh@agliodbs.com> writes:

Also, have we discussed maybe hiding these schemas from \dn?

We've done more than discuss it:
http://git.postgresql.org/gitweb/?p=postgresql.git&amp;a=commitdiff&amp;h=e43fb604d6db229d70d3101aa53348cc16a5473a

I take it you're using something older than 9.1.

regards, tom lane

#6Jaime Casanova
jcasanov@systemguards.com.ec
In reply to: Tom Lane (#5)
Re: 291 pg_toast_temp schemas?

On Thu, Apr 26, 2012 at 5:48 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Josh Berkus <josh@agliodbs.com> writes:

Also, have we discussed maybe hiding these schemas from \dn?

We've done more than discuss it:
http://git.postgresql.org/gitweb/?p=postgresql.git&amp;a=commitdiff&amp;h=e43fb604d6db229d70d3101aa53348cc16a5473a

I take it you're using something older than 9.1.

that's a quick reaction :D

--
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte 24x7 y capacitación

#7Josh Berkus
josh@agliodbs.com
In reply to: Tom Lane (#5)
Re: 291 pg_toast_temp schemas?

On 4/26/12 3:48 PM, Tom Lane wrote:

Josh Berkus <josh@agliodbs.com> writes:

Also, have we discussed maybe hiding these schemas from \dn?

We've done more than discuss it:
http://git.postgresql.org/gitweb/?p=postgresql.git&amp;a=commitdiff&amp;h=e43fb604d6db229d70d3101aa53348cc16a5473a

I take it you're using something older than 9.1.

Yep, 9.0.7 per bug.

Thanks!

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com