开发者

Problem of late insertion in mysql database

开发者 https://www.devze.com 2023-02-18 06:27 出处:网络
While I am inserting approx 50000 or more ro开发者_开发百科ws in a database, It seems insertion still running in backend even though database pointer is seems free in process.

While I am inserting approx 50000 or more ro开发者_开发百科ws in a database, It seems insertion still running in backend even though database pointer is seems free in process.

every time I refresh the database, total rows shows increasing every time.

So should I use transaction to insert them in a single stroke?


The purpose of transactions is to be able to rollback the complete process if one of the insertions fail. It makes no sense to use transactions as a way to speed up things since it obviously adds additional overhead, thus making it all slower.


No, don't insert so many rows in a single transaction. You would end up running out of log space.

0

精彩评论

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