Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Database/JDBC/SQL/JDO/Hibernate  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 为什么SELECT *会比SELECT XXXX性能差?
gaoxt1983





发贴: 67
积分: 0
于 2007-03-09 12:24 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
在用数据库查询的时候,我们被告知不要使用SELECT *,因为会有很大的性能问题,据说是要查一次数据字典,是这样吗?我平时也是这么做的,但是刚才拿了一个表试了一下,发现没有问题啊,是不是因为oracle优化了?如果是FROM一个自查询,可以用SELECT *吗?刚才看jforum源码,它就是写的SELECT *……


作者 Re:为什么SELECT *会比SELECT XXXX性能差? [Re:gaoxt1983]
vincekai





发贴: 1
积分: 0
于 2007-03-27 23:48 user profilesend a private message to usersend email to vincekaisearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
数据量小的情况下没有问题,
数据量很大的情况下,你每次都全部检索,会很费时间,
影响响应速度.
有些复杂的操作是多次查询表的,
所以不推荐使用select *
要检索你想要得到的字段比较好.



学无止境啊.
作者 Re:为什么SELECT *会比SELECT XXXX性能差? [Re:gaoxt1983]
JiafanZhou



版主


发贴: 736
积分: 61
于 2007-03-28 03:08 user profilesend a private message to usersend email to JiafanZhousearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
I agree with Vincekai.


When I was a kid I used to pray every night for a new bike. Then I realized that The Lord doesn't work that way, so I stole one and asked him to forgive me.
作者 Re:为什么SELECT *会比SELECT XXXX性能差? [Re:HenryShanley]
YuLimin

简单就是美

版主


发贴: 866
积分: 123
于 2007-03-30 21:31 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
记得在做ASP + MS SQL时,一个表有十几个字段
Select xxx,xxxx From T,就少一个Memo的字段,就会比
Select * From T
快挺多,具体忘记了。

数据量在五十万以上。



 当兵不后悔!后悔不当兵! 
超越黎明时空,追逐时代潮流!
人,是要靠自己的!简单就是美!
我的Java:http://www.Java2Class.net
我的Blog:http://YuLimin.ItEye.com
作者 Re:为什么SELECT *会比SELECT XXXX性能差? [Re:gaoxt1983]
fangkeliu





发贴: 1
积分: 0
于 2008-08-20 18:16 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
I agree with Vincekai.
这个是oracle sql优化 要注意的




flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923