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

From: Volker Borchert <>
Date: 26 Nov 2009 19:22:55 GMT
Message-ID: <hemkif$m9h$>

Shakespeare wrote:
> 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..

Surprisingly, the optimizer sometimes seems to do a bad job about such constant clauses. As in "where 1 = 2" resulting in a full table scan...


"I'm a doctor, not a mechanic." Dr Leonard McCoy <mccoy_at_ncc1701.starfleet.fed>
"I'm a mechanic, not a doctor." Volker Borchert  <>
Received on Thu Nov 26 2009 - 13:22:55 CST

Original text of this message