Skip to content

add index for small partition table on v8.1.0 is slower than it on v7.5.1 #54230

@seiya-annie

Description

@seiya-annie

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists tt1, tt2;
set global tidb_partition_prune_mode='dynamic';
set session tidb_partition_prune_mode='dynamic';
CREATE TABLE tt1 (
    id INT NOT NULL,
    listid INT,
    name varchar(10),
    primary key (listid) clustered
)
PARTITION BY LIST (listid) (
    PARTITION p1 VALUES IN (1),
    PARTITION p2 VALUES IN (2),
    PARTITION p3 VALUES IN (3),
    PARTITION p4 VALUES IN (4)
);
CREATE TABLE tt2 (
    id INT NOT NULL,
    listid INT
);
create index idx_listid on tt1(id,listid);
create index idx_listid on tt2(listid);

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

3. What did you see instead (Required)

on v7.5.1 cluster

mysql> create index idx_listid on tt1(id,listid);
Query OK, 0 rows affected (0.58 sec)

mysql> create index idx_listid on tt2(listid);
Query OK, 0 rows affected (0.51 sec)

on v8.1.0 and nightly cluster

mysql> create index idx_listid on tt1(id,listid);
Query OK, 0 rows affected (1.99 sec)

mysql> create index idx_listid on tt2(listid);
Query OK, 0 rows affected (1.35 sec)

tidb_enable_dist_task is off in v7.5.1, and on in 8.1.0

4. What is your TiDB version? (Required)

v8.1.0 and master

Metadata

Metadata

Assignees

Labels

component/ddlThis issue is related to DDL of TiDB.type/enhancementThe issue or PR belongs to an enhancement.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions