Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: is it possible in pl/sql?

Re: is it possible in pl/sql?

From: Mark Bole <makbo_at_pacbell.net>
Date: Tue, 15 Feb 2005 09:32:18 -0800
Message-ID: <42123222.9070708@pacbell.net>


Looney, Jason wrote:

> My understanding was in the past count(*) returned a count of all non-null
> rows, where count(1) (or any constant) returned a count of all rows. I just
> verified this with 10g and this is not the case. The performance difference
> was to perform a full table scan, instead of counting leaf blocks in a
> primary key index or something like that. So maybe this was true in 6 or 7?
>
>

[...]

For what it's worth, my recollection is the same, except I think it was the other way around -- count('x') (based on unique index) would return only non-nulls, because of the way regular indexes handle nulls, while count(*) (full table scan) would return all rows.

I couldn't quickly reproduce the behavior in 10g either, and didn't bother with an older version.

-- 
Mark Bole
http://www.bincomputing.com



--
http://www.freelists.org/webpage/oracle-l
Received on Tue Feb 15 2005 - 12:35:32 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US