Skip to content

Derive per-query aggregation-heaviness + NDV metadata #24116

Description

@Rich-T-kid

Is your feature request related to a problem or challenge?

Whether dictionary-encoding a column helps depends not just on its cardinality but on how heavily it's aggregated in the query. There's no existing signal that combines both.

Describe the solution you'd like

Derive metadata that combines NDV with an estimate of aggregation "heaviness" for a given query plan. Heavy aggregation + low NDV = more room for error/benefit if we decide to cast to dictionary arrays early; this signal should be usable by the optimizer.

Describe alternatives you've considered

No response

Additional context

sub-issue of : #22891
part of epic : #24111

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions