Timestream queries without scanning all the records

0

We are monitoring a water meter that constantly increments the total gallons of water that have passed through the meter, thus we don't need to look at all the data in order to figure out what the total gallons are at points in between (though if data is missing we'd want to interpolate). We're trying to write a query that will provide us with the total gallons used at the end of each day. Here's an example:

  SELECT BIN(time, 1d) as binned_timestamp, devEui, ROUND(MAX(totalGallons), 2) as max_totalGallons 
  FROM "SensorData"."ApplicationData"
  WHERE time between ago(30d) and now() and devEui = 'A840419E8182DCBF' 
  GROUP BY devEui, BIN(time,1d) 
  ORDER BY binned_timestamp ASC

However, this queries all the data, where all we really need to look at is the last data point for each day. Thoughts?

질문됨 2년 전95회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠