Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Slow select count(*)
Kasthuri -
Try doing a count(pan) rather than count(*). What you want do
to is convice Oracle that it can use the index.
count(Pan) counts the indexed column which should help matters.
You can see how it is being executed by doing a
EXPLAIN PLAN FOR select (pan) from whatever_the_table_name_is;
oh - be sure to create the plan table first and look at the
script that does a waterfall type of select on the plan
table once the explain is accomplished. The scripts for
dealing
with this are IN THE ...RDBMS/ADMIN DIRECTORY oops sorry about
the shift to upper case.
By the way on a PC the rdbms directory is either rdbms73 or
rdbms80.
Becca
> Hi,
>
> I am running Oracle 7.2.3 on Dec OSF 4.0d. There is a table
t1 (pan
> varchar(18), image long raw, len int)
> A select count(*) on this tables takes a long time to return.
This table
> is being updated constantly and is a production database.
>
> there is a primary key constraint on the PAN on a
index_tablespace.
>
> Any ways to improve, Please suggest
>
> Thanks & Regards,
> --
> Kasthuri Jegatheesan
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
>
--
This answer is courtesy of QuestionExchange.com
http://www.questionexchange.com/showUsenetGuest.jhtml?ans_id=8221&cus_id=USENET&qtn_id=7335
Received on Mon Dec 13 1999 - 09:39:50 CST
![]() |
![]() |