kalo masih RBO style, ya query ke-2 lah... tapi kalo udah CBO....he..he.. musti cek actual executionnya kayak apa bisa dgn (pilih salah satu) : - sql_trace (system wide or session wide), - dbms_support.start_trace_in_session (sid, serial, waits=>TRUE, binds=>TRUE) - dbms_system.set_ev (SID,SERIAL, 10046, 12, '') - oradebug event 10046 trace name context forever, level 12
pada prisipnya dgn CBO even query no 1, sepertinya juga optimal...karena selectivity & cardinality, apalagi kalo di table2 tsb histogram n other statistic nya uptodate. cmiiw ujang On 10/31/06, Henri Alia Putra <[EMAIL PROTECTED]> wrote: > > Dear all, > > sebenarnya gw masih belajar di oracle , mungkin masih jauh ilmunya > dibandingin rekan2 yg lain, mau ikutan nimbrung dikit, > > pernah baca di sebuah literatur tuning, sitenya lupa, yg mana dikasih tau > , sedapat mungkin hindari pemakaian beween, lebih baik memakai > dan <, > dan dari script yg di tanyakan saya lebih condong memakai yg no 2, karena > dah dibatasi lebih dulu. > > source > SQL2 = select a.no,b.kdbarang > from faktur a,faktur_d b > where tglfaktur between '01-JAN-2006' and '31-JAN-2006' > and a.kdpel between '001' and '010' > and a.no=b.no > > versi henri > > SQL2 = select a.no,b.kdbarang > from faktur a,faktur_d b > where a.tglfaktur >= '01-JAN-2006' => alias nya saya > tambahkan (tapi ga tau apakah ini punya faktur, ato faktur_d) ,karena pernah > nyoba tanpa alias dgn memakai alias perf agak significan > and a.tglfaktur <= '31-JAN-2006' > and a.kdpel >= '001' > and a.kdpel <='010' > and a.no=b.no > > mungkin rekan2 ada yg lebih tau dan memberikan koreksi aas jawaban saya > ini > > tapi untuk lebih memuaskan, bisa dijalankan satpack, dari sana bisa diliat > berapa cost nya, ato kalo anda pake tools toad, ato oem, bisa diliat > realtime cost oracle, cpu dll > > > wassalam > > Henri Alia Putra > Information Technology - Performance Available and Security > PT. Federal International Finance > Jl, Gaya Motor Raya No 8 > Gedung AMDI B. > Jakarta Utara > Phone : 021-65300708 ext 249 > Fax : 021-65300709 > > > ________________________________ > > From: [email protected] on behalf of agus sulaiman > Sent: Tue 10/31/2006 2:33 PM > To: [email protected] > Subject: [indo-oracle] Tuning SQL > > > > Kepada Teman-teman semuanya, > > > Dalam melakukan tuning SQL ada yang saya ingin tanyakan mana yang > lebih cepat antara SQL1 dan SQL2? dan alasannya kenapa ya? > > SQL1 = select a.no,b.kdbarang > from faktur a,faktur_d b > where a.no=b.no > and a.tglfaktur between '01-JAN-2006' and '31-JAN-2006' > and a.kdpel between '001' and '010' > > SQL2 = select a.no,b.kdbarang > from faktur a,faktur_d b > where tglfaktur between '01-JAN-2006' and '31-JAN-2006' > and a.kdpel between '001' and '010' > and a.no=b.no > > NB : Untuk semua field yang difilter telah diberi index. > > Mungkin teman-teman ada yang mengetahuinya. > > > Thanks, > Agus. > > [Non-text portions of this message have been removed] -- -----------I.N.D.O - O.R.A.C.L.E--------------- Keluar: [EMAIL PROTECTED] Website: http://indo-oracle.blogspot.com Mirror: http://indooracle.wordpress.com ----------------------------------------------- Bergabung dengan Indonesia Thin Client User Groups, Terminal Server, Citrix, New Moon Caneveral, di: http://indo-thin.blogspot.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/indo-oracle/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/indo-oracle/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

