mysql @变量和变量的区别及怎么判断记录唯一性

mysql @变量和变量的区别及怎么判断记录唯一性

DELIMITER//drop PROCEDURE if EXISTS test.express;create PROCEDURE test.express()BEGINselect count(1) into @a from test.test_user where userid=user;select @a;IF @a1 THENselect hello world;ELSEselect error;END IF;END//CALL test.express();通过

mysql –The MEMORY Storage Engine–官方文档

mysql –The MEMORY Storage Engine–官方文档

原文地址:http://dev.mysql.com/doc/refman/5.7/en/memory-storage-engine.htmlTheMEMORYstorage engine (formerly known asHEAP) creates special-purpose tables with contents that are stored in memory. Because the data is vulnerable to crashes, ha

mysql 批量插入数据过多的解决方法

mysql 批量插入数据过多的解决方法

使用场景:测试时需要插入100w的数据,跑sql脚本插入非常慢。存储过程如下://DELIMITERDROP PROCEDURE if EXISTS createAmountCount;create PROCEDURE createAmountCount()BEGINDECLARE i int;set i=0;drop table if exists person ;create table person(id

HASH Partitioning–转载

HASH Partitioning–转载

原文地址:https://dev.mysql.com/doc/refman/5.1/en/partitioning-hash.htmlHASH Partitioning[+/-]18.2.3.1 LINEAR HASH PartitioningPartitioning byHASHis used primarily to ensure an even distribution of data among a predetermined number of parti

MYSQL存储过程中 使用变量 做表名–转

MYSQL存储过程中 使用变量 做表名–转

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

Mysql数据库存储引擎–转

Mysql数据库存储引擎–转

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

mysql 造1亿条记录的单表–大数据表

mysql 造1亿条记录的单表–大数据表

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

关于mybatis里面的Executor–转载

关于mybatis里面的Executor–转载

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

mysql 批量删除数据

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 压力测试之批量插入自增字段不连续问题

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

联系我们

联系我们

0577-28828765

在线咨询: QQ交谈

邮箱: xwei067@foxmail.com

工作时间:周一至周五,9:00-17:30,节假日休息

返回顶部