我有两个与Spring jdbc批量插入有关的问题:如果有人可以帮我这个
问题1:场景:插入语句是: INSERT into EMPLOYEE_TABLE VALUES(....);
query = "INSERT into EMPLOYEE_TABLE VALUES(....)"; dbConnection.prepareStatement(query);我可以对insert语句提示/*+APPEND_VALUES*/吗?我的意思是在jdbc调用中有提示是否有任何缺点?
问题2:ojdbc6.jar可以拥有的最大批量大小是多少?
提前致谢
I have two questions related to Spring jdbc batch insert : if anybody can help me on this
Question 1: Scenario : The insert statement is : INSERT into EMPLOYEE_TABLE VALUES(....);
query = "INSERT into EMPLOYEE_TABLE VALUES(....)"; dbConnection.prepareStatement(query);Can I have hint /*+APPEND_VALUES*/ to the insert statement ?I mean Is there any disadvantage of having hint in jdbc call ?
Question 2 : What could be maximum batch size ojdbc6.jar can have ?
Thanks in advance
最满意答案
问题1 :我能想到的主要缺点是您依赖于仅限Oracle的功能。 在这种特殊情况下,它不是太糟糕,因为提示不应该改变查询语义。
问题2 :我不知道理论上的最大批量大小,无论如何我建议选择一个“好的”通用初始值(我倾向于选择75,任何介于50和100之间的东西),并通过分析您的特定值来优化这个值用例。 通常,您的初始值将足够好。
Question 1: The main disadvantage I can think of is that you are relying in a Oracle-only feature. In this particular case it is not too bad as that hint should not change query semantics.
Question 2: I don't know about theoretical maximum batch sizes, and anyway I recommend selecting a "good" generic initial value (I tend to choose 75, anything between 50 and 100 willd do), and refine this value by profiling your particular use case. Very often your initial value will be good enough as is.
更多推荐
发布评论