Re: Scale, Normalization, and Table Count

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tom Cross <decius(at)whack(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Scale, Normalization, and Table Count
Date: 2002-10-07 15:06:24
Message-ID: 23780.1034003184@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Cross <decius(at)whack(dot)org> writes:
> Much to my horror I got an error message while attempting to back up my
> database tonight:

> pg_dump: NOTICE: ShmemAlloc: out of memory
> pg_dump: Attempt to lock table "thread_204" failed. ERROR: LockAcquire:
> lock table 1 is out of memory

> Obviously this is related to my shared memory allocations.

The easiest response to this is to increase your
max_locks_per_transaction parameter in postgresql.conf.
The default (64) seems to be plenty for most people, as we hear reports
of such problems only once in a blue moon. But you're right that a
system with many thousands of tables might need more.

> There are, lets say, 1000 messages on each topic. Users will only access
> one topic at a time. It seems intuitive that it would be less expensive
> to create an individual table for each topic then it would be to put all
> of the messages in a single table.

I concur with the nearby responses that say this is indeed a bad design.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-10-07 15:21:57 Re: [pgsql-performance] Large databases, performance
Previous Message Tom Lane 2002-10-07 15:00:06 Re: Trouble compiling postgresql in hp-unix