title: sql statements run much slower in python than commandline sqlite3
body: <p>I have a sql script that creates 2 temp tables, then creates 2 permanent tables based on the temp tables (4 steps).  No rows are returned.  When that script is run from the command line using 
  <code>$ sqlite3 MyDB.db -init Summarize.sql</code> 
  it takes less than a minute.<br>
  When the sql is run as a big string in python (via the sqlite3 standard module)
  <code>connection.executescript("""&lt;contents of Summarize.sql here&gt;""")</code>
  it takes 15 minutes.  (The first 3 steps take 1 minute, the last step takes the remaining 14.)</p>
  
  <p>Given that it's the exact same sql, what could python be doing that would slow it down so much?  How can I speed this up?
  (The last step is a <code>drop table if exists xxx; create table xxx as select ...</code>  It's a join, but it's the same join that the command line runs quickly.)  A friend suggested the apsw module, but I'm loathe to switch without strong cause.</p>