
MYSQL存储过程中 使用变量 做表名–转
原文地址:http://blog.csdn.net/business122/article/details/7528859今天写一个对数据库做快照的存储过程,用到了动态表名,突然发现MYSQL不支持直接使用变量做表名,GOOGLE了下,采用以下方法:DECLARE dbName VARCHAR(30);SET dbName = aaa;SET @STMT :=C

Mysql数据库存储引擎–转
原文地址:http://pangge.blog.51cto.com/6013757/1303893简单介绍存储引擎就是指表的类型。数据库的存储引擎决定了表在计算机中的存储方式。存储引擎的概念是MySQl的特点,而且是一个插入式的存储引擎概念。这就决定了MySQl数据库中的表可以使用不同的存储方

mysql 造1亿条记录的单表–大数据表
读写文件背景及木:现有数据1000w单表,为压力测试准备1亿条数据。步骤:1.将1000w条记录,除id外都导入到多个文件中://DELIMITERDROP PROCEDURE if EXISTS createManyTable;create PROCEDURE createManyTable()BEGINDECLARE i int;DECLARE fileName VARCHAR

关于mybatis里面的Executor–转载
原文地址:http://blog.csdn.net/w_intercool/article/details/7893344使用mybatis查寻数据,跟踪其执行流程最开始执行的语句[java]view plaincopyprint?this.getSqlSession().selectList(QUERY-QUESTION,data,rowBounds);这里需要找到sqlsession是从哪里来的

mysql 批量删除数据
批量删除2000w数据使用delete from table太慢//DELIMITERDROP PROCEDURE if EXISTS deleteManyTable;create PROCEDURE deleteManyTable()BEGINDECLARE i int;set i=1;while i2001DODELETE FROM `f_log` WHERE (`id` 95000000) ORDER BY `id` LIMIT 10000;SELE

mysql 压力测试之批量插入自增字段不连续问题
Gaps in auto-increment values for“bulk inserts”Withinnodb_autoinc_lock_modeset to 0 (“traditional”) or 1 (“consecutive”), the auto-increment values generated by any given statement will be consecutive, without gaps, because the table

使用solr的DIHandler 构建mysql大表全量索引,内存溢出问题的解决方法
solr官方给出的解决方式是:DataImportHandler is designed to stream row one-by-one. It passes a fetch size value (default: 500) to Statement#setFetchSize which some drivers do not honor. For MySQL, add batchSize property to dataSource configu

Mybatis like查询的写法–转载
原文地址:http://lavasoft.blog.51cto.com/62575/1386870Mybatis like查询官方文档没有明确的例子可循,网上搜索了很多,都不正确。Mybatis 3.2.6经过尝试,给出三种可靠可用的写法:select * from person where name like %#{name}%select * from person wh

mysql 获取自增id的值的方法
原生jdbc方式:Statement.getGeneratedKeys()示例:Statement stmt = null;ResultSet rs = null;try {//// Create a Statement instance that we can use for// normal result sets assuming you have a// Connection conn to a MySQL database already// ava