SQL优化手册
1、in vs or
对索引字段或非索引字段单个值操作时,两者无异;但是对非索引字段多个值操作,相比in,or效率会随着值的个数增加效率相对下滑
2、group by vs distinct
案例:select count() from (select name from student group by name )student_temp
这个sql作用是统计学生表不重复姓名的总数
优化方案1:select count(distinct name) from student
SQL优化手册
1、in vs or
对索引字段或非索引字段单个值操作时,两者无异;但是对非索引字段多个值操作,相比in,or效率会随着值的个数增加效率相对下滑
2、group by vs distinct
案例:select count() from (select name from student group by name )student_temp
这个sql作用是统计学生表不重复姓名的总数
优化方案1:select count(distinct name) from student
虚拟学校
管理一个虚拟的学生学校。
usage: main.py [-h] {add,list,remove} ...
Manage a virtual school of students.
positional arguments:
{add,list,remove} The subcommand to run.
optional arguments:
-h, --help show this help message and exit
例子
请参阅帮助手册中的a