hibernate.jdbc.fetch_size和hibernate.jdbc.batch_size有什么区别? [英] What is the difference between hibernate.jdbc.fetch_size and hibernate.jdbc.batch_size?

查看:100
本文介绍了hibernate.jdbc.fetch_size和hibernate.jdbc.batch_size有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试调整我的应用程序,遇到了一些关于批量提取和批量选择的博客,并将我的理解如下所示。

I am trying to tune my application, came across some blogs speaking about the batch fetch and batch select and putting my understanding as follows.


  • hibernate.jdbc.fetch_size - 用于指定选择查询中要提取的行数。

  • hibernate.jdbc.batch_size - 用于指定在单个数据库命中中执行的插入或更新的数量。

  • hibernate.jdbc.fetch_size - Used to specify number of rows to be fetched in a select query.
  • hibernate.jdbc.batch_size - Used to specify number of inserts or updates to be carried out in a single database hit.

请告诉我,我的理解是否正确?以上参数的最佳值是什么..

Please let me know whether my understanding is correct or not? Also what are the optimal values for the above parameters..

推荐答案

这两个选项都设置了属性在JDBC驱动程序中。在第一种情况下, hibernate.jdbc.fetch_size 设置JDBC驱动程序中语句的提取大小,即当结果多于一行时获取的行数select语句。

Both of these options set properties within the JDBC driver. In the first case, hibernate.jdbc.fetch_size sets the statement's fetch size within the JDBC driver, that is the number of rows fetched when there is more than a one row result on select statements.

在第二种情况下, hibernate.jdbc.batch_size 确定更新次数(插入,更新)和删除)一次发送到数据库执行。此参数是进行批量插入所必需的,但必须与有序的inserts参数和JDBC驱动程序将插入重写为批量插入语句的功能相结合。

In the second case, hibernate.jdbc.batch_size determines the number of updates (inserts, updates and deletes) that are sent to the database at one time for execution. This parameter is necessary to do batch inserts, but must be coupled with the ordered inserts parameter and the JDBC driver's capability to rewrite the inserts into a batch insert statement.

参见此链接

这篇关于hibernate.jdbc.fetch_size和hibernate.jdbc.batch_size有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆