数据库优化
1、对查询进行优化,要尽量避免全表扫描,首先应该考虑在where和order by涉及的列上建立索引
	说人话就是:少用*号
2、应该尽量避免在where子句中对字段进行null值判断,否则将导致搜索会放弃索引进行全盘扫描
	例如:select id from where num is null (这样不好)
   这种情况应当在设计数据库的时候尽量避免,最好不要用null给列初始化值
3、尽量避免使用!=或者<>操作符,否则搜索引擎会放弃索引搜索,从而全盘搜索
4、尽量避免在where语句中使用or来连接条件,如果一个字段有索引,另一个字段没有索引,那么它就会放弃使用索引,从而全盘搜索
	(假设num有索引,name没有索引)
	例如:select id from t where num=10 or name="admin"(这样不行)
	可以这样查询
	select id from t where num=10
	union all
	select id from t where Name="admin"
5、in和not in也要慎重,否则也会导致全表扫描
	例如 select id from t where num in (1,2,3)
	我们可以换成 select id from t where between 1 and 3
	或者我们可以用exists