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 -> Q: efficiency of clause in view vs select

Q: efficiency of clause in view vs select

From: Malcolm Dew-Jones <yf110_at_vtn1.victoria.tc.ca>
Date: 16 Aug 2002 14:29:34 -0800
Message-ID: <3d5d6ebe@news.victoria.tc.ca>

(in SQL &_O_RELEASE gives version 801070101 )

Am am going to create a view and then select some data from the view filtered on two columns. I am considering the option of putting one of the column where clauses in the view, and wondering if I should anticipate it making any difference to the efficiency of the final query.

e.g. -1-

	create view V1 as 
		select * from table1,table2
		where table1.x=table2.x ;


-- final select
select * from V1 where col1 = 'A' and col2 = 'B';

e.g. -2-

	create view V2 as 
		select * from table1,table2
		where table1.x=table2.x 
		and   col1 = 'A';


-- final select
select * from V2 where col2 = 'B';

Both final select statements get the same data from the same underlying tables, but can I assume that the two techniques will be about equal in terms of efficiency? I can see that my two final queries _might_ end up being identical in terms of what oracle does to get the data, but on the other hand I do not know this aspect of oracle in depth so perhaps there's some hidden gotcha that I have yet to learn. Received on Fri Aug 16 2002 - 17:29:34 CDT

Original text of this message

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