插入查询中的性能问题 [英] Performance issue in insert queries
本文介绍了插入查询中的性能问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
HI伙计们,
只是一个快速的问题:
我创建一个sqlfile with lot插入查询(例如:8000个不同的插入查询)
。
我通过cmd运行此文件
来自cmd的
:
i将连接数据库运行带有插入查询的文件,而不是我要提交的。
我可以做些什么来让它更快吗?
我尝试过:
我不知道我能做什么,这就是我问你的原因。
HI guys,
Just a quick questioN:
I am create an sqlfile with lot of insert queries (ex: 8000 different insert queries)
.
I am running this file through cmd
from cmd:
i will connect with a database run the file with insert queries than i will commit.
Can i do something to make it more faster ?
What I have tried:
I do not know what can i do that's why i am asking you .
推荐答案
请检查是否有任何触发器/索引是你要在那个表上创建插入数据。如果你发现那么请禁用触发器/索引然后你可以尝试插入。
Can you please check if there is any Triggers/Indexes is created on that table in which you are going to insert data.If you find that then please disable triggers/indexes then you can try to insert.
当你执行插入8000条记录时它肯定会杀死表演。在这种情况下,内存和CPU速度也很重要。而是将它们分成8个查询,每个查询1000条记录。这将提高性能。
when you execute inserting 8000 records it will definitely kill the performance. In this case memory and cpu speed also counts. Instead split them into 8 queries each of 1000 records. That will improve performance.
这篇关于插入查询中的性能问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文