Re: Number of tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 1, 2009 at 1:19 AM, Mike Ivanov<mikei@xxxxxxxxxxxxxxx> wrote:
>> i am developing a web app for thousands users (1.000/2.000).
>>
>> Each user have a 2 table of work...I finally have 2.000 (users) x 2 tables
>> = 4.000 tables!
>
> As a someone with a ~50K-table database, I can tell you it's definitely
> possible to survive with such a layout :-)

The usual recommendation is to have a single table (or two tables in
this case) with userid forming part of the primary key in addition to
whatever identifies the records within the user's set of data. You may
not expect to be need to run queries which combine multiple users'
data now but you will eventually.

This doesn't work so great when each user is going to be specifying
their own custom schema on the fly but that's not really what
relational databases were designed for. For that you might want to
look into the hstore contrib module or  something like CouchDB (which
can be combined with Postgres I hear)


-- 
greg
http://mit.edu/~gsstark/resume.pdf

-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux