RE: Just as a learning exercise

From: Ric Van Dyke <ric.van.dyke_at_hotsos.com>
Date: Wed, 4 May 2011 09:46:14 -0500
Message-ID: <C970F08BBE1E164AA8063E01502A71CF01AA3040_at_WIN02.hotsos.com>



Roger that. That *IS* where it's useful as a place holder, but nothing more. The good old programming "sub", like writing a PL/SQL procedure with just

BEGIN
  NULL;
END; As the code, it's there and a call to the procedure will always work, because it does nothing! And it runs really fast too!

But would adding a "NULL" to the top of every PL/SQL block make it run faster? I think we can all agree that it wouldn't, and logically that is about the same thing that adding 1=1 to your query.



Ric Van Dyke
Hotsos Enterprises
Cell 248-705-0624
 

The 10th Hotsos Symposium
4-8 March 2012 Start making plans now!    

-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Michael McMullen
Sent: Wednesday, May 04, 2011 10:34 AM
To: oracle-l_at_freelists.org
Subject: RE: Just as a learning exercise

We use 1=1 a lot for on the fly report generation with different conditions
that the user can specify, this way "and" statements can just be tacked on
at the end and then the query run, it's all done via pl/sql.

-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]
On Behalf Of Ric Van Dyke
Sent: Wednesday, May 04, 2011 10:12 AM
To: Rui.Amaral_at_tdsecurities.com; rjoralist2_at_society.servebeer.com; oracle-l_at_freelists.org
Subject: RE: Just as a learning exercise

I'm pretty sure that 1=1 has never improved performance of a query; it's like adding "TURE" to a statement. Certainly since about 9 or so the optimizer removes it as a predicate, notice the 1=1 predicate isn't applied
at all in the plan below (yes I truncated the plan so as to fit better):

--
http://www.freelists.org/webpage/oracle-l


--
http://www.freelists.org/webpage/oracle-l
Received on Wed May 04 2011 - 09:46:14 CDT

Original text of this message