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

From: Mark D Powell <Mark.Powell2_at_hp.com>
Date: Fri, 27 Nov 2009 16:39:10 -0800 (PST)
Message-ID: <6b0cbb3b-17b1-485c-8a25-d961597d2218_at_f16g2000yqm.googlegroups.com>



On Nov 25, 1:27 pm, joel garry <joel-ga..._at_home.com> wrote:
> 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

Joel, Your explantation is at least half-way logical. I would think that you could write the code to just generate the correct where clause as necessary and to not have one when there no comparison conditions were provided, but I am not the one who had to write the query generation logic.

HTH -- Mark D Powell -- Received on Fri Nov 27 2009 - 18:39:10 CST

Original text of this message