﻿<?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-codechris</title><link>http://www.blogjava.net/codechris/</link><description>i can do this</description><language>zh-cn</language><lastBuildDate>Sun, 12 Apr 2026 07:52:03 GMT</lastBuildDate><pubDate>Sun, 12 Apr 2026 07:52:03 GMT</pubDate><ttl>60</ttl><item><title>物流信息化的一些资料</title><link>http://www.blogjava.net/codechris/archive/2013/04/18/398057.html</link><dc:creator>codechris</dc:creator><author>codechris</author><pubDate>Thu, 18 Apr 2013 14:16:00 GMT</pubDate><guid>http://www.blogjava.net/codechris/archive/2013/04/18/398057.html</guid><description><![CDATA[1.淘宝：<br /><div><div>http://info.china.alibaba.com/detail/1025145561.html<br /><div>http://www.jaylee.cn/top/</div></div>e56.taobao.com<br /><br /><br /><br /><br /><br /><br /><br /></div><img src ="http://www.blogjava.net/codechris/aggbug/398057.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/codechris/" target="_blank">codechris</a> 2013-04-18 22:16 <a href="http://www.blogjava.net/codechris/archive/2013/04/18/398057.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>OracleSQL 优化</title><link>http://www.blogjava.net/codechris/archive/2013/04/09/397579.html</link><dc:creator>codechris</dc:creator><author>codechris</author><pubDate>Tue, 09 Apr 2013 05:35:00 GMT</pubDate><guid>http://www.blogjava.net/codechris/archive/2013/04/09/397579.html</guid><wfw:comment>http://www.blogjava.net/codechris/comments/397579.html</wfw:comment><comments>http://www.blogjava.net/codechris/archive/2013/04/09/397579.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/codechris/comments/commentRss/397579.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/codechris/services/trackbacks/397579.html</trackback:ping><description><![CDATA[<span class="Apple-style-span" style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #e5f2f4; "><p style="word-break: break-all; line-height: 1.8em !important; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; "><strong style="word-break: break-all; line-height: normal !important; ">（1）&nbsp;<wbr style="word-break: break-all; line-height: normal !important; "></strong>选择最有效率的表名顺序(只在基于规则的优化器中有效)：<br style="word-break: break-all; line-height: normal !important; " />ORACLE的解析器按照从右到左的顺序处理FROM子句中的表名，FROM子句中写在最后的表(基础表 driving table)将被最先处理，在FROM子句中包含多个表的情况下,你必须选择记录条数最少的表作为基础表。如果有3个以上的表连接查询, 那就需要选择交叉表(intersection table)作为基础表, 交叉表是指那个被其他表所引用的表.<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（2）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; ">WHERE子句中的连接顺序．：<br style="word-break: break-all; line-height: normal !important; " />ORACLE采用自下而上的顺序解析WHERE子句,根据这个原理,表之间的连接必须写在其他WHERE条件之前, 那些可以过滤掉最大数量记录的条件必须写在WHERE子句的末尾.<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（3）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; ">SELECT子句中避免使用 &#8216; * &#8216;：<br style="word-break: break-all; line-height: normal !important; " />ORACLE在解析的过程中, 会将'*' 依次转换成所有的列名, 这个工作是通过查询数据字典完成的, 这意味着将耗费更多的时间<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（4）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; ">减少访问数据库的次数：<br style="word-break: break-all; line-height: normal !important; " />ORACLE在内部执行了许多工作: 解析SQL语句, 估算索引的利用率, 绑定变量 , 读数据块等；<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（5）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; ">在SQL*Plus , SQL*Forms和Pro*C中重新设置ARRAYSIZE参数, 可以增加每次数据库访问的检索数据量 ,建议值为200<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（6）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; ">使用DECODE函数来减少处理时间：<br style="word-break: break-all; line-height: normal !important; " />使用DECODE函数可以避免重复扫描相同记录或重复连接相同的表.<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（7）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; ">整合简单,无关联的数据库访问：<br style="word-break: break-all; line-height: normal !important; " />如果你有几个简单的数据库查询语句,你可以把它们整合到一个查询中(即使它们之间没有关系)<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（8）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; ">删除重复记录：<br style="word-break: break-all; line-height: normal !important; " />最高效的删除重复记录方法 ( 因为使用了ROWID)例子：<br style="word-break: break-all; line-height: normal !important; " />DELETE FROM EMP E WHERE E.ROWID &gt; (SELECT MIN(X.ROWID)&nbsp;<br style="word-break: break-all; line-height: normal !important; " />FROM EMP X WHERE X.EMP_NO = E.EMP_NO);<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（9）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; ">用TRUNCATE替代DELETE：<br style="word-break: break-all; line-height: normal !important; " />当删除表中的记录时,在通常情况下, 回滚段(rollback segments ) 用来存放可以被恢复的信息. 如果你没有COMMIT事务,ORACLE会将数据恢复到删除之前的状态(准确地说是恢复到执行删除命令之前的状况) 而当运用TRUNCATE时, 回滚段不再存放任何可被恢复的信息.当命令运行后,数据不能被恢复.因此很少的资源被调用,执行时间也会很短. (译者按: TRUNCATE只在删除全表适用,TRUNCATE是DDL不是DML)<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（10）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; ">尽量多使用COMMIT：<br style="word-break: break-all; line-height: normal !important; " />只要有可能,在程序中尽量多使用COMMIT, 这样程序的性能得到提高,需求也会因为COMMIT所释放的资源而减少:&nbsp;<br style="word-break: break-all; line-height: normal !important; " />COMMIT所释放的资源:&nbsp;<br style="word-break: break-all; line-height: normal !important; " />a. 回滚段上用于恢复数据的信息.&nbsp;<br style="word-break: break-all; line-height: normal !important; " />b. 被程序语句获得的锁&nbsp;<br style="word-break: break-all; line-height: normal !important; " />c. redo log buffer 中的空间&nbsp;<br style="word-break: break-all; line-height: normal !important; " />d. ORACLE为管理上述3种资源中的内部花费<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（11）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; ">用Where子句替换HAVING子句：<br style="word-break: break-all; line-height: normal !important; " />避免使用HAVING子句, HAVING 只会在检索出所有记录之后才对结果集进行过滤. 这个处理需要排序,总计等操作. 如果能通过WHERE子句限制记录的数目,那就能减少这方面的开销. (非oracle中)on、where、having这三个都可以加条件的子句中，on是最先执行，where次之，having最后，因为on是先把不符合条件的记录过滤后才进行统计，它就可以减少中间运算要处理的数据，按理说应该速度是最快的，where也应该比having快点的，因为它过滤数据后才进行sum，在两个表联接时才用on的，所以在一个表的时候，就剩下where跟having比较了。在这单表查询统计的情况下，如果要过滤的条件没有涉及到要计算字段，那它们的结果是一样的，只是where可以使用rushmore技术，而having就不能，在速度上后者要慢如果要涉及到计算的字段，就表示在没计算之前，这个字段的值是不确定的，根据上篇写的工作流程，where的作用时间是在计算之前就完成的，而having就是在计算后才起作用的，所以在这种情况下，两者的结果会不同。在多表联接查询时，on比where更早起作用。系统首先根据各个表之间的联接条件，把多个表合成一个临时表后，再由where进行过滤，然后再计算，计算完后再由having进行过滤。由此可见，要想过滤条件起到正确的作用，首先要明白这个条件应该在什么时候起作用，然后再决定放在那里<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（12）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; ">减少对表的查询：<br style="word-break: break-all; line-height: normal !important; " />在含有子查询的SQL语句中,要特别注意减少对表的查询.例子：<br style="word-break: break-all; line-height: normal !important; " />SELECT TAB_NAME FROM TABLES WHERE (TAB_NAME,DB_VER) = ( SELECT<br style="word-break: break-all; line-height: normal !important; " />TAB_NAME,DB_VER FROM TAB_COLUMNS WHERE VERSION = 604)<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（13）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; ">通过内部函数提高SQL效率.：<br style="word-break: break-all; line-height: normal !important; " />复杂的SQL往往牺牲了执行效率. 能够掌握上面的运用函数解决问题的方法在实际工作中是非常有意义的<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（14）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; ">使用表的别名(Alias)：<br style="word-break: break-all; line-height: normal !important; " />当在SQL语句中连接多个表时, 请使用表的别名并把别名前缀于每个Column上.这样一来,就可以减少解析的时间并减少那些由Column歧义引起的语法错误.<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（15）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; ">用EXISTS替代IN、用NOT EXISTS替代NOT IN：<br style="word-break: break-all; line-height: normal !important; " />在许多基于基础表的查询中,为了满足一个条件,往往需要对另一个表进行联接.在这种情况下, 使用EXISTS(或NOT EXISTS)通常将提高查询的效率. 在子查询中,NOT IN子句将执行一个内部的排序和合并. 无论在哪种情况下,NOT IN都是最低效的 (因为它对子查询中的表执行了一个全表遍历). 为了避免使用NOT IN ,我们可以把它改写成外连接(Outer Joins)或NOT EXISTS.<br style="word-break: break-all; line-height: normal !important; " />例子：<br style="word-break: break-all; line-height: normal !important; " />（高效）SELECT * FROM EMP (基础表) WHERE EMPNO &gt; 0 AND&nbsp;<strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">EXISTS</strong><wbr style="word-break: break-all; line-height: normal !important; ">&nbsp;(SELECT &#8216;X' FROM DEPT WHERE DEPT.DEPTNO = EMP.DEPTNO AND LOC = &#8216;MELB')<br style="word-break: break-all; line-height: normal !important; " />(低效)SELECT * FROM EMP (基础表) WHERE EMPNO &gt; 0 AND DEPTNO&nbsp;<strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">IN</strong><wbr style="word-break: break-all; line-height: normal !important; ">(SELECT DEPTNO FROM DEPT WHERE LOC = &#8216;MELB')<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（16）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">识别'</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">低效执行'</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">的SQL</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">语句：</strong><wbr style="word-break: break-all; line-height: normal !important; "><br style="word-break: break-all; line-height: normal !important; " />虽然目前各种关于SQL优化的图形化工具层出不穷,但是写出自己的SQL工具来解决问题始终是一个最好的方法：<br style="word-break: break-all; line-height: normal !important; " />SELECT EXECUTIONS , DISK_READS, BUFFER_GETS,&nbsp;<br style="word-break: break-all; line-height: normal !important; " />ROUND((BUFFER_GETS-DISK_READS)/BUFFER_GETS,2) Hit_radio,&nbsp;<br style="word-break: break-all; line-height: normal !important; " />ROUND(DISK_READS/EXECUTIONS,2) Reads_per_run,&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SQL_TEXT&nbsp;<br style="word-break: break-all; line-height: normal !important; " />FROM V$SQLAREA&nbsp;<br style="word-break: break-all; line-height: normal !important; " />WHERE EXECUTIONS&gt;0&nbsp;<br style="word-break: break-all; line-height: normal !important; " />AND BUFFER_GETS &gt; 0&nbsp;<br style="word-break: break-all; line-height: normal !important; " />AND (BUFFER_GETS-DISK_READS)/BUFFER_GETS &lt; 0.8&nbsp;<br style="word-break: break-all; line-height: normal !important; " />ORDER BY 4 DESC;</p><p style="word-break: break-all; line-height: 1.8em !important; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; "></p><p style="word-break: break-all; line-height: 1.8em !important; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; "><strong style="word-break: break-all; line-height: normal !important; ">（17）&nbsp;<wbr style="word-break: break-all; line-height: normal !important; "></strong>用索引提高效率：<br style="word-break: break-all; line-height: normal !important; " />索引是表的一个概念部分,用来提高检索数据的效率，ORACLE使用了一个复杂的自平衡B-tree结构. 通常,通过索引查询数据比全表扫描要快. 当ORACLE找出执行查询和Update语句的最佳路径时, ORACLE优化器将使用索引. 同样在联结多个表时使用索引也可以提高效率. 另一个使用索引的好处是,它提供了主键(primary key)的唯一性验证.。那些LONG或LONG RAW数据类型, 你可以索引几乎所有的列. 通常, 在大型表中使用索引特别有效. 当然,你也会发现, 在扫描小表时,使用索引同样能提高效率. 虽然使用索引能得到查询效率的提高,但是我们也必须注意到它的代价. 索引需要空间来存储,也需要定期维护, 每当有记录在表中增减或索引列被修改时, 索引本身也会被修改. 这意味着每条记录的INSERT , DELETE , UPDATE将为此多付出4 , 5 次的磁盘I/O . 因为索引需要额外的存储空间和处理,那些不必要的索引反而会使查询反应时间变慢.。定期的重构索引是有必要的.：<br style="word-break: break-all; line-height: normal !important; " />ALTER INDEX &lt;INDEXNAME&gt; REBUILD &lt;TABLESPACENAME&gt;<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（18）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; ">用EXISTS替换DISTINCT：<br style="word-break: break-all; line-height: normal !important; " />当提交一个包含一对多表信息(比如部门表和雇员表)的查询时,避免在SELECT子句中使用DISTINCT. 一般可以考虑用EXIST替换, EXISTS 使查询更为迅速,因为RDBMS核心模块将在子查询的条件一旦满足后,立刻返回结果. 例子：<br style="word-break: break-all; line-height: normal !important; " />(低效):&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT DISTINCT DEPT_NO,DEPT_NAME FROM DEPT D , EMP E&nbsp;<br style="word-break: break-all; line-height: normal !important; " />WHERE D.DEPT_NO = E.DEPT_NO&nbsp;<br style="word-break: break-all; line-height: normal !important; " />(高效):&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT DEPT_NO,DEPT_NAME FROM DEPT D WHERE EXISTS ( SELECT &#8216;X'&nbsp;<br style="word-break: break-all; line-height: normal !important; " />FROM EMP E WHERE E.DEPT_NO = D.DEPT_NO);<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（19）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; ">sql语句用大写的；因为oracle总是先解析sql语句，把小写的字母转换成大写的再执行<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（20）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; ">在java代码中尽量少用连接符&#8220;＋&#8221;连接字符串！<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（21）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">避免在索引列上使用NOT&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">通常</strong><wbr style="word-break: break-all; line-height: normal !important; ">，　<br style="word-break: break-all; line-height: normal !important; " />我们要避免在索引列上使用NOT, NOT会产生在和在索引列上使用函数相同的影响. 当ORACLE&#8221;遇到&#8221;NOT,他就会停止使用索引转而执行全表扫描.<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（22）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; ">避免在索引列上使用计算．<br style="word-break: break-all; line-height: normal !important; " />WHERE子句中，如果索引列是函数的一部分．优化器将不使用索引而使用全表扫描．&nbsp;<br style="word-break: break-all; line-height: normal !important; " />举例:&nbsp;<br style="word-break: break-all; line-height: normal !important; " />低效：&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT &#8230; FROM DEPT WHERE SAL * 12 &gt; 25000;&nbsp;<br style="word-break: break-all; line-height: normal !important; " />高效:&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT &#8230; FROM DEPT WHERE SAL &gt; 25000/12;<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（23）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; ">用&gt;=替代&gt;<br style="word-break: break-all; line-height: normal !important; " />高效:&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT * FROM EMP WHERE DEPTNO &gt;=4&nbsp;<br style="word-break: break-all; line-height: normal !important; " />低效:&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT * FROM EMP WHERE DEPTNO &gt;3&nbsp;<br style="word-break: break-all; line-height: normal !important; " />两者的区别在于, 前者DBMS将直接跳到第一个DEPT等于4的记录而后者将首先定位到DEPTNO=3的记录并且向前扫描到第一个DEPT大于3的记录.<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（24）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">用UNION</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">替换OR (</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">适用于索引列)</strong><wbr style="word-break: break-all; line-height: normal !important; "><br style="word-break: break-all; line-height: normal !important; " />通常情况下, 用UNION替换WHERE子句中的OR将会起到较好的效果. 对索引列使用OR将造成全表扫描. 注意, 以上规则只针对多个索引列有效. 如果有column没有被索引, 查询效率可能会因为你没有选择OR而降低. 在下面的例子中, LOC_ID 和REGION上都建有索引.&nbsp;<br style="word-break: break-all; line-height: normal !important; " />高效:&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT LOC_ID , LOC_DESC , REGION&nbsp;<br style="word-break: break-all; line-height: normal !important; " />FROM LOCATION&nbsp;<br style="word-break: break-all; line-height: normal !important; " />WHERE LOC_ID = 10&nbsp;<br style="word-break: break-all; line-height: normal !important; " />UNION&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT LOC_ID , LOC_DESC , REGION&nbsp;<br style="word-break: break-all; line-height: normal !important; " />FROM LOCATION&nbsp;<br style="word-break: break-all; line-height: normal !important; " />WHERE REGION = &#8220;MELBOURNE&#8221;&nbsp;<br style="word-break: break-all; line-height: normal !important; " />低效:&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT LOC_ID , LOC_DESC , REGION&nbsp;<br style="word-break: break-all; line-height: normal !important; " />FROM LOCATION&nbsp;<br style="word-break: break-all; line-height: normal !important; " />WHERE LOC_ID = 10 OR REGION = &#8220;MELBOURNE&#8221;&nbsp;<br style="word-break: break-all; line-height: normal !important; " />如果你坚持要用OR, 那就需要返回记录最少的索引列写在最前面.<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（25）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">用IN</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">来替换OR&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; "><br style="word-break: break-all; line-height: normal !important; " />这是一条简单易记的规则，但是实际的执行效果还须检验，在ORACLE8i下，两者的执行路径似乎是相同的．　<br style="word-break: break-all; line-height: normal !important; " />低效:&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT&#8230;. FROM LOCATION WHERE LOC_ID = 10 OR LOC_ID = 20 OR LOC_ID = 30&nbsp;<br style="word-break: break-all; line-height: normal !important; " />高效&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT&#8230; FROM LOCATION WHERE LOC_IN IN (10,20,30);<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（26）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">避免在索引列上使用IS NULL</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">和IS NOT NULL</strong><wbr style="word-break: break-all; line-height: normal !important; "><br style="word-break: break-all; line-height: normal !important; " />避免在索引中使用任何可以为空的列，ORACLE将无法使用该索引．对于单列索引，如果列包含空值，索引中将不存在此记录. 对于复合索引，如果每个列都为空，索引中同样不存在此记录.　如果至少有一个列不为空，则记录存在于索引中．举例: 如果唯一性索引建立在表的A列和B列上, 并且表中存在一条记录的A,B值为(123,null) , ORACLE将不接受下一条具有相同A,B值（123,null）的记录(插入). 然而如果所有的索引列都为空，ORACLE将认为整个键值为空而空不等于空. 因此你可以插入1000 条具有相同键值的记录,当然它们都是空! 因为空值不存在于索引列中,所以WHERE子句中对索引列进行空值比较将使ORACLE停用该索引.<br style="word-break: break-all; line-height: normal !important; " />低效: (索引失效)&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT &#8230; FROM DEPARTMENT WHERE DEPT_CODE IS NOT NULL;&nbsp;<br style="word-break: break-all; line-height: normal !important; " />高效: (索引有效)&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT &#8230; FROM DEPARTMENT WHERE DEPT_CODE &gt;=0;<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（27）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">总是使用索引的第一个列</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">：</strong><wbr style="word-break: break-all; line-height: normal !important; "><br style="word-break: break-all; line-height: normal !important; " />如果索引是建立在多个列上, 只有在它的第一个列(leading column)被where子句引用时,优化器才会选择使用该索引. 这也是一条简单而重要的规则，当仅引用索引的第二个列时,优化器使用了全表扫描而忽略了索引<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（28）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">用UNION-ALL&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">替换UNION (&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">如果有可能的话)</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">：</strong><wbr style="word-break: break-all; line-height: normal !important; "><br style="word-break: break-all; line-height: normal !important; " />当SQL语句需要UNION两个查询结果集合时,这两个结果集合会以UNION-ALL的方式被合并, 然后在输出最终结果前进行排序. 如果用UNION ALL替代UNION, 这样排序就不是必要了. 效率就会因此得到提高. 需要注意的是，UNION ALL 将重复输出两个结果集合中相同记录. 因此各位还是要从业务需求分析使用UNION ALL的可行性. UNION 将对结果集合排序,这个操作会使用到SORT_AREA_SIZE这块内存. 对于这块内存的优化也是相当重要的. 下面的SQL可以用来查询排序的消耗量<br style="word-break: break-all; line-height: normal !important; " />低效：&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT ACCT_NUM, BALANCE_AMT&nbsp;<br style="word-break: break-all; line-height: normal !important; " />FROM DEBIT_TRANSACTIONS&nbsp;<br style="word-break: break-all; line-height: normal !important; " />WHERE TRAN_DATE = '31-DEC-95'&nbsp;<br style="word-break: break-all; line-height: normal !important; " />UNION&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT ACCT_NUM, BALANCE_AMT&nbsp;<br style="word-break: break-all; line-height: normal !important; " />FROM DEBIT_TRANSACTIONS&nbsp;<br style="word-break: break-all; line-height: normal !important; " />WHERE TRAN_DATE = '31-DEC-95'&nbsp;<br style="word-break: break-all; line-height: normal !important; " />高效:&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT ACCT_NUM, BALANCE_AMT&nbsp;<br style="word-break: break-all; line-height: normal !important; " />FROM DEBIT_TRANSACTIONS&nbsp;<br style="word-break: break-all; line-height: normal !important; " />WHERE TRAN_DATE = '31-DEC-95'&nbsp;<br style="word-break: break-all; line-height: normal !important; " />UNION ALL&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT ACCT_NUM, BALANCE_AMT&nbsp;<br style="word-break: break-all; line-height: normal !important; " />FROM DEBIT_TRANSACTIONS&nbsp;<br style="word-break: break-all; line-height: normal !important; " />WHERE TRAN_DATE = '31-DEC-95'<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（29）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">用WHERE</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">替代ORDER BY</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">：</strong><wbr style="word-break: break-all; line-height: normal !important; "><br style="word-break: break-all; line-height: normal !important; " />ORDER BY 子句只在两种严格的条件下使用索引.&nbsp;<br style="word-break: break-all; line-height: normal !important; " />ORDER BY中所有的列必须包含在相同的索引中并保持在索引中的排列顺序.&nbsp;<br style="word-break: break-all; line-height: normal !important; " />ORDER BY中所有的列必须定义为非空.&nbsp;<br style="word-break: break-all; line-height: normal !important; " />WHERE子句使用的索引和ORDER BY子句中所使用的索引不能并列.<br style="word-break: break-all; line-height: normal !important; " />例如:&nbsp;<br style="word-break: break-all; line-height: normal !important; " />表DEPT包含以下列:&nbsp;<br style="word-break: break-all; line-height: normal !important; " />DEPT_CODE PK NOT NULL&nbsp;<br style="word-break: break-all; line-height: normal !important; " />DEPT_DESC NOT NULL&nbsp;<br style="word-break: break-all; line-height: normal !important; " />DEPT_TYPE NULL<br style="word-break: break-all; line-height: normal !important; " />低效: (索引不被使用)&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT DEPT_CODE FROM DEPT ORDER BY DEPT_TYPE&nbsp;<br style="word-break: break-all; line-height: normal !important; " />高效: (使用索引)&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT DEPT_CODE FROM DEPT WHERE DEPT_TYPE &gt; 0<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（30）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">避免改变索引列的类型.:</strong><wbr style="word-break: break-all; line-height: normal !important; "><br style="word-break: break-all; line-height: normal !important; " />当比较不同数据类型的数据时, ORACLE自动对列进行简单的类型转换.&nbsp;<br style="word-break: break-all; line-height: normal !important; " />假设 EMPNO是一个数值类型的索引列.&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT &#8230; FROM EMP WHERE EMPNO = &#8216;123'&nbsp;<br style="word-break: break-all; line-height: normal !important; " />实际上,经过ORACLE类型转换, 语句转化为:&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT &#8230; FROM EMP WHERE EMPNO = TO_NUMBER(&#8216;123')&nbsp;<br style="word-break: break-all; line-height: normal !important; " />幸运的是,类型转换没有发生在索引列上,索引的用途没有被改变.&nbsp;<br style="word-break: break-all; line-height: normal !important; " />现在,假设EMP_TYPE是一个字符类型的索引列.&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT &#8230; FROM EMP WHERE EMP_TYPE = 123&nbsp;<br style="word-break: break-all; line-height: normal !important; " />这个语句被ORACLE转换为:&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT &#8230; FROM EMP WHERETO_NUMBER(EMP_TYPE)=123&nbsp;<br style="word-break: break-all; line-height: normal !important; " />因为内部发生的类型转换, 这个索引将不会被用到! 为了避免ORACLE对你的SQL进行隐式的类型转换, 最好把类型转换用显式表现出来. 注意当字符和数值比较时, ORACLE会优先转换数值类型到字符类型<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（31）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">需要当心的WHERE</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">子句:</strong><wbr style="word-break: break-all; line-height: normal !important; "><br style="word-break: break-all; line-height: normal !important; " />某些SELECT 语句中的WHERE子句不使用索引. 这里有一些例子.&nbsp;<br style="word-break: break-all; line-height: normal !important; " />在下面的例子里, (1)&#8216;!=' 将不使用索引. 记住, 索引只能告诉你什么存在于表中, 而不能告诉你什么不存在于表中. (2) &#8216;||'是字符连接函数. 就象其他函数那样, 停用了索引. (3) &#8216;+'是数学函数. 就象其他数学函数那样, 停用了索引. (4)相同的索引列不能互相比较,这将会启用全表扫描.<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（32）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; ">a. 如果检索数据量超过30%的表中记录数.使用索引将没有显著的效率提高.&nbsp;<br style="word-break: break-all; line-height: normal !important; " />b. 在特定情况下, 使用索引也许会比全表扫描慢, 但这是同一个数量级上的区别. 而通常情况下,使用索引比全表扫描要块几倍乃至几千倍!<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（33）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">避免使用耗费资源的操作:</strong><wbr style="word-break: break-all; line-height: normal !important; "><br style="word-break: break-all; line-height: normal !important; " />带有DISTINCT,UNION,MINUS,INTERSECT,ORDER BY的SQL语句会启动SQL引擎&nbsp;<br style="word-break: break-all; line-height: normal !important; " />执行耗费资源的排序(SORT)功能. DISTINCT需要一次排序操作, 而其他的至少需要执行两次排序. 通常, 带有UNION, MINUS , INTERSECT的SQL语句都可以用其他方式重写. 如果你的数据库的SORT_AREA_SIZE调配得好, 使用UNION , MINUS, INTERSECT也是可以考虑的, 毕竟它们的可读性很强<br style="word-break: break-all; line-height: normal !important; " /><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">（34）&nbsp;</strong><wbr style="word-break: break-all; line-height: normal !important; "><strong style="word-break: break-all; line-height: normal !important; "><wbr style="word-break: break-all; line-height: normal !important; ">优化GROUP BY:</strong><wbr style="word-break: break-all; line-height: normal !important; "><br style="word-break: break-all; line-height: normal !important; " />提高GROUP BY 语句的效率, 可以通过将不需要的记录在GROUP BY 之前过滤掉.下面两个查询返回相同结果但第二个明显就快了许多.<br style="word-break: break-all; line-height: normal !important; " />低效:&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT JOB , AVG(SAL)&nbsp;<br style="word-break: break-all; line-height: normal !important; " />FROM EMP&nbsp;<br style="word-break: break-all; line-height: normal !important; " />GROUP JOB&nbsp;<br style="word-break: break-all; line-height: normal !important; " />HAVING JOB = &#8216;PRESIDENT'&nbsp;<br style="word-break: break-all; line-height: normal !important; " />OR JOB = &#8216;MANAGER'&nbsp;<br style="word-break: break-all; line-height: normal !important; " />高效:&nbsp;<br style="word-break: break-all; line-height: normal !important; " />SELECT JOB , AVG(SAL)&nbsp;<br style="word-break: break-all; line-height: normal !important; " />FROM EMP&nbsp;<br style="word-break: break-all; line-height: normal !important; " />WHERE JOB = &#8216;PRESIDENT'&nbsp;<br style="word-break: break-all; line-height: normal !important; " />OR JOB = &#8216;MANAGER'&nbsp;<br style="word-break: break-all; line-height: normal !important; " />GROUP JOB</p></span><img src ="http://www.blogjava.net/codechris/aggbug/397579.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/codechris/" target="_blank">codechris</a> 2013-04-09 13:35 <a href="http://www.blogjava.net/codechris/archive/2013/04/09/397579.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>处理PDF的工具</title><link>http://www.blogjava.net/codechris/archive/2010/05/08/320356.html</link><dc:creator>codechris</dc:creator><author>codechris</author><pubDate>Sat, 08 May 2010 05:30:00 GMT</pubDate><guid>http://www.blogjava.net/codechris/archive/2010/05/08/320356.html</guid><wfw:comment>http://www.blogjava.net/codechris/comments/320356.html</wfw:comment><comments>http://www.blogjava.net/codechris/archive/2010/05/08/320356.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/codechris/comments/commentRss/320356.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/codechris/services/trackbacks/320356.html</trackback:ping><description><![CDATA[<p><a title="http://www.accesspdf.com/pdftk/" href="http://www.accesspdf.com/pdftk/">http://www.accesspdf.com/pdftk/</a></p> <p>&nbsp;</p> <p><a title="http://www.accesspdf.com/article.php/20041129175231241" href="http://www.accesspdf.com/article.php/20041129175231241">http://www.accesspdf.com/article.php/20041129175231241</a></p> <p>&nbsp;</p> <p>命令行的方式操作，已测试，稳定性很好，使用起来也很方便，没有用户友好的界面，我很喜欢</p><img src ="http://www.blogjava.net/codechris/aggbug/320356.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/codechris/" target="_blank">codechris</a> 2010-05-08 13:30 <a href="http://www.blogjava.net/codechris/archive/2010/05/08/320356.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关注amazon的simpleDB和弹性计算</title><link>http://www.blogjava.net/codechris/archive/2010/05/05/320115.html</link><dc:creator>codechris</dc:creator><author>codechris</author><pubDate>Wed, 05 May 2010 05:36:00 GMT</pubDate><guid>http://www.blogjava.net/codechris/archive/2010/05/05/320115.html</guid><wfw:comment>http://www.blogjava.net/codechris/comments/320115.html</wfw:comment><comments>http://www.blogjava.net/codechris/archive/2010/05/05/320115.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/codechris/comments/commentRss/320115.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/codechris/services/trackbacks/320115.html</trackback:ping><description><![CDATA[<p><a href="http://www.infoq.com/cn/news/2010/05/aws_sdk">http://www.infoq.com/cn/news/2010/05/aws_sdk</a></p><img src ="http://www.blogjava.net/codechris/aggbug/320115.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/codechris/" target="_blank">codechris</a> 2010-05-05 13:36 <a href="http://www.blogjava.net/codechris/archive/2010/05/05/320115.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>主要看其中的ACL实现</title><link>http://www.blogjava.net/codechris/archive/2010/05/02/319897.html</link><dc:creator>codechris</dc:creator><author>codechris</author><pubDate>Sun, 02 May 2010 12:26:00 GMT</pubDate><guid>http://www.blogjava.net/codechris/archive/2010/05/02/319897.html</guid><wfw:comment>http://www.blogjava.net/codechris/comments/319897.html</wfw:comment><comments>http://www.blogjava.net/codechris/archive/2010/05/02/319897.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/codechris/comments/commentRss/319897.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/codechris/services/trackbacks/319897.html</trackback:ping><description><![CDATA[<p><a href="http://code.google.com/p/micrite/">http://code.google.com/p/micrite/</a></p><img src ="http://www.blogjava.net/codechris/aggbug/319897.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/codechris/" target="_blank">codechris</a> 2010-05-02 20:26 <a href="http://www.blogjava.net/codechris/archive/2010/05/02/319897.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【资料】RBAC</title><link>http://www.blogjava.net/codechris/archive/2010/04/20/318878.html</link><dc:creator>codechris</dc:creator><author>codechris</author><pubDate>Tue, 20 Apr 2010 09:30:00 GMT</pubDate><guid>http://www.blogjava.net/codechris/archive/2010/04/20/318878.html</guid><wfw:comment>http://www.blogjava.net/codechris/comments/318878.html</wfw:comment><comments>http://www.blogjava.net/codechris/archive/2010/04/20/318878.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/codechris/comments/commentRss/318878.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/codechris/services/trackbacks/318878.html</trackback:ping><description><![CDATA[<p><a href="http://www.tanher.com/Knowledge/TopicDetail/10-81.aspx">http://www.tanher.com/Knowledge/TopicDetail/10-81.aspx</a></p><img src ="http://www.blogjava.net/codechris/aggbug/318878.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/codechris/" target="_blank">codechris</a> 2010-04-20 17:30 <a href="http://www.blogjava.net/codechris/archive/2010/04/20/318878.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【资料】数据集成架构的一种可能</title><link>http://www.blogjava.net/codechris/archive/2010/04/20/318860.html</link><dc:creator>codechris</dc:creator><author>codechris</author><pubDate>Tue, 20 Apr 2010 07:35:00 GMT</pubDate><guid>http://www.blogjava.net/codechris/archive/2010/04/20/318860.html</guid><wfw:comment>http://www.blogjava.net/codechris/comments/318860.html</wfw:comment><comments>http://www.blogjava.net/codechris/archive/2010/04/20/318860.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/codechris/comments/commentRss/318860.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/codechris/services/trackbacks/318860.html</trackback:ping><description><![CDATA[<h3><a href="http://articles.e-works.net.cn/mes/article57185.htm">基于多厂制造执行系统异构数据集成架构的研究</a></h3><img src ="http://www.blogjava.net/codechris/aggbug/318860.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/codechris/" target="_blank">codechris</a> 2010-04-20 15:35 <a href="http://www.blogjava.net/codechris/archive/2010/04/20/318860.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【资料】可能的实现--讨论</title><link>http://www.blogjava.net/codechris/archive/2010/04/20/318858.html</link><dc:creator>codechris</dc:creator><author>codechris</author><pubDate>Tue, 20 Apr 2010 07:34:00 GMT</pubDate><guid>http://www.blogjava.net/codechris/archive/2010/04/20/318858.html</guid><wfw:comment>http://www.blogjava.net/codechris/comments/318858.html</wfw:comment><comments>http://www.blogjava.net/codechris/archive/2010/04/20/318858.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/codechris/comments/commentRss/318858.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/codechris/services/trackbacks/318858.html</trackback:ping><description><![CDATA[<p><a href="http://www.javaeye.com/topic/232219">http://www.javaeye.com/topic/232219</a></p><img src ="http://www.blogjava.net/codechris/aggbug/318858.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/codechris/" target="_blank">codechris</a> 2010-04-20 15:34 <a href="http://www.blogjava.net/codechris/archive/2010/04/20/318858.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【资料】应用平台开发参考【转载】</title><link>http://www.blogjava.net/codechris/archive/2010/04/20/318857.html</link><dc:creator>codechris</dc:creator><author>codechris</author><pubDate>Tue, 20 Apr 2010 07:33:00 GMT</pubDate><guid>http://www.blogjava.net/codechris/archive/2010/04/20/318857.html</guid><wfw:comment>http://www.blogjava.net/codechris/comments/318857.html</wfw:comment><comments>http://www.blogjava.net/codechris/archive/2010/04/20/318857.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/codechris/comments/commentRss/318857.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/codechris/services/trackbacks/318857.html</trackback:ping><description><![CDATA[<p>1.支持多数据库<br>应该有一套专门的数据建模和数据持久层机制。整个系统灵活的支持当前主流的数据库，尽量不使用存储过程和一些数据库的特有功能。但后期的数据库的调优可以通过人工来进行。<br>对多数据库的支持不应该引起系统性能的明显降低，快速平台应考虑这一问题。 <p>2.支持现在流行的Java和DotNet两大主流平台<br>RapidDev的建模这块仍然应该遵循MDA的从PIM到PSM的思路进行，模型的建立的第一层应该是跟语言和平台无关的。只有模型建立具备了逻辑的完整性和正确性则可以翻译成不同的语言，只是不同的语言可以采用不同的技术来实现。<br>语言是一个层次的内容，另外是系统架构应该支持多种模式，可以选择简单易用的架构，也可以选择较为复杂的企业级应用架构。 <p>3.对分布式体系结构的支持<br>RapidDev平台应该支持CS，BS和多层分布式等多种体系结构。<br>快速平台应该支持主流的DCOM，EJB，Web Service和Remoting等分布式技术，并可以灵活配置和选择。<br>数据交互应该采用能够跨应用和平台的标准协议如SOAP，XML，XSD，WSDL等。 <p>4.开放性和封闭性<br>遵从开放封闭原则，支持功能的扩展和外部接口的开放。<br>RapidDev的建模应该是自成一套体系，包括数据建模，对象建模，流程建模，权限建模，操作建模，业务规则建模，界面建模，报表建模等多个业务功能的建模。相关建模间应该尽量抽象出接口，完全通过接口进行关联和组装。<br>RaplidDev应该提供独立的建模工具，并支持自定义脚本的扩展。<br>对于同外部系统的EAI集成，应该支持标准的一些服务接口定义，如通过Web Service进行。 <p>5.业务对象，流程，规则驱动的新开发方法论<br>建模过程应该以业务对象，业务流程和业务规则三者来驱动的。<br>业务建模关注的是真正实际的业务对象如订单，变更单等；业务对象在经过实体关系和规范化的分析和解释后转变为实际的数据对象和数据表。<br>流程建模关注的是整个具体的业务流程，流程建模中会直接关联到系统的权限设置和建模。流程建模最终通过系统工作流引擎实现。<br>规则建模定制业务对象的操作规则，支持相关的自定义脚本，业务规则的定义最终体现到系统的业务逻辑层。 <p><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=493a8455010004xg&amp;url=http://static11.photo.sina.com.cn/orignal/493a8455fe997ab162d0a"><img title="快速应用开发平台的功能特点" border="0" alt="快速应用开发平台的功能特点" src="http://static11.photo.sina.com.cn/orignal/493a8455fe997ab162d0a"></a> <p>另外RapidDev平台必须清晰的体现分析和设计的过程在平台中，现在常见的一些快速开发平台的问题点都在于只能处理简单的问题，而对较为复杂的系统无能为力。因此整个平台需要将分析和设计过程融合进去，支持对复杂系统的逐步求解和细化。 <img src ="http://www.blogjava.net/codechris/aggbug/318857.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/codechris/" target="_blank">codechris</a> 2010-04-20 15:33 <a href="http://www.blogjava.net/codechris/archive/2010/04/20/318857.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>项目维基地址</title><link>http://www.blogjava.net/codechris/archive/2010/03/14/315412.html</link><dc:creator>codechris</dc:creator><author>codechris</author><pubDate>Sun, 14 Mar 2010 15:35:00 GMT</pubDate><guid>http://www.blogjava.net/codechris/archive/2010/03/14/315412.html</guid><wfw:comment>http://www.blogjava.net/codechris/comments/315412.html</wfw:comment><comments>http://www.blogjava.net/codechris/archive/2010/03/14/315412.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/codechris/comments/commentRss/315412.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/codechris/services/trackbacks/315412.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;只有注册用户登录后才能阅读该文。<a href='http://www.blogjava.net/codechris/archive/2010/03/14/315412.html'>阅读全文</a><img src ="http://www.blogjava.net/codechris/aggbug/315412.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/codechris/" target="_blank">codechris</a> 2010-03-14 23:35 <a href="http://www.blogjava.net/codechris/archive/2010/03/14/315412.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>