Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: The Cost Based Optimizer drives me crazy...
Chuck Hamilton (chuckh_at_dvol.com) wrote:
: "Medscheme" <esmev_at_medscheme.co.za> wrote:
: >Help me to explain this:
: >
: >We have a 7.3 database running on NT.
: >
: >This statement (an example) makes use of the index on column1:
: >
: > Select * from table A where column1='xxxx'
: >
: >This statement does NOT make use of the index on column1:
: >
: > Insert into table B (select * from table A where column1='xxxx')
: >
: >Why would this happen?
: >
: >Esmé Venter
: >esmev_at_medscheme.co.za
: >
: Because the CBO is not real good yet. Try giving it a hint to force it
: to use the index.
: insert into table b
: (select /*index(a)*/ * from table a where column1 = 'xxxx');
I think you need a + on the hint
(select /*+ index(a)*/ * from table a where column1 = 'xxxx');
: --
: Chuck Hamilton
: Sr. DBA
: Keystone Mercy Health Plan
: chuckh_at_dvol.com
: "So teach us to number our days that we may present to thee a heart of wisdom"
: (Psalm 90:12 NASB)
-- This posting represents the personal opinions of the author. It is not the official opinion or policy of the author's employer. Warranty expired when you opened this article and I will not be responsible for its contents or use.Received on Tue Sep 09 1997 - 00:00:00 CDT