Skip to content

Track TopN freshness and runtime skew join follow-ups #20087

Description

@KKould

Background

This PR implements skew join by deriving hot keys from TopN statistics at planning time. Because hot-key detection depends on TopN, TopN freshness is important: stale or analyze-only TopN can make skew join miss real hot keys or make unreliable decisions.

TODO

  1. Improve TopN freshness.

Skew join should not only rely on manual ANALYZE. We need to investigate maintaining TopN during append, similar to snapshot statistics freshness, so hot-key statistics are fresh enough for optimizer decisions.

  1. Support a runtime skew join path.

The current implementation is planner-driven. We should also investigate a runtime version: first distribute rows through normal hash-shuffle channels, detect hot keys while building the hash table, then redistribute hot-key rows again through skew-join channels. This would cover cases where TopN is missing, stale, or not useful for the query.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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