RE: Just as a learning exercise

From: Michael McMullen <ganstadba_at_hotmail.com>
Date: Wed, 4 May 2011 10:33:30 -0400
Message-ID: <SNT130-ds1966FFE57C1CF3F5E47155A6810_at_phx.gbl>



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 Received on Wed May 04 2011 - 09:33:30 CDT

Original text of this message