mySql:对批量插入的合理限制
我从客户端收到大量 CSV 数据,我计划将其插入到 mySql 数据库中并在我的应用程序中处理数据。大约涉及10张桌子。每行小于 1k 字节。在单独插入时我应该遵守哪些限制?我在每个表中有几百万行要插入。
让我知道是否需要提供重要数据,例如架构。
I am receiving a large amount of CSV data from a client that I plan to insert into a mySql database and process the data within my application. There are about 10 tables involved. The rows are less than 1k bytes each. What limits should I obey in individual insertions? I have quite a few millions of rows in each table to insert.
Let me know if there are salient data I should provide, such as the schema.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用
load data infile
将数据输入到表中,则无需遵守任何限制。链接: http://dev.mysql.com/doc/refman /5.1/en/load-data.html
If you use
load data infile
to input the data into your tables, there is no limit that you need to obey.Link: http://dev.mysql.com/doc/refman/5.1/en/load-data.html
如果你有大量的插入,你可以使用MySQL的INSERT DELAYED查询,或者你可以增加bulk_insert_buffer_size,这是一个系统变量。单击bulk_insert_buffer_size。
对于 INSERT DELAYED 语法单击此处
If you have large number of insertions than you can use INSERT DELAYED query of MySQL or you can increase bulk_insert_buffer_size which is a system variable. Click bulk_insert_buffer_size.
For INSERT DELAYED syntax Click here