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-04 00:10:38
Message-ID: CAKFQuwY14gequNuS4=s+ed-dD85BHOC8yxR0Gthvd4uh=q=45w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

The convention here is to inline or bottom-post.

On Saturday, October 3, 2020, Tim Uckun <timuckun(at)gmail(dot)com> wrote:

> Given the scale I am working at I thought a specific time scale
> database would be overkill but I'll look into it nevertheless. Even
> if I do write the queries with the known metrics I am still trying to
> figure out how to efficiently query "last known value of this metric
> on or before X time" without a correlated subquery which would be a
> massively inefficient query.
>

Yes, if the time is arbitrary you are stuck with a where clause,
sort-and-limit. DISTINCT ON can be useful for returning multiple entities
over the same metric.

Indexes, possibly partial (if you don’t normalize the model), should help.

Even massively inefficient can be efficient enough...

David J.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Steven Pousty 2020-10-04 00:42:14 Re: Querying sporadic time series type data.
Previous Message Tim Uckun 2020-10-03 23:53:01 Re: Querying sporadic time series type data.