title: Why would a stored procedure take forever to execute but the code in the procedure runs quickly on it's own?
body: <p>Firstly, this is Oracle.  If I do this...</p>
  
  <pre><code>execute my_package.sp_execute_my_procedure('...', '...');
  </code></pre>
  
  <p>It seems to run indefinitely (I let it go over night).</p>
  
  <p>However, if I take the code from the stored procedure, slap it into a pl/sql anonymous block, put the declare keyword on my single cursor and run it, it finishes in like 10 minutes.  Which is how long it should take.</p>
  
  <p>Without posting all the code, at least right off the bat, has anyone ever seen anything like this?</p>
  
  <p><b>UPDATE:</b> Ok, so I'm noticing when I select from v$session, while running the proc I'm getting an "UNKNOWN" blocking_session_status with the event "direct path write temp."</p>
  
  <p>I can't quite tell from the little bit of googling I've done so far what that means yet.</p>