Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Is it the best SQL?

Is it the best SQL?

From: Kevin Lam <lsk01_at_netvigator.com>
Date: Tue, 14 Apr 1998 19:28:25 +0800
Message-ID: <35334859.7EA9F5C5@netvigator.com>


Hi,

I wonder Oracle will tune SQL by itself?

For examples:
1. select * from (select * from a union select * from b) c

    where c.column_1 = 1
2. select * from a where column_1 = 1 union

    select * from b where column_1 = 1
I think method 2 should be faster if Oracle does not tune it, am I right?

Another case is:
1. select * from a, b

    where a.col_1 = b.col_1 and

               a.col_2 = 1
2. select * from a, b

    where a.col_2 = 1 and

               a.col_1 = b.col_1
Which one is faster? I guess case 2!?

BTW, is it possible to build a SQL(add a where cause condition, add a column, etc...) in runtime? (Am I dreaming?)

Thank in advance!

Kevin Received on Tue Apr 14 1998 - 06:28:25 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US