- 2025年07月27日
- 星期日

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();通过

原文地址: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

使用场景:测试时需要插入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

原文地址: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

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

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

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

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

批量删除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