Create a raw MySQL query in Django to bulk updata millions of records

已关闭 已发布的 7 年前 货到付款
已关闭 货到付款

I have a very large MySQL table in my Django project. I need a Django Management Command with raw MySQL query to bulk updata millions of records.

If I just create a big string with one million update queries MySQL will go away.

e.g.:

"

UPDATE my_big_table SET value = 15.61 WHERE id = 1;

UPDATE my_big_table SET value = 35.61 WHERE id = 2;

...

UPDATE my_big_table SET value = 265.58.61 WHERE id = 1000000;

"

So the idea is to to create the the query in batches of 1000 and to update the MySQL database using threading ...

... keep getting: [login to view URL]: (2014, "Commands out of sync;

Django Python

项目ID: #12966798

关于项目

5个方案 远程项目 活跃的7 年前

有5名威客正在参与此工作的竞标,均价$59/小时

tangramua

dear sir, my team has relevant sql experience. Drop me a line if you are interested.

$54 USD 在3天内
(7条评论)
4.2
sgayu12

A proposal has not yet been provided

$35 USD 在2天内
(0条评论)
0.0
jayantsingh305

i have done it already using multiprocessing put raw data in amazon redshift data ware house. so i same way i will perform the updation

$50USD 在1天里
(0条评论)
0.0