Skip to content

Commit

Permalink
Use multi-row inserts for massive speedups on to_sql
Browse files Browse the repository at this point in the history
As suggested here - pandas-dev#8953
  • Loading branch information
nmichaud committed Mar 3, 2016
1 parent 9ce1bc4 commit 2018d5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pandas/io/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ def insert_data(self):

def _execute_insert(self, conn, keys, data_iter):
data = [dict((k, v) for k, v in zip(keys, row)) for row in data_iter]
conn.execute(self.insert_statement(), data)
conn.execute(self.insert_statement().values(data))

def insert(self, chunksize=None):
keys, data_list = self.insert_data()
Expand Down

0 comments on commit 2018d5d

Please sign in to comment.