Which one is preferable ? [message #18958] |
Fri, 22 February 2002 18:13 |
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 #18999 is a reply to message #18958] |
Mon, 25 February 2002 07:24 |
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.
|
|
|