Re: Querying sporadic time series type data.

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tim Uckun <timuckun(at)gmail(dot)com>
Cc: pgsql-sql <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: Re: Querying sporadic time series type data.
Date: 2020-10-03 16:11:23
Message-ID: CAKFQuwbzZ5jDUqPVY3Wwu=_QB7BjLtxLGHJP0J=qU2Yyd3j7_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, Oct 2, 2020 at 10:45 PM Tim Uckun <timuckun(at)gmail(dot)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.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tim Uckun 2020-10-03 23:53:01 Re: Querying sporadic time series type data.
Previous Message Tim Uckun 2020-10-03 05:44:40 Querying sporadic time series type data.