Re: Merge statement not using index
Date: Fri, 23 Mar 2012 14:11:05 -0400
If you use "dynamic sql" inside your store procedure to do merge, Oracle will have to re-parse the statement, and m.b. it'll create "correct" execution plan using index instead of FTS. Regards,
On Fri, Mar 23, 2012 at 2:00 PM, Sandra Becker <sbecker6925_at_gmail.com>wrote:
> Oracle - EE 10.2.0.4
> Platform - IBM zSeries, SLES 10
> I have 19 related tables that need to have data archived daily. If I
> run my merge script manually, it uses the primary key index on all the
> tables, both source and target. For obvious reasons I want to
> automate the process. However, when I run the procedure to do the
> merge (so far only one table in the procedure), it does an FTS instead
> of using the pirmary key index. I read where others had the same
> problem and the suggestion was to use the index hint. It is ignoring
> my hint. Due to the size of the majority of these archive tables, an
> FTS is unacceptable.
> Can someone point me in the right direction for resolving this issue?
> I haven't found anything in the Oracle 10g docs or googling yet that
> has been helpful.
> Transzap, Inc.