SQL执行效率问题
2009-12-23 11:25
239 查看
44万数据测试
两个存储过程内容如下:
1、
select note from table where cityID='1'
2、
WITH temp AS
(
SELECT * FROM city WHERE cityid=1
UNION ALL
SELECT city .* FROM city
INNER JOIN temp ON city .professionParent=temp.cityid
)
SELECT table .note FROM table
INNER JOIN temp ON table .cityid=temp.cityid
那个执行速度最快
两个存储过程内容如下:
1、
select note from table where cityID='1'
2、
WITH temp AS
(
SELECT * FROM city WHERE cityid=1
UNION ALL
SELECT city .* FROM city
INNER JOIN temp ON city .professionParent=temp.cityid
)
SELECT table .note FROM table
INNER JOIN temp ON table .cityid=temp.cityid
那个执行速度最快
相关文章推荐
- 【ORACLE】记录通过执行Oracle的执行计划查询SQL脚本中的效率问题
- Oracle的SQL语句执行效率问题查找与解决方法
- SQL中in和exists的区别和执行效率问题解析
- Oracle的SQL语句执行效率问题查找与解决方法
- 关于不同sql语句执行效率的问题
- Oracle执行计划 SQL语句执行效率问题查找与解决方法
- 关于数据库优化2——关于表的连接顺序,和where子句的前后顺序,是否会影响到sql的执行效率问题
- 请教sql执行效率问题(inner join 和 where)
- Oracle中SQL语句执行效率问题的查找与解决
- Oracle的SQL语句执行效率问题查找与解决方法
- oracle的SQL语句执行效率问题查找与解决方法
- MySQL 5.7 优化SQL提升100倍执行效率的深度思考(GO)
- 关于sql语句的执行效率测试
- 关于sql里left join的效率问题
- 参数绑定导致java执行查询sql效率低
- SQL各种写法的效率问题
- java使用"+"拼装sql和hql引起的效率问题
- 关于No Dialect mapping for JDBC type :-9 hibernate执行原生sql语句问题
- Hibernate named parameter 传参书写方式,同样Hibernate帮我们做了预编译,可以防止sql注入,同时可以一定程度上加快sql执行效率,也利于后期维护
- 关于No Dialect mapping for JDBC type :-9 hibernate执行原生sql语句问题 .