title: How to optimise massive updates in oracle
body: <p>I need to update a huge table in oracle that contains ~40*10^6 records.
  The number of rows that will be modified will be approximately 10^7.
  The query that determines the rows that will be updated is complex and involves joins. It takes 30 mins just to identify the id of rows that will be updated.</p>
  
  <pre><code>Select p.some_id from
  (select some_id, col2,col3 from t1 where col2='someVulue' and col3 ='someValue') p 
  inner join (select some_id from t2 where t2.col3='someValue') q
  on p.some_id=q.some_id
  </code></pre>
  
  <p>Now in order to do the update i need to add another <strong>join</strong> or use the <strong>IN</strong> statement which will make things even worse.</p>
  
  <p>Is there a way to parallelize this ?
  Or to do a batch update (update 25*10^4 rows each time)? is there a way to tell oracle to only update first n rows ? then n->2n, then 2n->3n ... ?</p>
  
  <p>The script will be ran on a <strong>production</strong> environment so table rebuild is not an alternative.</p>
  
  <p>The update consists of setting a boolean column to true.(if this can help)</p>