Can we improve this qry. [message #165914] |
Mon, 03 April 2006 05:25 |
frank.svs
Messages: 162 Registered: February 2006
|
Senior Member |
|
|
I've 3 tables and i am joining the 3 tables. Now can i improve the performance of the query-4
The following are 3 tables
query-1
-------
select * from grades
grade_id,grade
g1 A
g2 B
query-2
-------
select * from races
raceid race
r1 white
r2 black
query-3
-------
select * from student
sid,sname,race_id,grade_id
101 mmm r1 g1
102 kkk r2 g2
query-4
-------
//to get the detailed info i've joined the 3 tables
SELECT SID,SNAME,race,grade
from student s,races r,grades g where s.race_id=r.raceid
and s.grade_id=g.grade_id
can the above qry can be rewritten using any sub-quieries to improve performance.If so
i want some suggestions.
Thanks and Regards.
frank
|
|
|
|
Re: Can we improve this qry. [message #182242 is a reply to message #165914] |
Thu, 13 July 2006 22:21 |
nmacdannald
Messages: 460 Registered: July 2005 Location: Stockton, California - US...
|
Senior Member |
|
|
I havd extensive experience trying to improve queries. I have fould the best way is to update the optimizer statistics and look at the cost to see if an index would help. Or that you are using the correct index and providing the keys(segemnts of a multi-segment key) for that index. Given the proper opportunity, Oracle does a great job of optimizing.
check the init.ora file to see how the first_rows is set?
Neil.
|
|
|