buildDerivedQuery
buildDerivedQuery(
schema,tMin?,maxPoints?,tMax?):string
Defined in: db/store.ts:53
Build a SELECT query for derived quantities with optional query-time downsampling via time-bucket partitioning.
When maxPoints is specified and > 0, divides the time range into maxPoints equal-duration buckets and picks the first point in each bucket. This ensures even temporal coverage regardless of data density — critical when sparse overview data and dense streaming data coexist in the same table.
Parameters
Section titled “Parameters”schema
Section titled “schema”number
maxPoints?
Section titled “maxPoints?”number
number
Returns
Section titled “Returns”string