Home Database Mysql Tutorial mysql技巧:提高插入数据(添加记录)的速度_MySQL

mysql技巧:提高插入数据(添加记录)的速度_MySQL

Jun 01, 2016 pm 01:05 PM
Insert data speed

问题描述:

普通台式机,采集数据,表中已经有>1000万数据量。

采集回来的数据插入表中的时候很慢,每条约100毫秒。

解决方法:

1、加大mysql配置中的bulk_insert_buffer_size,这个参数默认为8M

bulk_insert_buffer_size=100M

2、改写所有insert语句为insert delayed

这个insert delayed不同之处在于:立即返回结果,后台进行处理插入。

还有一个技巧是在一跳insert中插入多条数据,类似insert into tablename values('xxx','xxx'),('yyy','yyy'),('zzz','zzz')...;但是在我采集程序中改sql比较麻烦,故未采用

小编提醒:

说实话一般主要用于数据的采集入库操作,成熟的cms不建议修改,dedecms是由于本人的系统设计问题,建议使用商业版或自行建立索引等,现在大数据首选帝国cms或phpcms。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1268
29
C# Tutorial
1248
24
Uplay download speed continues to be zero, no change Uplay download speed continues to be zero, no change Dec 23, 2023 pm 02:49 PM

Many friends complain about the slow download speed of Uplay, and the download speed of Uplay platform is too slow. Sometimes it is only a few KB, so how to solve it? It is mainly the problem of dns and hosts files. Below, I will tell you about the slow download speed of Uplay. Let’s take a look at the solutions in detail. Uplay download speed is always 0. Solution 1. Double-click to open this computer! As shown in the picture below 2. Enter this computer and find your system disk. Generally, the default is the c drive, as shown in the picture below 3. Then enter this folder: C:\Windows\System32\drivers\etc\, as shown below As shown in the figure below 4. Right-click the hosts file - select Open method, as shown in the figure below 5. Open

How to solve the problem of slow upload speed on Win10 computer How to solve the problem of slow upload speed on Win10 computer Jul 01, 2023 am 11:25 AM

How to solve the slow upload speed of Win10 computer? When we use the computer, we may feel that the file upload speed of our computer is very slow. So what is the situation? In fact, this is because the default upload speed of the computer is 20%, so the upload speed is very slow. Many friends do not know how to operate in detail. The editor has compiled the steps to format the C drive in Win11 below. If you are interested, follow Let’s take a look below! Solution to the slow upload speed of Win10 1. Press win+R to call up run, enter gpedit.msc, and press Enter. 2. Select the management template, click Network--Qos Packet Scheduler, and double-click Limit to reserve bandwidth. 3. Select Enabled, which will bring

Will formatting a laptop make it faster? Will formatting a laptop make it faster? Feb 12, 2024 pm 11:54 PM

Will formatting a laptop make it faster? If you want to format your Windows laptop but want to know if it will make it faster, this article will help you know the right answer to this question. Will formatting a laptop make it faster? There are many reasons why users format their Windows laptops. But the most common reason is slow performance or speed of your laptop. Formatting a laptop will completely delete all data stored on the C drive or the hard drive partition where Windows operating system is installed. Therefore, every user will think twice before taking this step, especially when it comes to the performance of the laptop. This article will help you understand whether formatting your laptop will speed it up. Formatting your laptop helps

In-depth interpretation: Why is Laravel as slow as a snail? In-depth interpretation: Why is Laravel as slow as a snail? Mar 07, 2024 am 09:54 AM

Laravel is a popular PHP development framework, but it is sometimes criticized for being as slow as a snail. What exactly causes Laravel's unsatisfactory speed? This article will provide an in-depth explanation of the reasons why Laravel is as slow as a snail from multiple aspects, and combine it with specific code examples to help readers gain a deeper understanding of this problem. 1. ORM query performance issues In Laravel, ORM (Object Relational Mapping) is a very powerful feature that allows

Compare single-core vs dual-core browser speeds of Google Chrome Compare single-core vs dual-core browser speeds of Google Chrome Jan 29, 2024 pm 11:15 PM

Is single-core Google Chrome slower than dual-core browsers? Nowadays, many people are using various browsers to surf the Internet, and Google Chrome is one of them. As the leader in browsers, its technology is unquestionable. Some friends often ask the editor, what do you mean by single- and dual-core browsers? Will this affect browser loading speed? Today I will talk to you about this issue. Single-core and dual-core browser speed PK of Google Chrome First of all, the editor will give you a conclusion: the single-core Google Chrome is not slower than the dual-core browser. The core of the browser is not like a battery, the more there are, the stronger it is. One of the cores of the dual-core browser is the IE browser core, and the other core is WebKit.

How to improve the speed of large-scale data sorting through PHP multi-threading How to improve the speed of large-scale data sorting through PHP multi-threading Jun 29, 2023 pm 04:15 PM

How to improve the speed of large-scale data sorting through PHP multi-threading. With the rapid development of the Internet and the popularity of big data, the demand for processing massive data is also increasing. Among them, for the common problem of data sorting, how to improve the processing speed has become an urgent problem to be solved. In the field of PHP, multi-threading technology is considered an effective solution. This article will introduce how to improve the speed of large-scale data sorting through PHP multi-threading. 1. The principle of multi-threading Multi-threading refers to the existence of multiple threads at the same time. Multiple threads can execute different tasks at the same time.

LG mass-produces 27-inch 480Hz QHD gaming OLED panel with record-breaking clarity and response speed LG mass-produces 27-inch 480Hz QHD gaming OLED panel with record-breaking clarity and response speed Sep 01, 2024 pm 03:37 PM

Recently, LG Display announced that its 27-inch 480Hz QHD gaming OLED panel has officially entered mass production. This panel has created a new high in refresh rate and response speed among OLED products. The 480Hz refresh rate is paired with a GtG grayscale response time of 0.02ms, which is a step further than the previous record of 0.03ms, bringing the ultimate experience to game types such as FPS and racing. . The new panel optimizes LG Display’s META Technology to improve the luminous efficiency of OLED materials. The image quality is enhanced and specular reflection is greatly reduced. The four-sided frameless design expands the field of view and brings an immersive experience. Pixel structure optimization WRGB pixel structure is optimized for gaming and document editing needs. Text display is clearer

How to improve win7 system speed How to improve win7 system speed Dec 28, 2023 pm 02:48 PM

The running speed of win7 system is closely related to our daily experience when using computers. Whether it is studying, working or watching videos and playing games, the faster the computer, the better. So how to optimize the speed, we can start from many aspects, as follows Let’s take a look together. How to optimize the speed of win7 1. Boot speed 1. We can optimize the boot speed by turning off the startup items. 2. First search and open the "msconfig" program. 3. Check "Selective startup" as shown in the figure. 4. Then uncheck the items that do not need to be started during startup. 2. Optimize performance 1. First use the shortcut key "win+break" to open the system properties interface. 2. Click "Performance Information and Tools" in the lower left corner 3. Check "

See all articles