Home » SQL & PL/SQL » SQL & PL/SQL » Which one is preferable ?
Which one is preferable ? [message #18958] Fri, 22 February 2002 18:13 Go to next message
diaz
Messages: 58
Registered: October 2001
Member
.. i mean faster to give results
query that select from join tables
or query that select from a view that representing fields from join tables ..

to be more specific is like this :
i have table a, b ,c
which relate by the key : id
the main table a is quite big.. contains more than one million records.

so i want to select some fields from a, b and c
i have build the queries.. and kind of complex one.. because it should compare a.id = b.id and b.id = c.id

now, if i build a view that already manage the comparation. (so the query just select * from the view) would that help ? make the execution time lesser ?

Please help me..
Re: Which one is preferable ? [message #18961 is a reply to message #18958] Fri, 22 February 2002 18:56 Go to previous messageGo to next message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
there wont be any difference. it is same as executing actual query.
Re: Which one is preferable ? [message #18999 is a reply to message #18958] Mon, 25 February 2002 07:24 Go to previous message
Grant
Messages: 578
Registered: January 2002
Senior Member
Try putting the "a" table on the outside, i.e.,

select ....
from c,b,a
where ...

also make sure you have indexes on all the id fields and analyze your tables/indexes. Using a view is the same as long as the query is optimized.
Previous Topic: group by , having question
Next Topic: Compilation Error
Goto Forum:
  


Current Time: Tue Apr 23 23:11:31 CDT 2024