📄️ First and Last
The first and last aggregates in TimescaleDB return the value of a column at the smallest or largest value of another column, typically the time column. They answer questions like "what was the opening and closing price of each day" without a window function or a sub-query. The CmdScale.EntityFrameworkCore.TimescaleDB package translates EF.Functions.First(...) and EF.Functions.Last(...) LINQ calls inside a GroupBy directly to first(value, time) and last(value, time) SQL.
📄️ TimeBucket
The timebucket function in TimescaleDB partitions time-series rows into fixed-width intervals, enabling efficient GROUP BY, SELECT, and ORDER BY operations over time. The CmdScale.EntityFrameworkCore.TimescaleDB package translates EF.Functions.TimeBucket(...) LINQ calls directly to timebucket(...) SQL, so no raw SQL strings are required in application queries.