oracle 性能优化

一、sql 查询优化,强制使用索引,index()

   格式: /*+ index(l a_b)  */ 

 select  /*+ index(l a_b)  */ 
     l.id,            
     l.a,          
     l.b,      
     l.c,        
     l.d,        
     l.e,      
     l.f,        
     l.g          
   from Table_A l     
  where l.a = 1 and l.b = 1 ;

/* 创建 列 a、b 的联合索引*/  
create index a_b on Table_A (a, b)
  tablespace E
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    next 1M
    minextents 1
    maxextents unlimited
  );

猜你喜欢

转载自terryjs.iteye.com/blog/2292539