BulkCopy频繁执行产生的性能问题
2024-10-12 15:56:52
问题现象:
完整的SQL脚本如下:
select ac.constraint_name key_name, acc.column_name key_col, 1 from all_cons_columns acc, all_constraints ac where acc.owner = ac.owner and acc.constraint_name = ac.constraint_name and acc.table_name = ac.table_name and ac.constraint_type = 'P' and ac.owner = user and ac.table_name = :TableName order by acc.constraint_name
查阅咨询显示,使用OracleCommandBuilder对象后会产生该语句,而bulkcopy正是使用了该对象。
The query you have mentioned is done by OracleCommandBuilder to get the schema information from the database.
Once queried, the instance of OracleCommandBuilder creates an internal cache of it and reuses it.
But when you create new instance of OracleCommandBuilder it will run this query again.
To avoid it, create OracleCommandBuilder once and reuse it. For example, you can define a static variable to hold the instance,
or you can create it once in caller class and pass it as an argument every use.
按照提示修改每次bulkcopy的批量大小后,问题消失。
最新文章
- kaggle数据挖掘竞赛初步--Titanic<;派生属性&;维归约>;
- 【BZOJ 3809】Gty的二逼妹子序列
- SQLSERVER复制的要点
- Ribbon_窗体_实现Ribbon风格的窗体
- 利用DetachedCriteria实现模糊查询和分页
- 时间日期Date类型
- vim 配置语法高亮 行号标示
- VC环境下编译OpenSSL(仅仅是个示例,网上还有许多相关文章)
- sqlserver 存储过程 带输出参数
- Spring--ClassPathResource
- SpringMvc支持跨域访问,Spring跨域访问,SpringMvc @CrossOrigin 跨域[转]
- MySql查询最近一个月,一周,一天
- Linux 设置IP地址,并能连接外网
- jq控制select值为某个时选中
- centos 基础修改文件权限
- HDU 6129 Just do it(杨辉三角)
- Selenium 错误处理之:stale element reference: element is not attached to the page document
- BaiduMap 鼠标绘制矩形选框四个顶角坐标的获取
- scala简介
- 180619-Yaml文件语法及读写小结