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

Home -> Community -> Usenet -> c.d.o.server -> Re: rownum=1 slow + tell if a column has at least a non null value

Re: rownum=1 slow + tell if a column has at least a non null value

From: Galen Boyer <galenboyer_at_hotpop.com>
Date: 13 Nov 2002 13:42:08 -0600
Message-ID: <uisz145tm.fsf@standardandpoors.com>


On 13 Nov 2002, scjm_at_noos.fr wrote:
> Hello,
>
> I run these queries with toad on my_table (25 millions rows) :
>
> select count(*) from my_table where rownum = 1;
> => 8s
>
> select count(*) from my_table where rownum < 3000000;
> => 30s
>
> select count(*) from my_table where rownum < 30000000;
> => 4 min
>
> 1) Why does it take 8 sec for the first to complete ?
> I thought it would be instantaneous.

The rownum operator is applied to the output of a query. Oracle checks invokes that restriction before returning the result set.

> (select * from my_table where key='value' is instantaneous)

I'm sure there is some index on key.

-- 
Galen Boyer
Received on Wed Nov 13 2002 - 13:42:08 CST

Original text of this message

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