Re: any way to speed up count(*)?

From: Shakespeare <whatsin_at_xs4all.nl>
Date: Wed, 25 Nov 2009 22:04:14 +0100
Message-ID: <4b0d9bcb$0$22935$e4fe514c_at_news.xs4all.nl>



joel garry schreef:
> On Nov 25, 8:19 am, Mark D Powell <Mark.Powe..._at_hp.com> wrote:
>> On Nov 24, 7:22 pm, m..._at_pixar.com wrote:
>>
>>
>> In you your example why do you have where 1 = 1 ?  Kind of unnecessary
>> isn't it.

>
> I have an example pinned up on my cube of an OCI generated code that
> has 48 1=1 statements in it. It would be even more unnecessary for me
> to try to get rid of them. :-)
>
> I'm sure there must be more somewhere in this kind of code, that one
> just happened to catch my eye in EM one day. Doesn't seem to bother
> the optimizer at all.
>
> jg
> --
> _at_home.com is bogus.
> Death of wikipedia, news at 11. http://news.cnet.com/8301-1023_3-10403467-93.html
>

Most times, these queries are generated by some tool that needs a where clause anyway, and 'AND's or 'OR's the user specified clauses to it, and they put in the 1=1 for when a user does not enter any condition..

Shakespeare
(What's in = What's in) Received on Wed Nov 25 2009 - 15:04:14 CST

Original text of this message