【Greenplum】insert数据入库速度优化

2022-07-31,,,,

使用geotools入库很慢,1万条数据147秒。
换成Jdbc直接运行insert语句,1万条118秒。
速度非常慢,而且更换Driver速度差不多一模一样。

	private String diverClassName="org.postgresql.Driver";//推荐使用
    private String diverClassName="com.pivotal.jdbc.GreenplumDriver";

优化

greenplum的master端口需要改成5432,不然gpconfig用不了

关闭日志此GUC减少不必要的日志,避免日志输出对I/O性能的干扰
gpconfig -c log_statement -v none
禁用GPORCA优化器(据说GPDB6默认的优化器为:GPORCA)
gpconfig -c optimizer -v off
全局死锁检测开关在Greenplum 6中其默认关闭,需要打开它才可以支持并发更新/删除操作
gpconfig -c gp_enable_global_deadlock_detector -v on

结果

使用Jdbc插入1万条数据,速度由118秒提升至17秒,速度约588条/秒。优化效果明显。
但是没有达到网友的780条/秒提升至2252条/秒的高速度。

参考资料

http://qdcypf.com/article-9770.html

本文地址:https://blog.csdn.net/qq_42158942/article/details/107657679

《【Greenplum】insert数据入库速度优化.doc》

下载本文的Word格式文档,以方便收藏与打印。