Home » RDBMS Server » Performance Tuning » Scenario : SQL Tuning
Scenario : SQL Tuning [message #65538] Wed, 20 October 2004 01:33 Go to next message
BhavinShah
Messages: 105
Registered: February 2004
Senior Member
Dear frends,

I have some question regarding sql tuning .

Scenario :

Table emp :
empid pk
deptid (fk of deptid of dept)
ename

Table Dept :
deptid pk
dname

Table emp_shift_time :

empid (fk of empid of emp)
shift_id (fk of shift_id of shift_master)

Table shift_master :
shift_id pk
shift_time

Now I want a ename,deptname,shifttime . I have used following query to obtain this o/p.

select e.ename,d.dname,sm.shift_time from emp e ,dept d, emp_shift_time est,shift_master sm
where e.empid=est.empid
and   est.shift_id=sm.shift_id
and   e.deptid=d.deptid

Now I want to optimize this query by avoiding a joins..Is there any way to this.

also i wanted to know if i change the order of join condition then what happens.. means
if i will  use est.empid=e.empid instead of e.empid=est.empid

Can I write this query by other way.

Any Help will be greate Help for me.

Regards

Bhavin Shah
Re: Scenario : SQL Tuning [message #65539 is a reply to message #65538] Wed, 20 October 2004 02:11 Go to previous message
Deepak Panda
Messages: 24
Registered: May 2004
Junior Member
Can you please do an EXPLAIN PLAN for the query and send.

Regards

Deepak
Previous Topic: URGENT:-Query taking more than 14 hrs.
Next Topic: What is hash and nested loop join?
Goto Forum:
  


Current Time: Fri Apr 19 18:18:49 CDT 2024