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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Re: WHERE 1 = 1 (any info on this)

Re: Re: WHERE 1 = 1 (any info on this)

From: <rgaffuri_at_cox.net>
Date: Tue, 21 Oct 2003 05:29:25 -0800
Message-ID: <F001.005D3DC7.20031021052925@fatcity.com>


im assuming this is an old 'trick' from RBO days. Alot of these are still floating around. Wasnt there one when you wanted to force a full table scan you would go

where num_field = 1 + 0;

the + 0 forced the full table scan? I was on a project earlier this year and one guy told people to use it.

The myth about the ordered clause is out there too. Its 99% useless in the CBO. We had some poor .Net developers who knew basic sql. These poor guys were spending hours ordering 10-15 table joins.... I tried not to laugh. Wasnt successful.
>
> From: "Nuno Souto" <nsouto_at_optusnet.com.au>
> Date: 2003/10/21 Tue AM 08:45:02 EDT
> To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
> Subject: Re: WHERE 1 = 1 (any info on this)
>
> AFAIK, it has two origins:
>
> 1- To make editing text sql scripts easier,
> in terms of alignment between the predicates.
>
> 2- As a trick to enhance the WHERE clause in
> blocks in Forms, very old versions.
>
> Other than that never heard it made the slightest
> difference to the CBO.
> Cheers
> Nuno Souto
> nsouto_at_optusnet.com.au
> ----- Original Message -----
> >
> > "the 1=1 is in there to avoid doing repetitive index scans for single
> > rowids, when the app "knows" the result set is going to be manipulated
> > rowid's for a large subset of the table. I would guess your DUAL/CBO example
> > had some similar effect."
> >
> > Is anyone familiar enough with this tweak to explain it ?
> >
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author: Nuno Souto
> INET: nsouto_at_optusnet.com.au
>
> Fat City Network Services -- 858-538-5051 http://www.fatcity.com
> San Diego, California -- Mailing list and web hosting services
> ---------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: <rgaffuri_at_cox.net
  INET: rgaffuri_at_cox.net

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Tue Oct 21 2003 - 08:29:25 CDT

Original text of this message

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