博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
LOAD DATA INFILE – performance case study
阅读量:5009 次
发布时间:2019-06-12

本文共 4326 字,大约阅读时间需要 14 分钟。

转:

 

I often noticed that people complain about the LOAD DATA performance when loading the table with large number of rows of data. Even today I saw a case where the LOAD DATA on a simple 3 column table with about 5 million rows taking ~15 minutes of time. This is because the server did not had any tuning in regards to bulk insertion.

Consider the following simple MyISAM table on Redhat Linux 32-bit.

 

The table has a string key column. Here is the data file() that I used it for testing:

 

Here is the default  related to LOAD DATA:

 

and here is the actual LOAD DATA query to load all ~5m rows (~256M of data) to the table and its timing.

Now, lets experiment by disabling the keys in the table before running the LOAD DATA:

 

No use, just 1% increase or same…., now lets set the real MyISAM values… and try again…

 

Wow…thats almost 90% increase in the performance. So, disabling the keys in MyISAM is not just the key, but tuning the buffer size does play role based on the input data.

For the same case with Innodb, here is the status by adjusting the Innodb_buffer_pool_size=1G andInnodb_log_file_size=256M along with innodb_flush_logs_at_trx_commit=1.

With innodb_flush_logs_at_trx_commit=2, innodb_flush_method=O_DIRECT and innodb_doublewrite=0; it will be another 40% difference (use all these variables with caution, unless you know what you are doing)

转载于:https://www.cnblogs.com/yuyue2014/p/5542284.html

你可能感兴趣的文章
UNIX环境高级编程 第17章 高级进程间通信
查看>>
ES的Zen发现机制
查看>>
【hibernate】1、Hibernate的一个注解 @Transient
查看>>
flex入门----基础知识
查看>>
HihoCoder 1877 - Approximate Matching
查看>>
【转】C++多继承的细节
查看>>
物联网实验日志-2016-6-8
查看>>
高德地图、腾讯地图、谷歌中国区地图与百度地图坐标系
查看>>
Elastic Search 语法总结
查看>>
py自动化之环境配置
查看>>
Winodws SNMP服务安装和配置(Windows 2003 & 2008 R2)
查看>>
红黑树-想说爱你不容易
查看>>
Git操作指南
查看>>
Loadrunner安装详解
查看>>
c++ primer读书笔记之c++11(一)
查看>>
【题目】英文字符进行频率的统计,直方图输出
查看>>
php最新变异一句话
查看>>
LeetCode-Binary Tree Level Order Traversal
查看>>
COM组件开发实践
查看>>
yii2 源码分析1从入口开始
查看>>