Skip to content

[Enhancement]: Add native support for timestamps in 2 variable regressionΒ #879

@beasteers

Description

@beasteers

What type of enhancement is this?

API improvement

What subsystems and features will be improved?

Command processing, Continuous aggregate

What does the enhancement do?

It took me a little bit to figure out how to do continuous aggregate regression using time as the X variable. Given that it's a time series database, it could make sense to have built-in handling for timestamps as a dependent variable.

i.e. add a function overload for stats_agg(real, timestamp) input types.

The current solution for me was

slope(stats_agg(some_variable::real, extract(epoch from time AT TIME ZONE 'UTC')))

which is a bit verbose and I'm unsure if there are performance implications or if the query planner can de-duplicate them fine.

Implementation challenges

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions