Re: speed this up?
Date: Tue, 04 Nov 2008 11:31:14 +0200
Message-id: <49101662.9090106@inter.net.il>
Have you thought to build an index on column2 , column1
so that oracle will read only the index and not the table?
I think that parallel will also help.
Adar Yechiel
Rechovot, Israel
Guang Mei wrote:
> Oracle 10.2.0.1.0
>
> I have a sql that is slow to run:
>
> create table tmp_table nologging as
> (select column1 from table1 where column2 > some_value
> having count(*) > 1 group by column1);
>
> table1 is large, column2 has index on it. The count(*) value in the above query is quite big (typically in thousands) . Since I only need to check if the count(*) is large than 1, is there a way (say to use rownum somehow ) so that when count(*) gets up to 2, it stop counting (using stopkey), therefore I can have the above query run faster?
>
> Thanks.
> Guang
>
>
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>
>
-- http://www.freelists.org/webpage/oracle-lReceived on Tue Nov 04 2008 - 03:31:14 CST