title: Optimizing a SELECT from Oracle to INSERT into SQLite (in Python3)
body: <p>I have an Oracle database that I'm making an extract of a subset of the data into a local SQLite database.  My code is basically the following:</p>
  
  <pre><code>print(datetime.datetime.now())
  
  #Oracle portion of the script
  sql = '''select [columns] from [table] where [condition]''' 
  oracle_cursor.execute(sql)
  
  print(datetime.datetime.now())
  
  #SQLite portion of the script
  sqlite_conn.executeany('''INSERT into [table] 
                            ([columns]) 
                            values (?,?,?...etc.)''', 
                            oracle_cursor.fetchall()
                         )
  sqlite_conn.commit()
  sqlite_conn.close()
  </code></pre>
  
  <p>It does what  need it to, but it takes longer than I would like.  The execution of the Oracle portion is actually surprisingly fast at around 3 minutes. But the inserting takes much longer. I've played around with the SQLite settings like buffer settings, etc. Nothing seems to break 50 rows / second.  There is a spike in network activity for the first three minutes, but once it prints the second datetime from above, there's no network activity, which leads me to believe the bottleneck is something I've coded.  Is my code inefficient at inserting? If so, is there a better way to get what I'm after?</p>