Skip to content

[multistage][backward-incompat][feature] index not being used for some filter #9976

@walterddr

Description

@walterddr

query like

SELECT * FROM tbl WHERE strCol = 123 
  • this can apply inverted index on strCol just fine in V1 b/c V1 engine is not type-aware; thus the filter clause gets converted into =(strCol, '123')
  • this will be translated to CAST(strCol AS INT) = 123 in V2 b/c it is type-aware and b/c of this function application, it doesn't apply index properly.

There's 2 solutions

  1. do not allow these type of implicit type casting at all (e.g. query must explicitly ask for CAST or failed type mismatch) this will avoid the potential performance degradation but will make some V1 query backward-incompatible
  2. do the smart rewrite rule to convert this to a left-cast not a right-cast; this will potentially have many corner cases to handle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    multi-stageRelated to the multi-stage query engine

    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