Skip to content

TiDB doesn't deduplicate the argument of the IN function #61246

@winoros

Description

@winoros

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t(a int);

explain select * from t where a in (1,1,1,1,1,1,1);

2. What did you expect to see? (Required)

the duplicate 1 should be eliminated

3. What did you see instead (Required)

mysql> explain select * from t where a in (1,1,1,1,1,1,1);
+----------------------------+----------+--------------+---------------+----------------------------------------------------------+
| id                         | estRows  | task         | access object | operator info                                            |
+----------------------------+----------+--------------+---------------+----------------------------------------------------------+
| TableReader_16             | 10.00    | root         |               | MppVersion: 3, data:ExchangeSender_15                    |
| └─ExchangeSender_15        | 10.00    | mpp[tiflash] |               | ExchangeType: PassThrough                                |
|   └─Selection_14           | 10.00    | mpp[tiflash] |               | in(test.t.a, 1, 1, 1, 1, 1, 1, 1)                        |
|     └─TableFullScan_13     | 10000.00 | mpp[tiflash] | table:t       | pushed down filter:empty, keep order:false, stats:pseudo |
+----------------------------+----------+--------------+---------------+----------------------------------------------------------+
4 rows in set (0.01 sec)

4. What is your TiDB version? (Required)

current master

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-6.5This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.affects-8.5This bug affects the 8.5.x(LTS) versions.component/expressionseverity/moderatesig/executionSIG executionsig/plannerSIG: Plannertype/bugThe issue is confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions