Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Performance tuning for tables without indexes

4fcc5f03-2cb2-49a2-9716-55327ad4fa8cAug 2 2017 — edited Aug 2 2017

Hello All,

I am a newbie in performance tuning. I am facing following issue:

1. I have main table with around 300K records, this table has no constraints or indexes (client is reluctant to add any).

2. I have staging table which receives around 10-15K records every 3 hours and I have to insert and/or update these in main table.

3. I can not use MERGE as they have data issues and client is not ready to change the data so I have to modify the logic from MERGE to Insert-Update.

4. I tried following ways but both took more than 60 minutes.

Update main_table m

set (column list) = (select column_list from staging s where m.id = s.id) ;

Update main_table m

set (column list) = (select column_list from staging s where m.id = s.id)  where exists (select 1 from staging s where s.id = m.id); /* Added exists clause to get records present in staging table only */

I am on Oracle 12.1.0.2

Can you please help me to get out of this?

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 30 2017
Added on Aug 2 2017
9 comments
1,227 views