Prueba

Sql code posted
created at 07 May 12:30

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
create index IDX_GCBILL_DH_CTG_RELATED_01 ON GCBILL_DH_CTG_RELATED(COD_RELATION, CTG_SOURCE, CTG_RELATED, DH_SOURCE, DH_RELATED);
create index IDX_GCBILL_DH_CTG_RELATED_02 ON GCBILL_DH_CTG_RELATED(COD_RELATION, CTG_SOURCE, CTG_RELATED, DH_SOURCE, DH_RELATED);

exec DBMS_STATS.UNLOCK_TABLE_STATS('DELTA_ADMINIS', 'GCBILL_DH_CTG_RELATED');  
EXECUTE dbms_stats.gather_index_stats('DELTA_ADMINIS','IDX_GCBILL_DH_CTG_RELATED_01');
EXECUTE dbms_stats.gather_index_stats('DELTA_ADMINIS','IDX_GCBILL_DH_CTG_RELATED_02');
EXECUTE dbms_stats.gather_table_stats(ownname=>upper('DELTA_ADMINIS'),tabname=>upper('GCBILL_DH_CTG_RELATED'),cascade=>true,degree=>2);
exec DBMS_STATS.UNLOCK_TABLE_STATS('DELTA_ADMINIS', 'GCBILL_DH_CTG_RELATED'); 



SELECT /*+ NO_INDEX(GCBILL_DH_CTG_RELATED) */ COD_RELATION, CTG_SOURCE, CTG_RELATED, DH_SOURCE, DH_RELATED
  FROM GCBILL_DH_CTG_RELATED WHERE COD_RELATION = 'RDHCTG0001' 
  ORDER BY COD_RELATION, CTG_SOURCE, CTG_RELATED, DH_SOURCE, DH_RELATED; 
  
SELECT /*+ index(GCBILL_DH_CTG_RELATED IDX_GCBILL_DH_CTG_RELATED_01) */ COD_RELATION, CTG_SOURCE, CTG_RELATED, DH_SOURCE, DH_RELATED
  FROM GCBILL_DH_CTG_RELATED WHERE COD_RELATION = 'RDHCTG0001' 
  ORDER BY COD_RELATION, CTG_SOURCE, CTG_RELATED, DH_SOURCE, DH_RELATED; 
  
SELECT /*+ index(GCBILL_DH_CTG_RELATED IDX_GCBILL_DH_CTG_RELATED_02) */ COD_RELATION, CTG_SOURCE, CTG_RELATED, DH_SOURCE, DH_RELATED
  FROM GCBILL_DH_CTG_RELATED WHERE COD_RELATION = 'RDHCTG0001' 
  ORDER BY COD_RELATION, CTG_SOURCE, CTG_RELATED, DH_SOURCE, DH_RELATED; 
1.5 KB in 5 ms with coderay