Kamis, 06 Agustus 2015

Tuning SQL Query





 ----- CREATE INDEX EXAMPLE

CREATE INDEX INDEX_01 ON HR.PERUSAHAAN(TO_CHAR(KODE_PERUSAHAAN))
nologging
parallel 4;


----- TUNING QUERY SELECT EXAMPLE 1

SELECT 
/*+ PARALLEL (4) */
      A.KD_PEGAWAI,
      A.KD_PERUSAHAAN,
      A.KD_PROGRAM,
      COUNT(1) MASA_IURAN
FROM
      (   select
              kd_tk,
              kd_prg,
              kd_iur,
              kd_prs
          from  


              TABLE_IURAN_TK
          WHERE
              KD_PEGAWAI IS NOT NULL
              AND KD_IURAN IS NOT NULL
              AND TGL_REKAM > '31-DEC-2009'
              AND TGL_REKAM <= SYSDATE      ) A
GROUP BY
     A.KD_PEGAWAI,
     A.KD_PERUSAHAAN,
     A.KD_PROGRAM

 

0 komentar :

Posting Komentar

Mari berkomentar dengan baik, benar, dan sopan :D

 
;