Home » RDBMS Server » Performance Tuning » add 'AND 1 = 0' to your where clause. That will speed things up !
add 'AND 1 = 0' to your where clause. That will speed things up ! [message #65781] Thu, 23 December 2004 02:55 Go to next message
Milind Deshpande
Messages: 93
Registered: May 2004
Member
Hi Experts,

I saw this statement in one of the reply by Frank regarding one query.

How did adding 'AND 1 = 0' to the where clause speeds up the query execution. Actually, I think it should not return anything as it is an inequality condition.

Pls. let me know as I am very curious and in what situations we should add this condition to speed up the query, I mean how to identify that this condition will help.

Thanks in Advance.

Milind.
Re: add 'AND 1 = 0' to your where clause. That will speed things up ! [message #65783 is a reply to message #65781] Thu, 23 December 2004 04:00 Go to previous messageGo to next message
Art Metzer
Messages: 2480
Registered: December 2002
Senior Member
I take it you are referring to this thread. Not to put too fine a point on it, Milind, but you have "been whooshed".

By his comment,
----------------------------------------------------------------------
add 'AND 1 = 0' to your where clause. That will speed things up !

----------------------------------------------------------------------
Frank was flippantly making what is generally known as a joke.

Since Frank apparently thought that the original poster had not provided enough substantive information for Frank to diagnose the slow response time of the mystery query, Frank responded with a tongue-in-cheek answer.

You are correct, adding a predicate of AND 1 = 0 will result in no rows selected, but, you have to admit, doing so will also speed up that query's response time, however pointlessly.

I'm going to go lie down now.
Re: add 'AND 1 = 0' to your where clause. That will speed things up ! [message #65791 is a reply to message #65783] Thu, 23 December 2004 21:18 Go to previous messageGo to next message
Frank Naude
Messages: 4579
Registered: April 1998
Senior Member
Yes, and if 'AND 1 = 0' doesn't work for you, try setting the MAKE_SQL_GO_FASTER init.ora (or should I say SPFILE) parameter :-)

Best regards.

Frank
Re: add 'AND 1 = 0' to your where clause. That will speed things up ! [message #65795 is a reply to message #65791] Sat, 25 December 2004 01:28 Go to previous message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Would that be the secret fast=true switch Tom Kyte is still looking for ? :P

Sorry if I didn't make myself clear, or offended anyone. Didn't mean no harm.

Frank
Previous Topic: High Invalidations for SQL Area
Next Topic: what is the main use of Pmon
Goto Forum:
  


Current Time: Thu Mar 28 03:37:02 CDT 2024