innodb优化后,29小时入库1300万条数据 参考:http://blog.51yip.com/mysql/1369.html 对于Myisam类型的表,可以通过以下方式快速的导入大量的数据: ALTER TABLE tblname DISABLE KEYS; loading the data ALTER TABLE tblname ENABLE KEYS; 这两个命令用来打开或者关闭Myisam表非唯一索引的更新.在导入大量的数据到一个非空的Myisam表时,通过设置这两个…
1) 对于Myisam类型的表,可以通过以下方式快速的导入大量的数据. ALTER TABLE tblname DISABLE KEYS; loading the data ALTER TABLE tblname ENABLE KEYS;这两个命令用来打开或者关闭Myisam表非唯一索引的更新.在导入大量的数据到一个非空的Myisam表时,通过设置这两个命令,可以提高导入的效率.对于导入大量数据到一个空的Myisam表,默认就是先导入数据然后才创建索引的,所以不用进行设置.而…
转自:https://blog.csdn.net/snakemoving/article/details/76052875 前天遇到一个问题 异常显示如下: 引用 Exception in thread "main" org.springframework.jdbc.UncategorizedSQLException: Error setting null for parameter #6 with JdbcType OTHER . Try setting a different Jd…
--DBA 需要知道N种对数据库性能的监控SQL语句 -- IO问题的SQL内部分析 下面的DMV查询可以来检查当前所有的等待累积值. Select wait_type, waiting_tasks_count, wait_time_ms from sys.dm_os_wait_stats where wait_type like 'PAGEIOLATCH%' order by wait_type --可以通过运行下面的查询得到每个文件的信息,了解哪个文件经常要做读(num_of_reads/…
数据库的创建和sql语句增删改查 1. 载入驱动. 2. 连接数据库. 3. 操作数据库. 创建表: create table person( _id integer primary key, name varchar(20), age integer ); 加入: insert into person(name, age) values('lisi', 19); 删除: delete from person where _id = 1; 改动: update person set name =…
---Oracle数据库更新时间字段数据时的sql语句---格式化时间插入update t_user u set u.name='pipi',u.modifytime=to_date('2015-10-07 00:00:00','YYYY-MM-DD HH24:MI:SS') where u.uid = 11111---使用数据库系统当前时间update t_user u set u.name='pipi',u.modifytime=sysdate where u.uid = 11111…
无需关注字段类型,只要传入字段名与值的集合,自动生成Ms sql server SQL语句.详见Test()方法 using System; namespace Fan.iData.SqlUtility { public class SqlBuilder { private System.Data.DataView ct; private string _tableName; private string _ConnName; public SqlBuilder(string tableName…
通过show status命令了解各种SQL的执行频率 MySQL客户端连接成功后,通过使用show [session|global] status 命令可以提供服务器状态信息: 其中的session来表示当前的连接的统计结果,global来表示自数据库启动至今的统计结果,默认是session级别的. show status 常用命令: show status like 'com_%'; 其中com_xxx表示xxx语句所执行的次数: 重点注意com_select, com_insert, co…
转载自:http://www.blogjava.net/allen-zhe/archive/2010/07/23/326927.html 1. 按需索取字段,跟“SELECT *”说拜拜 字段的提取一定要按照“用多少提多少”的原则,避免使用“SELECT *”这样的操作.做了这样一个实验,表tblA有1000万数据: select top 10000 c1, c2, c3, c4 from tblA order by c1 desc --用时:4673毫秒select top 10000 c1…