Re: Joining 5 tables vs. using temp table
Posted in 1998
Topics: Performance & Tuning, SQL Development & Query Writing
If proper indexes are there, the query listed below should
give better performance(I remember informix reccomending this
some where)
"set explain on " and see if all the index's available are
used. Some time if the tables are quiet large or update statistics is
not done regularly, some of available index may not be used.
If this is happening, you should go for temperary table and
force engine to use all available index.
Cheers,
Abhi
Sukumar Konduru wrote in message <6kh2ii$k5f$1@gte1.gte.net>...
>Hi
>
>
>This is the SQL query for joins
>
>select div.div_mgr_id, t.taskid,count(*)
>from reg_mgr r, div_mgr div, dis_mgr dis,loc_mgr l, usr_list
>usr,taskresult t
>where r.reg_serial = "1">div.div_serial = dis.div_serial and
>dis.dis_serial = l.dis_serial and
>l.loc_serial = usr.loc_serial and
>usr.user_id = t.userid and
>group by 1,2
>order by 1,2
>
>What is the performance gain? Is it better always to use temp table.
>
>Could you please mail me
>
>Thank you
>Sukumar Konduru
>
>sukumar@gte.net
>