Re: Approach to Data Summary and Analysis

Поиск
Список
Период
Сортировка
От Vincent Veyron
Тема Re: Approach to Data Summary and Analysis
Дата
Msg-id 20140415143703.1028f1e903cec95361bb68cb@wanadoo.fr
обсуждение исходный текст
Ответ на Re: Approach to Data Summary and Analysis  (Robert DiFalco <robert.difalco@gmail.com>)
Ответы Re: Approach to Data Summary and Analysis
Список pgsql-general
On Mon, 14 Apr 2014 15:22:13 -0700
Robert DiFalco <robert.difalco@gmail.com> wrote:

Hi Robert,

> But then I lose a bunch of data like the TIMESTAMPTZ of the call, answer,
> connection, etc. Btw, currently these tables never need to be UPDATEd. They
> are immutable in the current design.

Yes, but you wrote :

>Occasionally I will want to know things like "When was the last time a user
>answered a call" or "How many times has a user been called".

With your schema, you would have to query several tables each time. Queries will get messy in a hurry, updates and DDL
changestoo. 


> And in the end I'm not sure how the
> proposal of one table and a state that is updatable changes the basic
> thrust of the question. For example, getting last call, last answered,
> total called, total answered. If the state of a call transitions from
> called to answered then making it a field loses all the data with the
> previous state, make sense?
>

If you need this, you can use a schema that accommodates it.

(off the top of my head, insert a new record instead of altering an existing one, and create a hierarchy with parent
recordsthat point to an original call, may be with a 'parent' field and recursive queries. You probably have many
requirementsthat I'm not aware of, but this one can be met) 


--
                    Salutations, Vincent Veyron

http://marica.fr
Gestion des contentieux juridiques, des contrats et des sinistres d'assurance


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

Предыдущее
От: Willy-Bas Loos
Дата:
Сообщение: [GENARAL] round() bug?
Следующее
От: Robert DiFalco
Дата:
Сообщение: Re: Approach to Data Summary and Analysis