Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Do I need an Index?
1200 records out of 3500 --- > full table scan, as full table scan will
be cheaper compared to using index.
If it is a web page (ie not PL/SQL, not a batch function), and the
end-user definitely doesn't want to see all 1200 records (why he is
asking such large resultset beats me), you would need the
(generic) hint /*+ FIRST_ROWS */. In that case the index will be used.
You may need to make sure the user is running in first_rows mode
by issuing
alter session set optimizer_mode = first_rows
in an after-logon trigger,
or change the init.ora parameter optimizer_goal to first_rows (this
change will be instance wide, so beware).
You may also need to verify the optimizer_index_cost_adj and
optimizer_index_caching. The defaults favor full table scan.
Set them to 40 and 95 respectively. Can be changed on instance, system
and session level.
I would appreciate if you don't abbreviate my first name.
Hth
-- Sybrand Bakker Senior Oracle DBAReceived on Thu Aug 11 2005 - 02:43:33 CDT
![]() |
![]() |