随笔分类 -  数据库

上一页 1 2 3 4 5 下一页
mysql Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT
摘要:使用mysql的时候,用到int类型的蛮多,需要注意一下: 1. 值的范围 2. 显示宽度 MySQL还支持选择在该类型关键字后面的括号内指定整数值的显示宽度。 int(M) 在 integer 数据类型中,M 表示最大显示宽度,该可选显示宽度规定用于显示宽度小于指定的列宽度的值时从左侧填满宽度。 阅读全文
posted @ 2016-05-09 17:04 一天不进步,就是退步 阅读(433) 评论(0) 推荐(0)
Rick's RoTs -- Rules of Thumb for MySQL--转载
摘要:原文地址:http://mysql.rjweb.org/doc.php/ricksrotsBrought to you by Rick JamesHere are 160+ tips, tricks, suggestions, etc. They come from a decade of impr... 阅读全文
posted @ 2015-11-30 10:24 一天不进步,就是退步 阅读(238) 评论(0) 推荐(0)
Want to archive tables? Use Percona Toolkit’s pt-archiver--转载
摘要:原文地址:https://www.percona.com/blog/2013/08/12/want-to-archive-tables-use-pt-archiver/Percona Toolkit’spt-archiveris one of the best utilities to archiv... 阅读全文
posted @ 2015-11-02 17:35 一天不进步,就是退步 阅读(452) 评论(0) 推荐(0)
mybatis中#{}和${}的区别
摘要:mybatis本身的说明:String SubstitutionBy default, using the #{} syntax will cause MyBatis to generate PreparedStatement properties and set the values safely... 阅读全文
posted @ 2015-11-02 10:24 一天不进步,就是退步 阅读(27239) 评论(2) 推荐(2)
Loading half a billion rows into MySQL---转载
摘要:BackgroundWe have a legacy system in our production environment that keeps track of when a user takes an action on Causes.com (joins a Cause, recruits... 阅读全文
posted @ 2015-10-28 11:51 一天不进步,就是退步 阅读(347) 评论(0) 推荐(0)
mysql 表的timestamp为自动添加
摘要:新设计表时可以执行语句:`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',修改表可执行语句:ALTER TABLE table_name MODI... 阅读全文
posted @ 2015-10-23 13:22 一天不进步,就是退步 阅读(766) 评论(0) 推荐(0)
MySQL数据库InnoDB存储引擎中的锁机制--转载
摘要:原文地址:http://www.uml.org.cn/sjjm/201205302.asp00 – 基本概念当并发事务同时访问一个资源的时候,有可能导致数据不一致。因此需要一种致机制来将访问顺序化。锁就是其中的一种机制。我们用商场的试衣间来做一个比喻。试衣间供许多消费者使用。因此可能有多个消费者同时... 阅读全文
posted @ 2015-10-17 11:16 一天不进步,就是退步 阅读(876) 评论(0) 推荐(0)
mysql测试spring事务是否生效
摘要:同时对三张表进行插入操作,事务保证完整性。下面进行简单测试:1. 锁定表锁定用户表LOCK TABLES user WRITE;查看表是否锁定:show OPEN TABLES where In_use > 0;显示被锁定的表。2. 验证在同一session下是否可以插入操作insert into ... 阅读全文
posted @ 2015-10-15 15:59 一天不进步,就是退步 阅读(959) 评论(0) 推荐(0)
Mybatis like查询的写法--转载
摘要:原文地址:http://lavasoft.blog.51cto.com/62575/1386870Mybatis like查询官方文档没有明确的例子可循,网上搜索了很多,都不正确。Mybatis 3.2.6经过尝试,给出三种可靠可用的写法:select * from person where nam... 阅读全文
posted @ 2015-10-09 18:17 一天不进步,就是退步 阅读(538) 评论(0) 推荐(0)
mysql 获取自增id的值的方法
摘要:原生jdbc方式:Statement.getGeneratedKeys()示例:Statement stmt = null;ResultSet rs = null;try { // // Create a Statement instance that we can use for ... 阅读全文
posted @ 2015-09-24 19:43 一天不进步,就是退步 阅读(4495) 评论(0) 推荐(0)
使用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 som... 阅读全文
posted @ 2015-09-11 14:46 一天不进步,就是退步 阅读(621) 评论(0) 推荐(0)
mysql 压力测试之批量插入自增字段不连续问题
摘要:Gaps in auto-increment values for“bulk inserts”Withinnodb_autoinc_lock_modeset to 0 (“traditional”) or 1 (“consecutive”), the auto-increment values g... 阅读全文
posted @ 2015-08-21 10:25 一天不进步,就是退步 阅读(614) 评论(0) 推荐(0)
mysql 表设计时的update_time自动更新
摘要:11.3.5Automatic Initialization and Updating for TIMESTAMP and DATETIME原文地址:https://dev.mysql.com/doc/refman/5.6/en/timestamp-initialization.htmlAs of ... 阅读全文
posted @ 2015-08-21 10:19 一天不进步,就是退步 阅读(4275) 评论(0) 推荐(0)
Exchanging Partitions and Subpartitions with Tables--官方文档
摘要:原文地址:https://dev.mysql.com/doc/refman/5.6/en/partitioning-management-exchange.htmlIn MySQL 5.6, it is possible to exchange a table partition or subpar... 阅读全文
posted @ 2015-08-04 16:51 一天不进步,就是退步 阅读(386) 评论(0) 推荐(0)
关于mybatis里面的Executor--转载
摘要:原文地址:http://blog.csdn.net/w_intercool/article/details/7893344使用mybatis查寻数据,跟踪其执行流程最开始执行的语句[java]view plaincopyprint?this.getSqlSession().selectList("Q... 阅读全文
posted @ 2015-07-31 20:34 一天不进步,就是退步 阅读(3949) 评论(0) 推荐(0)
mysql 批量删除数据
摘要:批量删除2000w数据使用delete from table太慢//DELIMITERDROP PROCEDURE if EXISTS deleteManyTable;create PROCEDURE deleteManyTable()BEGINDECLARE i int;set i=1;while... 阅读全文
posted @ 2015-07-31 14:53 一天不进步,就是退步 阅读(4428) 评论(0) 推荐(0)
mysql 造1亿条记录的单表--大数据表
摘要:读写文件背景及木:现有数据1000w单表,为压力测试准备1亿条数据。步骤:1.将1000w条记录,除id外都导入到多个文件中://DELIMITERDROP PROCEDURE if EXISTS createManyTable;create PROCEDURE createManyTable()B... 阅读全文
posted @ 2015-07-31 10:49 一天不进步,就是退步 阅读(12916) 评论(0) 推荐(2)
Mysql数据库存储引擎--转
摘要:原文地址:http://pangge.blog.51cto.com/6013757/1303893简单介绍存储引擎就是指表的类型。数据库的存储引擎决定了表在计算机中的存储方式。存储引擎的概念是MySQl的特点,而且是一个插入式的存储引擎概念。这就决定了MySQl数据库中的表可以使用不同的存储方式存储... 阅读全文
posted @ 2015-07-29 17:39 一天不进步,就是退步 阅读(421) 评论(0) 推荐(0)
MYSQL存储过程中 使用变量 做表名--转
摘要:原文地址:http://blog.csdn.net/business122/article/details/7528859今天写一个对数据库做快照的存储过程,用到了动态表名,突然发现MYSQL不支持直接使用变量做表名,GOOGLE了下,采用以下方法:DECLARE dbName VARCHAR(30... 阅读全文
posted @ 2015-07-28 18:19 一天不进步,就是退步 阅读(1535) 评论(0) 推荐(0)
HASH Partitioning--转载
摘要:原文地址:https://dev.mysql.com/doc/refman/5.1/en/partitioning-hash.htmlHASH Partitioning[+/-]18.2.3.1 LINEAR HASH PartitioningPartitioning byHASHis used p... 阅读全文
posted @ 2015-07-22 19:04 一天不进步,就是退步 阅读(614) 评论(0) 推荐(0)

上一页 1 2 3 4 5 下一页