易截截图软件、单文件、免安装、纯绿色、仅160KB

如何提高Mysql语句插入性能

在表中已有大量的index的情况下插入大量数据,可以采用先将索引删除,然后再插入数据,然后再重新建立索引。之所以这样会快是因为???
7.2.14 Speed of INSERT Statements
The time to insert a record is determined by the following factors, where the numbers indicate approximate proportions:
    * Connecting: (3)
    * Sending query to server: (2)
    * Parsing query: (2)
    * Inserting record: (1 x size of record)
    * Inserting indexes: (1 x number of indexes)
    * Closing: (1)
This does not take into consideration the initial overhead to open tables, which is done once for each concurrently running query.
The size of the table slows down the insertion of indexes by log N, assuming B-tree indexes.
You can use the following methods to speed up inserts:
    * If you are inserting many rows from the same client at the same time, use INSERT statements with multiple VALUES lists to insert several rows at a time. This is much faster (many times faster in some cases) than using separate single-row INSERT statements. If you are adding data to a non-empty table, you may tune the bulk_insert_buffer_size variable to make it even faster. See section 5.2.3 Server System Variables.
    * If you are inserting a lot of rows from different clients, you can get higher speed by using the INSERT DELAYED statement. See section 14.1.4 INSERT Syntax.
    * With MyISAM tables you can insert rows at the same time that SELECT statements are running if there are no deleted rows in the tables.
    * When loading a table from a text file, use LOAD DATA INFILE. This is usually 20 times faster than using a lot of INSERT statements. See section 14.1.5 LOAD DATA INFILE Syntax.
    * With some extra work, it is possible to make LOAD DATA INFILE run even faster when the table has many indexes. Use the following pr


相关文档:

MYSQL索引的使用

在数据库表中,对字段建立索引可以大大提高查询速度。假如我们创建了一个
mytable
表:
CREATE TABLE mytable(
ID INT NOT NULL,
username VARCHAR(16) NOT NULL
);
我们随机向里面插入了
10000
条记录,其中有一条:
5555, admin

在查找
username="admin"
的记录
SELECT * from mytable WH ......

mysql load data infile

如何提高mysql load
data
infile
的速度
测试数据2.5G,共有数据9427567条。用的mysql的large服务器的配置。
load
一次需要大概10分钟左右。
建的表用的是MYISAM,调整了几个session的参数值
SET SESSION BULK_INSERT_BUFFER_SIZE=256217728;
SET SESSION MYISAM_SORT_BUFFER_SIZE=256217728;
运行结果如下
Qu ......

Struts2+Spring+Hibernate连接mysql中文乱码解决

1.struts.xml中设置
<constant name="struts.il8n.encoding" value="UTF-8"></constant>
2.jsp页面设置
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
3.数据库连接url
jdbc:mysql://localhost:3306/test?useUnicode=true&amp;characterEncoding=u ......

mysql在红旗linux下全程安装配置祥解

1、下载MySQL的安装文件
安装MySQL需要下面两个文件:
MySQL-server-5.0.46.i386.rpm   
MySQL-client-5.0.46.i386.rpm

2、安装MySQL
rpm文件是Red Hat公司开发的软件安装包,rpm可让Linux在安装软件包时免除许多复杂的手续。该命令在安装时常用的参数是
ivh
,其中i表示将安装指定的rmp软件包,V表 ......

MySQL 导入导出命令

      最近别人在给我 sql 文件时简单的提了下 导入/导出 命令,在此基础上学习了下,总结到 myhere。
    规定:
用户名:db_user
帐号: db_pass
数据库: db_name
表: table_name_1, table_name_2
    说明:  一些操作需要有适当的权限。
1. ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号