易截截图软件、单文件、免安装、纯绿色、仅160KB

Using Oracle Index Hints in SQL statements

Using Oracle Index Hints in SQL statements
Hints are used to give specific information that we know about our data and application, to Oracle. This further improves the performance of our system. There can be instances where the default optimizer may not be efficient for a certain SQL statements. We can specify HINTS with the SQL statements, to improve the efficiency of those SQL statements.
In this article, we shall see how to specify INDEX hints and what the advantages of the same are.
1      How to specify Hints
The Hints are enclosed in comment, /* comment */, in an SQL statement, and can only be specified with SELECT, DELETE and UPDATE keyword.
SELECT /* comment */ ........ ;
All hints should start with a + sign. This tells the SQL Parser that the SQL has a hint specified with it.
SELECT /*+{hint} */ ........ ;
2      Using INDEX Hints
When you specify an INDEX Hint, the optimizer knows that it has to use the INDEX specified in the hint. In this case, the optimizer does not go for a Full Table Scan nor does it use any other index. In addition, it does not calculate the cost of the Index to be used.
If no INDEX hint is specified the optimizer determines the cost of the each index that could be used to access the table and uses the one with the lower cost.
If there are multiple indexes specified with the Hint then the optimizer has to determine the cost of each index to be used with the specified table. Once that is determined, it uses the Index with the lower cost to access the table. In this case, the optimizer does not do a FULL Table Scan. Also note that, the optimizer may choose to use multiple indexes and then merge the result sets to access the table. This method is used if the cost is low.
Syntax:
/*+ INDEX ( table [index [index]...] ) */
Where:
table specifies the name or alias of the table associated with the index to be scanned.
index specifies an index on which an index scan is to be


相关文档:

连接oracle,sqlserver中数据库的示例代码

一 在Oracle中连接数据库
public class Test1 {
 public static void main(String[] args) {
  try {
   Class.forName("oracle.jdbc.driver.OracleDriver");
   Connection conn = DriverManager.getConnection(
       &nbs ......

win7 安装 oracle 客户端

当前任何版本的ORACLE客户端在任何版本的WINDOWS7上都不能正常完成安装。
    主要是因为ORACLE安装的先决条件里操作系统版本不符合,但是这个疑问可以修改refhost.xml处理, 具体是在refhost.xml中添加
  <!--Microsoft Windows 7-->
  <OPERATING_SYSTEM>
    & ......

oracle 创建用户


oracle10g创建用户
Oracle10g 的创建用户名
1、   linux 下 oracle 的启动
以 oracle 身份登录  
启动    lsnrctl start
登录    sqplus /nolog
连接数据库    connect  /as   sysdba
启动数据库    startup
关闭数据库    s ......

Oracle 分页语句,存储过程

select * from (select t.*,rownum rn from (select * from emp) t where rownum<=10) where rn>=6;
创建分页结果集的游标
create or replace package fenyepackage as
type testcursor is ref cursor;
end fenyepackage;
创建分页存储过程
create or replace procedure fenye3(
tableName varchar2, --表名 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号