The "+0" is simple arithmetic... Since the value is a number they add zero to the value to trick the optimisor into thinking the index is useless without actually changing the value. I guess alternatives would be *1 (multiply by one), /1 (divide by one) and -0 (subtract zero). For text based columns the use of ||'' (append an empty string) achieves a practically identical result.
"Eriovaldo Andrietta" To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]> <[EMAIL PROTECTED] cc: om.br> Subject: Re: Resource for index Sent by: [EMAIL PROTECTED] .com 15/10/2003 11:44 Please respond to ORACLE-L Dear Stephane, At first, my apologize by the word "Resource", it was the first word that I found out and wrote it. The case is that this command +0 , you can put it in the sentence line of where and the sintaxe is correct. Oracle executes the statment and don't gives error message. My doubt is : What this +0 does in the sql ? Imagine a column unindexed that you can not create a index, because it will do a bad performance in all the system, you can use +0 that it will break the index . It is what i eard. But i am searching about this +0 and until now, i didn't find out nothing about it. For me it doesn't exist. Did you do a test ? You can put it at the statment that will run , normaly. And more, if you to use explain plan the table (unindexed) will have a FULL TABLE SCAN. So, I ask : What is this +0 ? Resource or not , it is my hard doubt. Regards Eriovaldo ----- Original Message ----- To: "Multiple recipients of list ORACLE-L" <[EMAIL PROTECTED]> Sent: Monday, October 13, 2003 4:04 PM > > Friends : > > > > I have a part of statment as below : > > > > select column1 from table1 > > where column1 = v_parameter; > > > > The column1 is not indexed, so the table full scan will be executed. > > Right? > > Well, I would like to know if anyone knows the resource : > > > > select column1 from table1 > > where column1 = v_parameter +0 > > > > What does it mean (+0). > > What kind of resource is it ? > > What does it do ? > > > > Best Regards > > > > Eriovaldo > > Eriovaldo, > > Don't understand too well what you mean by 'resource'. One of the > most cunning performance tips of yore was to either concatenate an empty > string to a string or date column or add a zero to a number column to > prevent the RBO from using an index on this column (BTW it's a trick > which can still be useful at times) when this index was known to be not > very selective. > Quite obviously, applying this to the constant part of an equality is > totally pointless. And since the column is unindexed, it wouldn't have > much utility either on the other side of the equality. > Another case of ill-digested and ill-understood trick. > > -- > Regards, > > Stephane Faroult > Oriole Software > -- > Please see the official ORACLE-L FAQ: http://www.orafaq.net > -- > Author: Stephane Faroult > INET: [EMAIL PROTECTED] > > 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: [EMAIL PROTECTED] (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: Eriovaldo Andrietta INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<---->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Privileged/Confidential information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply e-mail or by telephone on (61 3) 9612-6999. Please advise immediately if you or your employer does not consent to Internet e-mail for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Transurban City Link Ltd shall be understood as neither given nor endorsed by it. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<---->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<---->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Privileged/Confidential information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such a case, you should destroy this message and kindly notify the sender by reply e-mail or by telephone on (03) 9612-6999 or (61) 3 9612-6999. Please advise immediately if you or your employer does not consent to Internet e-mail for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Transurban Infrastructure Developments Limited and CityLink Melbourne Limited shall be understood as neither given nor endorsed by them. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<---->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Mark Richard INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).