Home > Ask the Oracle Database / Applications Experts > Oracle performance tuning Questions & Answers > How to improve performance of column update
Ask The Oracle Expert: Questions & Answers
EMAIL THIS

How to improve performance of column update

Phillip Bracken EXPERT RESPONSE FROM: Phillip Bracken

Pose a Question
Other Oracle Categories
Meet all Oracle Experts
Become an Expert for this site


Oracle tips, scripts, and expert advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


>
QUESTION POSED ON: 26 June 2007

I have a table with 1.5 million records that needs to have a column updated based on a correlated subselect.

update updtbl a
set    updcol = 
(select rtnval 
 from   srctbl s
 where  s.qcol1=a.qcol1
 and    s.qcol2=a.qcol2
 and    s.qcol3=a.qcol3
 and    s.qcol4=a.qcol4);

All the columns referenced in srctbl, including rtnval, are columns in an index; qcol columns are the first ones in the index.

This update is currently sitting at four hours and counting. The database server is on a Linux box. I have a lot more updates such as this to perform on this database. What can I do to improve this performance?



Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
Oracle performance tuning
Can I use TKPROF in Oracle 10g?
Select on Oracle table takes hours
Import of database dump takes 13 hours
Slow query performance for customer with large data volume
ORA-03297 when trying to resize tablespace
Improve performance of SQL query
SMON process consuming 100% CPU
Total Oracle CPU time
See tablespace utilization/database size without DBA privileges
Simple SQL query takes longer than usual

Oracle database performance problems and tuning
Oracle tutorial library: SearchOracle.com's learning guides
What managers should consider when starting a database scaling project
Oracle releases new database, says 11g upgrade will cut costs
Oracle raises prices on database management packs
Oracle New Year's resolutions, part 1: Advice for navigating 2009
Solving common Oracle errors guide
Oracle 11g data compression
Varchar or number for better performance?
Do statistics on SYS-owned objects hurt performance in 10g?
Inside the Oracle 11g SQL Performance Advisor, part 1

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


Here are some suggestions.

  1. Is the updcol column on the updtbl table indexed? If it is, I would first drop or disable the index, and then run this update. After the update is complete, then rebuild the index.
  2. Have you run an Explain Plan on the entire update statement to verify it is using the index on the srctbl in the subquery? If not, please do so to see what access path the optimizer is using. If it is not using an index it is doing a table scan of the scrtbl table for each row in the updtbl table. Also, look at the subquery and run an explain plan on it as well. How long does the subquery take to run when run by itself? If it is using the index what type of access on the index is it using? If the subquery takes a long time to run, then start by tuning it first.
Hope this helps.




Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Oracle White Papers: Fusion Middleware
HomeNewsTopicsTipsAsk the ExpertsMultimediaWhite PapersProductsBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts