InfluxElixir.Client.Local.SQLRange (InfluxElixir v0.1.40)

Copy Markdown View Source

What a WHERE leaves of a scan's ranges, for InfluxElixir.Client.Local: the failures the engine raises while planning the scan (verified against InfluxDB 3 Core).

The scan's time range is the intersection of the comparisons of time among the top-level conjuncts of the WHERE. When they leave no instant (time > X AND time < X, BETWEEN with its bounds reversed, adjacent exclusive bounds: an open range holds nothing between two consecutive nanoseconds) the planner fails the query. What the optimizer settles first is not an error: two different instants that time equals, an instant it both equals and differs from, time IS NULL, a constant false, and time > '2262-04-11T23:47:16.854775807Z', which no instant satisfies and answers no rows with or without another bound. An OR hides its branches, a NOT is pushed in, a bound that is NULL says nothing, and now() is one instant for the whole statement. A LIMIT 0 plans no scan, and a filter on a CTE that aggregates or limits does not reach the table.

The comparisons of a numeric column with literals that leave it no value fail in the engine's interval analysis (see InfluxElixir.Client.Local.SQLBounds); this module reads each column's type once for the whole query.

Summary

Functions

The planner's error for a WHERE whose time conjuncts leave no instant, or :ok. pushdown is whether a filter reaches the table the query reads.

The engine's error for a WHERE whose top-level comparisons leave a numeric column no value, or :ok. integer_type tells an Int64 column from a UInt64 one, which the stored integers do not; cte? is whether the query filters a CTE. A LIMIT 0 plans no scan.

Functions

check_time(query, arg2)

The planner's error for a WHERE whose time conjuncts leave no instant, or :ok. pushdown is whether a filter reaches the table the query reads.

check_values(query, points, integer_type, cte?)

The engine's error for a WHERE whose top-level comparisons leave a numeric column no value, or :ok. integer_type tells an Int64 column from a UInt64 one, which the stored integers do not; cte? is whether the query filters a CTE. A LIMIT 0 plans no scan.