Skip to content

Index using aliases does not work in new versions #98822

@maniak89

Description

@maniak89

Company or project name

No response

Describe what's wrong

In version 24.2.3.70, the index using the alias works correctly, but in higher versions, judging by the demo example, it is no longer taken into account.
Additionally, a test was run with tracing enabled SET send_logs_level = 'trace' on the local machine - this also showed no index usage.

https://fiddle.clickhouse.com/2ff3e680-a838-486c-b66e-74dc022ee259

Does it reproduce on the most recent release?

Yes

How to reproduce

https://fiddle.clickhouse.com/2ff3e680-a838-486c-b66e-74dc022ee259

Expected behavior

query result

Expression ((Projection + Before ORDER BY))
  Limit (preliminary LIMIT (without OFFSET))
    Expression
      ReadFromMergeTree (default.test_indexs)
      Indexes:
        MinMax
          Condition: true
          Parts: 8/8
          Granules: 50003/50003
        Partition
          Condition: true
          Parts: 8/8
          Granules: 50003/50003
        PrimaryKey
          Condition: true
          Parts: 8/8
          Granules: 50003/50003
        Skip
          Name: idx_alias_int_minmax
          Description: minmax GRANULARITY 1
          Parts: 8/8
          Granules: 37507/50003

Error message and/or stacktrace

query result

Expression ((Project names + Projection))
  Limit (preliminary LIMIT (without OFFSET))
    Expression
      ReadFromMergeTree (default.test_indexs)
      Indexes:
        MinMax
          Condition: true
          Parts: 8/8
          Granules: 50002/50002
        Partition
          Condition: true
          Parts: 8/8
          Granules: 50002/50002
        PrimaryKey
          Condition: true
          Parts: 8/8
          Granules: 50002/50002

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    analyzerIssues and pull-requests related to new analyzerbugConfirmed user-visible misbehaviour in official release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions