Re: Querying sporadic time series type data. - Mailing list pgsql-sql

From David G. Johnston
Subject Re: Querying sporadic time series type data.
Date
Msg-id CAKFQuwbzZ5jDUqPVY3Wwu=_QB7BjLtxLGHJP0J=qU2Yyd3j7_w@mail.gmail.com
Whole thread Raw
In response to Querying sporadic time series type data.  (Tim Uckun <timuckun@gmail.com>)
Responses Re: Querying sporadic time series type data.  (Tim Uckun <timuckun@gmail.com>)
List 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 by date:

Previous
From: Tim Uckun
Date:
Subject: Querying sporadic time series type data.
Next
From: Tim Uckun
Date:
Subject: Re: Querying sporadic time series type data.