Re: Number of tables

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Number of tables
Дата
Msg-id 407d949e0908311801w40889599s3e004588fba70428@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Number of tables  (Mike Ivanov <mikei@activestate.com>)
Ответы Re: Number of tables  (Mike Ivanov <mikei@activestate.com>)
Список pgsql-performance
On Tue, Sep 1, 2009 at 1:19 AM, Mike Ivanov<mikei@activestate.com> 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

В списке pgsql-performance по дате отправления:

Предыдущее
От: Mike Ivanov
Дата:
Сообщение: Re: Number of tables
Следующее
От: Mike Ivanov
Дата:
Сообщение: Re: Number of tables