Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Dead slow count(*)
I received this tip in a PL/SQL class. On large table you can use count(1)
to force use of the index. I have not verified this but it may help.
>From: Jordi Adame V <jordi_at_inffinix.com>
>Reply-To: oracle-l_at_freelists.org
>To: Oracle-L_at_freelists.org
>Subject: Dead slow count(*)
>Date: Thu, 29 Jan 2004 17:54:46 -0600
>
>Hi!
>
>I have this table with ~4,000,000 entries
>
>When i do a SELECT COUNT(*) FROM TABLE_NAME
>
>it takes 4 hours to give me the result, this is way too much
>
>Im running Oracle 9.2.0.4.0 on RedHat AS 3
>
>These are my first experiences with Oracle, so I have no clue how to fix
>this
>query time... Any help would be nice
>
>regards
>
>Jordi
>
>----------------------------------------------------------------
>Please see the official ORACLE-L FAQ: http://www.orafaq.com
>----------------------------------------------------------------
>To unsubscribe send email to: oracle-l-request_at_freelists.org
>put 'unsubscribe' in the subject line.
>--
>Archives are at http://www.freelists.org/archives/oracle-l/
>FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
>-----------------------------------------------------------------
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Mon Feb 09 2004 - 12:16:11 CST
![]() |
![]() |