Re: Query Optimizer does not ignore constant condition?

From: Ed prochak <ed.prochak_at_magicinterface.com>
Date: 21 Aug 2003 14:19:42 -0700
Message-ID: <4b5394b2.0308211319.1b5c7db8_at_posting.google.com>


h00_at_hotmail.com (hemal) wrote in message news:<16c83c3f.0308201406.29b9f79d_at_posting.google.com>...
> I came across a very strange situation at work. There is an order of
> magnitude difference in execution time for the following two queries
> (10 v/s ~130 msec):
>
> select count(*) from table_name where column_name = 'value' or 1 = 0
>
> select count(*) from table_name where column_name = 'value'
>
> I do not want to go into the reason why the redundent condition
> exists, the example is representative of the real query where it
> serves a purpose.
>
> Any suggestions what I can do to improve the situation?
>
> Thanks in advance.

I have no explaination for you, just a question: what purpose does a redundant condition serve?

Enquiring minds want to know!

 ed Received on Thu Aug 21 2003 - 23:19:42 CEST

Original text of this message