Re: Querying sporadic time series type data.

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Querying sporadic time series type data.
Дата
Msg-id CAKFQuwY14gequNuS4=s+ed-dD85BHOC8yxR0Gthvd4uh=q=45w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Querying sporadic time series type data.  (Tim Uckun <timuckun@gmail.com>)
Ответы Re: Querying sporadic time series type data.  (Steven Pousty <steve.pousty@gmail.com>)
Список pgsql-sql
The convention here is to inline or bottom-post.

On Saturday, October 3, 2020, Tim Uckun <timuckun@gmail.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.

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

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