测试了下,结果不对啊,并没有给出合适的索引建议,是我使用不对吗?
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 30/100
Research direction
Start by reproducing the report with ./sqladvisor -f sql.cnf -v 1 using the shown MySQL table, data, and query. Inspect how the advisor handles the WHERE condition and the show index from test result; done means explaining whether the missing recommendation is expected or identifying a reproducible defect.
Written by the indexing model from the issue text.
Description
mysql> show create table test\G
*************************** 1. row ***************************
Table: test
Create Table: CREATE TABLE test (
id bigint(20) DEFAULT NULL,
name char(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
用下面的存储过程插入100000条数据
create procedure test()
begin
declare i bigint;
set i=0;
while i<100000 do
insert into test values(i,cast(i as char(10)));
set i=i+1;
end while;
end;//
mysql> SHOW TABLE STATUS\G
*************************** 1. row ***************************
Name: test
Engine: InnoDB
Version: 10
Row_format: Dynamic
Rows: 99937
Avg_row_length: 47
Data_length: 4734976
Max_data_length: 0
Index_length: 0
Data_free: 4194304
Auto_increment: NULL
Create_time: 2017-11-06 09:52:16
Update_time: 2017-11-06 11:53:32
Check_time: NULL
Collation: utf8_general_ci
Checksum: NULL
Create_options:
Comment:
1 row in set (0.00 sec)
[root@szxts10011040 sqladvisor]# cat sql.cnf
[sqladvisor]
username=graTemp
password=*****
host=*****
port=50006
dbname=lych
sqls=select * from lych.test where id=1000;
[root@szxts10011040 sqladvisor]# ./sqladvisor -f sql.cnf -v 1
2017-11-06 13:51:35 66459 [Note] 2017-11-06 13:51:35 66459 [Note] 第2步:开始解析where中的条件:(id = 1000)
2017-11-06 13:51:35 66459 [Note] show index from test
2017-11-06 13:51:35 66459 [Note] 第3步:SQLAdvisor结束!表中没有任何索引
- Dominant language
- C
- Stars
- 5.6k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Meituan-Dianping/SQLAdvisor
-
修复了一些安装问题和代码bugOpen
Difficulty 5/5 Over a week Newbie friendliness 25/100
Meituan-Dianping/SQLAdvisor#100 ·
-
有纯洁的docker 镜像么?Open
Difficulty 4/5 3-5 days Newbie friendliness 20/100
-
连接访问不到Open
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
Meituan-Dianping/SQLAdvisor#97 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in Meituan-Dianping/SQLAdvisor
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
research-radar
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
"systemctl is-system-running --wait" may hang indefinitely for non-root usersPossibly taken @alexonea claimed this today. Openbug 🐛 systemctl
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
testing: DISK test reads the wrong directory entry offset on H89Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
FujiNetWIFI/fujinet-lib#115 · 1 comment ·
Maintainers usually reply within 1 day