Re: Correct/optimal DML query for application session management ?

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: Correct/optimal DML query for application session management ?
Дата
Msg-id 7DD40C2A-1698-4C3F-BA26-49974C468AEE@gmail.com
обсуждение исходный текст
Ответ на Correct/optimal DML query for application session management ?  (Tim Smith <randomdev4+postgres@gmail.com>)
Список pgsql-general
> On 06 Jan 2015, at 19:02, Tim Smith <randomdev4+postgres@gmail.com> wrote:
> create table app_sessions(
> session_id char(64) unique not null,
> user_id char(32) unique not null,
> session_start bigint not null,
> session_lastactive bigint not null
> );

Just an observation: Are you sure that you don’t want to allow your users to have multiple sessions? You made users
uniqueacross the entire table, which mean there can only ever be one session for a user. Unless you delete ‘expired’
sessionsASAP, users won’t be able to start a new session again after their original session expired. 
That may be desirable for your application and thus intended, but perhaps it was not?

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.



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

Предыдущее
От: Andy Colson
Дата:
Сообщение: Re: Correct/optimal DML query for application session management ?
Следующее
От: Michael Heaney
Дата:
Сообщение: Re: Advice for using integer arrays?