pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christopher Browne <cbbrowne@acm.org>
To: pgsql-sql@postgresql.org
Subject: Re: Design question: Scalability and tens of thousands of tables?
Date: Fri, 04 Nov 2005 18:59:08 -0500
Message-ID: <m3mzkk7ynn.fsf@mobile.int.cbbrowne.com> (raw)
References: <200511041459.jA4ExAAY009623@www.commandprompt.com>
	<0B8DCA82-39EE-4444-9412-20779E51CCDD@socialserve.com>

> On Nov 4, 2005, at 9:47 AM, pgsql-sql-owner@postgresql.org wrote:
>
>> The problem is I am very concerned about scalability with having a
>> different
>> table created for each custom object.  I want to design to site to
>> handle
>> tens of thousands of users.  If each user has 3-5 custom objects the
>> database would have to handle tens of thousands of tables.
>>
>> So it would appear that this is a broken solution and will not
>> scale.  Has
>> anyone designed a similar system or have ideas to share?
>
> Well, before you discount it, did you try out your design? You could
> do initial segregation of user's tables into separate schemas (say,
> schema 'a' -> 'z' according to username or some better hashing
> routine like brute-force round-robin assignment at user creation
> time). Assignment of objects -> schema would be one additional column
> in your centralized user directory table(s).

I don't imagine this would help much with the *true* problem, which is
that a lot of queries inside the DB would have tens of thousands of
tables to go thru rather than (say) hundreds.

If you have 10,000 tables, that means 10,000 entries in pg_class.

Associating them with 26 (or 260) namespaces does nothing to assist
any queries that still have to scan through 10K pg_class entries.
-- 
(reverse (concatenate 'string "moc.liamg" "@" "enworbbc"))
http://linuxfinances.info/info/wp.html
"Whenever you  find that you  are on the  side of the majority,  it is
time to reform." -- Mark Twain



view thread (6+ messages)  latest in thread

Message-ID: <m3mzkk7ynn.fsf@mobile.int.cbbrowne.com>
Permalink:  ../m3mzkk7ynn.fsf@mobile.int.cbbrowne.com/
Also on:    postgresql.org/message-id/m3mzkk7ynn.fsf@mobile.int.cbbrowne.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-sql@postgresql.org
  Cc: cbbrowne@acm.org
  Subject: Re: Design question: Scalability and tens of thousands of tables?
  In-Reply-To: <m3mzkk7ynn.fsf@mobile.int.cbbrowne.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