开发者

Multi-Threaded data insertion in MySQL using python

开发者 https://www.devze.com 2022-12-26 02:39 出处:网络
I am working on a project involving insertion a lot of data in to the database. I am wondering if anybody knows how to fill 2 or 3 tables in the database at the same time.An 开发者_JAVA技巧example or

I am working on a project involving insertion a lot of data in to the database. I am wondering if anybody knows how to fill 2 or 3 tables in the database at the same time.An 开发者_JAVA技巧example or psueodecode would be helpful. Thanks


If you have a lot of data to insert into the database all at once, then you probably are interested in bulk loading data. The ideal tool for that is the bulk loader that likely comes with your database -- Oracle, Microsoft SQL Server, Sybase SQL Server, and MySQL (to name the ones that come to mind) all have bulk loaders. For example, Microsoft has the bulk insert statement and the bcp program to perform this task. I recommend you look into that rather than rigging up some tool in python, with or without threads.

0

精彩评论

暂无评论...
验证码 换一张
取 消