当前位置:首页 » 编程博文
开发技术指南» 文章正文
    引言: 在SQL语句优化过程中,我们经常会用到hint,现总结一下在SQ
 

 

 ·一段自动补位的函数(asp)    »显示摘要«
    摘要:一段自动补位的函数function formatsn(getnum,getbit) dim formatsnnum,formatsnpre,formatsnj formatsnnum = getbit - len(getnum) for formatsnj = 1 to formatsnnum formatsnpre = formatsnpre & "0" next f......
 ·windows系统文件详解    »显示摘要«
    摘要:a ↑ access.chm - windows帮助文件 accstat.exe - 辅助状态指示器 advapi32.dll - 高级win32应用程序接口 aha154x.mpd - scsi驱动程序 am1500t.vxt - 网卡驱动程序 am2100.dos - 网卡驱动程序 appstart.ani - 动画光标 apps.hlp - windows帮助文件 audiocdc.hlp ......


SQL语句的优化方法
在sql语句优化过程中,我们经常会用到hint,现总结一下在sql优化过程中常见oracle hint的用法:

【程序编程相关:十月随笔

【推荐阅读:让初学者理解Struts

1. /*+all_rows*/ 【扩展信息:关于空间定位技术的一些想法

表明对语句块选择基于开销的优化方法,并获得最佳吞吐量,使资源消耗最小化.

例如:

select /*+all+_rows*/ emp_no,emp_nam,dat_in from bsempms where emp_no=´scott´;

2. /*+first_rows*/

表明对语句块选择基于开销的优化方法,并获得最佳响应时间,使资源消耗最小化.

例如:

select /*+first_rows*/ emp_no,emp_nam,dat_in from bsempms where emp_no=´scott´;

3. /*+choose*/

表明如果数据字典中有访问表的统计信息,将基于开销的优化方法,并获得最佳的吞吐量;

表明如果数据字典中没有访问表的统计信息,将基于规则开销的优化方法;

例如:

select /*+choose*/ emp_no,emp_nam,dat_in from bsempms where emp_no=´scott´;

4. /*+rule*/

表明对语句块选择基于规则的优化方法.

例如:

select /*+ rule */ emp_no,emp_nam,dat_in from bsempms where emp_no=´scott´;

5. /*+full(table)*/

表明对表选择全局扫描的方法.

例如:

select /*+full(a)*/ emp_no,emp_nam from bsempms a where emp_no=´scott´;

6. /*+rowid(table)*/

提示明确表明对指定表根据rowid进行访问.

例如:

select /*+rowid(bsempms)*/ * from bsempms where rowid>=´aaaaaaaaaaaaaa´

and emp_no=´scott´;

7. /*+cluster(table)*/

提示明确表明对指定表选择簇扫描的访问方法,它只对簇对象有效.

例如:

select /*+cluster */ bsempms.emp_no,dpt_no from bsempms,bsdptms


...   下一页
 ·正则表达式之道    »显示摘要«
    摘要: 正则表达式之道 原著:steve mansour sman@scruznet.com revised: june 5, 1999(copied by jm /at/ jmason.org from http://www.scruz.net/%7esman/regexp.htm, after the original disappeared! ) 翻译:neo leeneo.lee@g......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE