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: nonefficient count(*)

Re: nonefficient count(*)

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Thu, 28 Jun 2001 16:23:10 +0100
Message-ID: <993741634.26895.0.nnrp-13.9e984b29@news.demon.co.uk>

Your unhinted execution plan seems to indicate that the table is not analyzed - can you repeat this one with the table and its indexes analyzed so that we can see the cost that Oracle THINKS a full scan will be.

--
Jonathan Lewis

Host to The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html

Author of:
Practical Oracle 8i: Building Efficient Databases
See http://www.jlcomp.demon.co.uk/book_rev.html

Seminars on getting the best out of Oracle
See http://www.jlcomp.demon.co.uk/seminar.html






Vadim Grepan wrote in message <3B3B4544.89E4C660_at_mail.ru>...

>Hello All!
>
> I have the table with PK (pk_liquid_product on VARCHAR(12)),
> non-unique index (ndx_liquid_product__artist_id on NUMBER(11)) and
>around 30 non-indexed fields
> (VARCHAR2, NUMBER etc). Total records are around 150.000.
>
> I've got following observation, optimizer doesn't use PK-index
>preferring full-scan.
>Moreover I cannot make to use PK-index even by hint. It's true for
>analyzed and non-analyzed table.
>Are there any explanation and solutions? TFHAOT
>
>Oracle 8.1.7.1, Sun SPARC
>
>### 1 ######
>SQL> select count(*) from liquid_product;
>
>Elapsed: 00:00:03.03
>Execution Plan
>----------------------------------------------------------
> 0 SELECT STATEMENT Optimizer=CHOOSE
> 1 0 SORT (AGGREGATE)
> 2 1 TABLE ACCESS (FULL) OF 'LIQUID_PRODUCT'
>
Received on Thu Jun 28 2001 - 10:23:10 CDT

Original text of this message

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