Re: Querying sporadic time series type data.

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Querying sporadic time series type data.
Дата
Msg-id CAKFQuwbzZ5jDUqPVY3Wwu=_QB7BjLtxLGHJP0J=qU2Yyd3j7_w@mail.gmail.com
обсуждение исходный текст
Ответ на Querying sporadic time series type data.  (Tim Uckun <timuckun@gmail.com>)
Ответы Re: Querying sporadic time series type data.  (Tim Uckun <timuckun@gmail.com>)
Список pgsql-sql
On Fri, Oct 2, 2020 at 10:45 PM Tim Uckun <timuckun@gmail.com> wrote:
I am warehousing my health data in PG. Some of this data comes from my
phone/watch but some I enter in manually. Basically this is similar to
a time series metric collection type of scenario.

My first impression is that you should use a timeseries database for this, not PostgreSQL.

If you do try to use SQL to do this you indeed run into the problem of handling SQL's requirement that every column be explicitly defined.  You can probably work around this somewhat by writing a query generator instead of hard-coding queries.  Though for your current level of knowledge I'd suggest putting forth working queries for the current model and forget about how easy or hard dealing with change would be.  Or at least be more convincing that change adaption is an important requirement.

Your data type issue is self-inflicted.  Create a composite data type for blood pressure.  Expanding upon that, you should have a table for each metric - or at least be willing to find middle-ground where some are grouped on one table (either as rows or columns) and some are separate tables.

None of this is impossible in PostgreSQL.  Its a matter of development effort and performance.  Put forth something that works - or at least kinda works and note where specifically in the code you are stuck - if you want non-conceptual help overcoming a specific problem.

David J.

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

Предыдущее
От: Tim Uckun
Дата:
Сообщение: Querying sporadic time series type data.
Следующее
От: Tim Uckun
Дата:
Сообщение: Re: Querying sporadic time series type data.