title: Concurrently execute SQL stored procedures / queries that all write to the same table from python
body: <p>I have a time consuming stored procedure that needs to be run for multiple dates. The stored procedure takes a date as a parameter, and then writes to a table for each date you run it for (the same table, appending for each new date).</p>
  
  <p>Is there a best practices way to concurrently run the stored procedure, or is it forced to run sequentially since you cannot afaik simultaneously write to a table?</p>
  
  <p>I've tried using threads, and it took about as long or longer as just running sequentially would take.  </p>
  
  <p>Sample of relevant code:</p>
  
  <pre><code>def main():
      for date in last_workday_of_month('2015-10-31','2015-8-31'):
          t1=Thread(target=query,args=('time_consuming_stored_proc',date))
          t1.start()
          t1.join() 
  </code></pre>