Skip to content

Time column predicates are invalidating use of star-tree indices #6478

@subourbonite

Description

@subourbonite

In some cases, time-column predicates are disqualifying queries from using star-trees, when they would otherwise be used. Specifically, this appears to be the case when using a dynamic timestamp comparison against the now() operator:

SELECT dimension, SUM(metric) AS totalMetrics FROM myTable WHERE otherDimension='filterValue' AND eventTimestamp >= cast(now() - 172800000 as long) GROUP BY 1 ORDER BY 2 DESC LIMIT 10

where a query that uses a static value for timestamp comparison will use a star-tree:
SELECT dimension, SUM(metric) AS totalMetrics FROM myTable WHERE otherDimension='filterValue' AND eventTimestamp >= 1611161288000 GROUP BY 1 ORDER BY 2 DESC LIMIT 10

Thanks to @mayankshriv, I'll try to put together a PR to address.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions