pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Andrews <tandrews@soliantconsulting.com>
To: Y Sidhu <ysidhu@gmail.com>
Cc: Gregory Stark <stark@enterprisedb.com>
Cc: Mark Lewis <mark.lewis@mir3.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Thousands of tables versus on table?
Date: Mon, 04 Jun 2007 16:14:14 -0400
Message-ID: <C289EAD6.A79%tandrews@soliantconsulting.com> (raw)
In-Reply-To: <b09064f30706041308o40faf0ccl5a8a48a1f36eedbb@mail.gmail.com>

Linux 2.4.9, if I¹m reading this right.

=thomas


On 6/4/07 4:08 PM, "Y Sidhu" <ysidhu@gmail.com> wrote:

> On 6/4/07, Thomas Andrews <tandrews@soliantconsulting.com> wrote:
>> 
>> 
>> 
>> On 6/4/07 3:43 PM, "Gregory Stark" <stark@enterprisedb.com> wrote:
>> 
>>> >
>>> > "Thomas Andrews" < tandrews@soliantconsulting.com
>>> <mailto:tandrews@soliantconsulting.com> > writes:
>>> >
>>>> >> I guess my real question is, does it ever make sense to create thousands
of
>>>> >> tables like this?
>>> >
>>> > Sometimes. But usually it's not a good idea.
>>> >
>>> > What you're proposing is basically partitioning, though you may not
>>> actually
>>> > need to put all the partitions together for your purposes. Partitioning's
>>> main
>>> > benefit is in the management of the data. You can drop and load partitions
>>> in 
>>> > chunks rather than have to perform large operations on millions of
>>> records.
>>> >
>>> > Postgres doesn't really get any faster by breaking the tables up like
>>> that. In
>>> > fact it probably gets slower as it has to look up which of the thousands
>>> of 
>>> > tables you want to work with.
>>> >
>>> > How often do you update or delete records and how many do you update or
>>> > delete? Once per day is a very low frequency for vacuuming a busy table,
>>> you
>>> > may be suffering from table bloat. But if you never delete or update
>>> records 
>>> > then that's irrelevant.
>> 
>> It looks like the most inserts that have occurred in a day is about 2000.
>> The responders table has 1.3 million records, the responses table has 50
>> million records.  Most of the inserts are in the responses table.
>> 
>>> >
>>> > Does reindexing or clustering the table make a marked difference?
>>> >
>> 
>> Clustering sounds like it might be a really good solution.  How long does a
>> cluster command usually take on a table with 50,000,000 records?  Is it
>> something that can be run daily/weekly?
>> 
>> I'd rather not post the schema because it's not mine - I'm a consultant.  I
>> can tell you our vacuum every night is taking 2 hours and that disk IO is
>> the real killer - the CPU rarely gets higher than 20% or so.
>> 
>> =thomas
>> 
>> 
>> ---------------------------(end of broadcast)---------------------------
>> TIP 5: don't forget to increase your free space map settings
> 
> 
> What OS are you running on?
> 

view thread (36+ messages)  latest in thread

Message-ID: <C289EAD6.A79%tandrews@soliantconsulting.com>
Permalink:  ../C289EAD6.A79%25tandrews@soliantconsulting.com/
Also on:    postgresql.org/message-id/C289EAD6.A79%tandrews@soliantconsulting.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tandrews@soliantconsulting.com, ysidhu@gmail.com, stark@enterprisedb.com, mark.lewis@mir3.com
  Subject: Re: Thousands of tables versus on table?
  In-Reply-To: <C289EAD6.A79%tandrews@soliantconsulting.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox