![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
MySQL
T暴风雪
这个作者很懒,什么都没留下…
展开
-
生成截断所有表的sql语句
可以生成指定数据库所有表的截断语句,通常用于测试服数据清空。如果需要保留某些表数据,只需删除对应表的截断语句。原创 2022-06-27 16:43:06 · 619 阅读 · 0 评论 -
mysql基础用法汇总
-- 新建表 create table member( id int(10) not null auto_increment primary key, uname varchar(10) not null default '', sex tinyint(1) not null default 1 comment '性别:1-男,2-女', score mediumint(5) not null ...原创 2020-04-23 15:16:02 · 193 阅读 · 0 评论 -
百万级数据库sql查询优化
最近接手一个老项目,DB中的文章表Lm_article数据量将近50W,之前用于查询列表分页的sql语句可以用‘龟速’形容,是时候优化一波了~。 ● 首先看下表结构,因字段太多,只截取了常用字段,InnoDB存储引擎,相关索引已建立 ● 现在列表中需要的字段为ID,title(标题),sx,brief(描述),where条件sx='游戏攻略'。吐槽下之前设计该表的大神,为啥不写个配置...原创 2019-08-21 15:29:54 · 879 阅读 · 0 评论