﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-幽灵谷-最新评论</title><link>http://www.blogjava.net/youling/CommentsRSS.aspx</link><description>面对挑战，我告诉自己：面对是勇气，积极面对是态度，坚持积极面对是毅力！</description><language>zh-cn</language><pubDate>Tue, 06 Sep 2011 04:40:46 GMT</pubDate><lastBuildDate>Tue, 06 Sep 2011 04:40:46 GMT</lastBuildDate><generator>cnblogs</generator><item><title>re: sql语句的执行顺序--简介</title><link>http://www.blogjava.net/youling/archive/2011/09/07/243177.html#358226</link><dc:creator>GavinMiao</dc:creator><author>GavinMiao</author><pubDate>Wed, 07 Sep 2011 10:32:00 GMT</pubDate><guid>http://www.blogjava.net/youling/archive/2011/09/07/243177.html#358226</guid><description><![CDATA[顶，不错！<img src ="http://www.blogjava.net/youling/aggbug/358226.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/youling/" target="_blank">GavinMiao</a> 2011-09-07 18:32 <a href="http://www.blogjava.net/youling/archive/2011/09/07/243177.html#358226#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 千万级sql优化[未登录]</title><link>http://www.blogjava.net/youling/archive/2011/09/07/358076.html#358181</link><dc:creator>roger</dc:creator><author>roger</author><pubDate>Wed, 07 Sep 2011 07:00:00 GMT</pubDate><guid>http://www.blogjava.net/youling/archive/2011/09/07/358076.html#358181</guid><description><![CDATA[用到了sum、exists、union all、group by，还有多个select语句，即使80秒能够返回数据的话，是否会影响其他查询的访问呢？是否会lock table呢？问题太多了<br><br>个人建议：<br>　　1，对sql进行拆分<br>　　2，为了性能，创建索引表<br>　　3，即使sql优化了，关系型数据库的数据达到了7千万也会存在查询缓慢的问题，请考虑其他方式进行数据的存储，比如Mongodb<br>　　4，使用搜索(lucene、sphinx)来进行查询获取结果<br><br>总之，数据量达到这种程度了，应该考虑从架构的角度解决问题，sql上可优化的实在有限<img src ="http://www.blogjava.net/youling/aggbug/358181.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/youling/" target="_blank">roger</a> 2011-09-07 15:00 <a href="http://www.blogjava.net/youling/archive/2011/09/07/358076.html#358181#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 千万级sql优化</title><link>http://www.blogjava.net/youling/archive/2011/09/07/358076.html#358160</link><dc:creator>黑色幽灵</dc:creator><author>黑色幽灵</author><pubDate>Wed, 07 Sep 2011 02:56:00 GMT</pubDate><guid>http://www.blogjava.net/youling/archive/2011/09/07/358076.html#358160</guid><description><![CDATA[10楼的这位仁兄，好像是把内层的嵌套查询由union all改成or了，但是，我感觉应该是union all的效率更高一些把，完全是个人意见，欢迎讨论。<img src ="http://www.blogjava.net/youling/aggbug/358160.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/youling/" target="_blank">黑色幽灵</a> 2011-09-07 10:56 <a href="http://www.blogjava.net/youling/archive/2011/09/07/358076.html#358160#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 千万级sql优化[未登录]</title><link>http://www.blogjava.net/youling/archive/2011/09/06/358076.html#358147</link><dc:creator>大鹏</dc:creator><author>大鹏</author><pubDate>Tue, 06 Sep 2011 14:15:00 GMT</pubDate><guid>http://www.blogjava.net/youling/archive/2011/09/06/358076.html#358147</guid><description><![CDATA[最好给出表结构，能看出表之间的关系，还有索引之类的，能更好的做优化。<img src ="http://www.blogjava.net/youling/aggbug/358147.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/youling/" target="_blank">大鹏</a> 2011-09-06 22:15 <a href="http://www.blogjava.net/youling/archive/2011/09/06/358076.html#358147#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 千万级sql优化[未登录]</title><link>http://www.blogjava.net/youling/archive/2011/09/06/358076.html#358141</link><dc:creator>YY</dc:creator><author>YY</author><pubDate>Tue, 06 Sep 2011 12:13:00 GMT</pubDate><guid>http://www.blogjava.net/youling/archive/2011/09/06/358076.html#358141</guid><description><![CDATA[select a.tcol2, a.departcode, a.sendtime, sum(a.mainamount) mainamount<br>  from sf02 a<br> where <br>   exists<br> (<br>	select 1 from sf01 b <br>	where (b.businessnature = '531') or (b.businessnature = '532'<br>  and a.policyno = b.policyno))<br>  and (a.kindcode = 'R21' or a.kindcode = 'R29')<br>  and a.insert_time &lt;= to_date('2011-09-05', 'yyyy-MM-dd')<br>  and a.insert_time &gt;= to_date('2000-08-25', 'yyyy-MM-dd')<br>and a.ksdm = '11019204'<br> group by a.tcol2, a.departcode, a.sendtime<img src ="http://www.blogjava.net/youling/aggbug/358141.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/youling/" target="_blank">YY</a> 2011-09-06 20:13 <a href="http://www.blogjava.net/youling/archive/2011/09/06/358076.html#358141#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 千万级sql优化</title><link>http://www.blogjava.net/youling/archive/2011/09/06/358076.html#358133</link><dc:creator>黑色幽灵</dc:creator><author>黑色幽灵</author><pubDate>Tue, 06 Sep 2011 09:55:00 GMT</pubDate><guid>http://www.blogjava.net/youling/archive/2011/09/06/358076.html#358133</guid><description><![CDATA[8楼这位仁兄，能否介绍的详细一些？<img src ="http://www.blogjava.net/youling/aggbug/358133.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/youling/" target="_blank">黑色幽灵</a> 2011-09-06 17:55 <a href="http://www.blogjava.net/youling/archive/2011/09/06/358076.html#358133#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 千万级sql优化</title><link>http://www.blogjava.net/youling/archive/2011/09/06/358076.html#358127</link><dc:creator>信息</dc:creator><author>信息</author><pubDate>Tue, 06 Sep 2011 09:20:00 GMT</pubDate><guid>http://www.blogjava.net/youling/archive/2011/09/06/358076.html#358127</guid><description><![CDATA[这明显可以做成一个batch job嘛<img src ="http://www.blogjava.net/youling/aggbug/358127.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/youling/" target="_blank">信息</a> 2011-09-06 17:20 <a href="http://www.blogjava.net/youling/archive/2011/09/06/358076.html#358127#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 千万级sql优化</title><link>http://www.blogjava.net/youling/archive/2011/09/06/358076.html#358123</link><dc:creator>黑色幽灵</dc:creator><author>黑色幽灵</author><pubDate>Tue, 06 Sep 2011 08:45:00 GMT</pubDate><guid>http://www.blogjava.net/youling/archive/2011/09/06/358076.html#358123</guid><description><![CDATA[非常感谢你的回复，呵呵<img src ="http://www.blogjava.net/youling/aggbug/358123.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/youling/" target="_blank">黑色幽灵</a> 2011-09-06 16:45 <a href="http://www.blogjava.net/youling/archive/2011/09/06/358076.html#358123#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 千万级sql优化</title><link>http://www.blogjava.net/youling/archive/2011/09/06/358076.html#358122</link><dc:creator>@joe</dc:creator><author>@joe</author><pubDate>Tue, 06 Sep 2011 08:39:00 GMT</pubDate><guid>http://www.blogjava.net/youling/archive/2011/09/06/358076.html#358122</guid><description><![CDATA[80秒非常正常了。<img src ="http://www.blogjava.net/youling/aggbug/358122.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/youling/" target="_blank">@joe</a> 2011-09-06 16:39 <a href="http://www.blogjava.net/youling/archive/2011/09/06/358076.html#358122#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 千万级sql优化</title><link>http://www.blogjava.net/youling/archive/2011/09/06/358076.html#358121</link><dc:creator>黑色幽灵</dc:creator><author>黑色幽灵</author><pubDate>Tue, 06 Sep 2011 08:32:00 GMT</pubDate><guid>http://www.blogjava.net/youling/archive/2011/09/06/358076.html#358121</guid><description><![CDATA[实际上这条SQL查询到的数据，不会直接展示给用户，而是与其他数据库取到的数据做比较处理以后，存放到一个临时表中，用户看到的数据都是从这个临时表中取到的，现在执行查询，要80秒左右，不知道这个时间是否是一个正常的时间。<img src ="http://www.blogjava.net/youling/aggbug/358121.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/youling/" target="_blank">黑色幽灵</a> 2011-09-06 16:32 <a href="http://www.blogjava.net/youling/archive/2011/09/06/358076.html#358121#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>