| 
Consider EMP
  table : 
UID VARCHAR2(25) PRIMARY KEY, 
JOINING_DATE DATE, 
ENAME VARCHAR2(100), 
DESG VARCHAR2(50), 
JOB_CODE VARCHAR2(50)) | |||
| 
Index Type | 
Indexed Columns | 
Result | 
Query | 
| 
Composite Index  | 
uid, 
joining_date | 
index works for both  
columns | 
where uid='GANESH' and  
joining_date between '01-jan-11' and '31-jan-11' | 
| 
index works for uid | 
where uid='GANESH' and  
trunc(joining_date) between '01-jan-11' and '31-jan-11' | ||
| 
Full Table scan | 
where upper(uid)='GANESH' and  
joining_date between '01-jan-11' and '31-jan-11' | ||
| 
index works for  
joining_date | 
where joining_date = '01-jan-11'  | ||
| 
Full Table scan | 
where trunc(joining_date) = '01-jan-11'  | ||
| 
index works for  
joining_date | 
select /*+ index(Join_dt_I1) */  *  
from emp   
where  
  joining_date between 
  '01-jan-11' and '31-jan-11'  | ||
| 
Bit Map | 
Job_Code | 
Full Table scan | 
where  
  trunc(joining_date) between  
 '01-jan-11' and
  '31-jan-11' and Job_Code='UUUIII23' | 
| 
index works for  
joining_date and r_code | 
where  
  joining_date between  
 '01-jan-11' and
  '31-jan-11' and Job_Code='UUUIII23' | ||
Blog is to collate the best practices of End to End Database related activities on Data Modelling,ETL,BI and Big-data. Organizations can explore the FOSS(Free and Open-Source software) options for any database,DW and BI related systems depending upon the size of the software and other essential aspects. Examples-FOSS tools: Data modelling -- DB Designer fork; ETL -- PENTAHO,TALEND; BI -- JASPER, Oracle APEX; Big data -- Hadoop; Script Engine -- Pig and Python
Sunday, 20 November 2016
Oracle Index Pocket Reference
Labels:
Performance
Subscribe to:
Post Comments (Atom)
 
No comments:
Post a Comment