Re: CREATE TABLE with a name derived from a string

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: CREATE TABLE with a name derived from a string
Дата
Msg-id 873cmpihm8.fsf@stark.dyndns.tv
обсуждение исходный текст
Ответ на CREATE TABLE with a name derived from a string  (JSavage@data-mate.com (Savage))
Список pgsql-general
JSavage@data-mate.com (Savage) writes:

> I am creating a DB for a multi user IM system. Each user can store
> their history. Each user also has a unique ID. There will be many
> users and a lot of history will be generated by each user, so we are
> going to create a history table per user, with a tablename that is
> derived from the unique userid.

As others have mentioned this is a bad idea. A really really bad idea.

On option is to just put userid first in your primary key and use it on all
lookups. That's what indexes are for.

--
greg

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

Предыдущее
От: "Raymond O'Donnell"
Дата:
Сообщение: Re: Postgres Windows ADO help needed
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Why must SELECT DISTINCT, ORDER BY expressions must appear in target list?