Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

analyze too slowly with 100k partition #57573

Closed
hawkingrei opened this issue Nov 21, 2024 · 0 comments · Fixed by #57574
Closed

analyze too slowly with 100k partition #57573

hawkingrei opened this issue Nov 21, 2024 · 0 comments · Fixed by #57574
Labels
affects-8.5 This bug affects the 8.5.x(LTS) versions. severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@hawkingrei
Copy link
Member

hawkingrei commented Nov 21, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create many tables like this, then analyze it.

 CREATE TABLE `sbtest1` (                                                         
   `id` int NOT NULL AUTO_INCREMENT,                                              
   `k` int NOT NULL DEFAULT '0',                                                  
   `c` char(120) NOT NULL DEFAULT '',                                             
   `pad` char(60) NOT NULL DEFAULT '',                                            
   `ec1` varchar(40) DEFAULT NULL,                                                
   `ec2` varchar(40) DEFAULT NULL,                                                
   `ec3` varchar(40) DEFAULT NULL,                                                
   `ec4` varchar(40) DEFAULT NULL,                                                
   `ec5` varchar(40) DEFAULT NULL,                                                
   `ec6` varchar(40) DEFAULT NULL,                                                
   `ec7` varchar(40) DEFAULT NULL,                                                
   `ec8` varchar(40) DEFAULT NULL,                                                
   `ec9` varchar(40) DEFAULT NULL,                                                
   `ec10` varchar(40) DEFAULT NULL,                                               
   PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,                         
   KEY `k_1` (`k`),                                                               
   KEY `ek1` (`ec1`(30)),                                                         
   KEY `ek2` (`ec2`(30)),                                                         
   KEY `ek3` (`ec3`(30)),                                                         
   KEY `ek4` (`ec4`(30))                                                          
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=30001 
 PARTITION BY RANGE (`id`)                                                        
 (PARTITION `p1` VALUES LESS THAN (1001),                                         
  PARTITION `p2` VALUES LESS THAN (2001),                                         
  PARTITION `p3` VALUES LESS THAN (3001),                                         
  PARTITION `p4` VALUES LESS THAN (4001),                                         
  PARTITION `p5` VALUES LESS THAN (5001),                                         
  PARTITION `p6` VALUES LESS THAN (6001),                                         
  PARTITION `p7` VALUES LESS THAN (7001),                                         
  PARTITION `p8` VALUES LESS THAN (8001),                                         
  PARTITION `p9` VALUES LESS THAN (9001),                                         
  PARTITION `p10` VALUES LESS THAN (MAXVALUE))                                    

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

it should be quick.

3. What did you see instead (Required)

but it is very slow.
image

4. What is your TiDB version? (Required)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-8.5 This bug affects the 8.5.x(LTS) versions. severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant