| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Index is not used, though HINT specified
I have a table named "org_cols" with a index "org_cols" on a column
"COL13". Table is analyzed. I am writing following query and its doing
full table scan. But if I write second query, it uses index. I know
here that all the values in column "COL13" is greater then zero so I
am safe, but is there a way to force the query without WHERE clause to
use an index.
SELECT /*+ INDEX (org_cols org_cols)*/ COUNT(*)
FROM org_cols;
Does full table scane.
SELECT COUNT(*)
FROM org_cols
WHERE col13> 0;
Uses the index and return result in one tenth of the time taken by
previous query.
Thanks, Received on Fri Apr 30 2004 - 16:17:39 CDT
![]() |
![]() |