# MySQL

MySQL分库分表

# 动机 表即将到达千万,各种排序、join后查询速度逐渐到达秒级甚至十几秒。 #

MySQL

InnoDB和ACID特性

https://dev.mysql.com/doc/refman/8.0/en/mysql-acid.html The ACID model is a set of database design principles that emphasize aspects of reliability that are important for business data and mission-critical applications. A: atomicity.原子性 Transactions are atomic units of work that

MySQL

InnoDB存储结构2之--硬盘中的数据结构

一、InnoDB On-Disk Structures https://dev.mysql.com/doc/refman/8.0/en/innodb-on-disk-structures.html 二、 表 Tables 三、 Indexes 索引 四、 Doublewrite Buffer 五、 Redo log 六、 Undo log

MySQL

InnoDB存储结构1之--内存中的数据结构

MySQL8 零、 MySQL数据文件 1. InnoDB 的存储文件有两个,一个 `.frm`表定义文件 和 一个 `.idb`数据文件。 2. 数据库采用数据页的形式组织数据。MySQL默认的非压缩数据页为16KB。 在.idb文件中,0-16KB偏移量即为0号数据页,16-23KB为1号数据页,依次类推。 一、 InnoDB Architecture https://dev.mysql.com/doc/refman/8.0/en/innodb-architecture.html in-memory and on-disk structures t

MySQL

InnoDB锁机制

看文档

学习MySQL

时间范围查询怎么优化?

... a

MySQL

数据库对数据的统计|看有人提问某需求有感

怎么1s内从数十亿中找出top10? 入库时统计 数据不太变更或者变更不影响统计量,数据量特别大时尽量用这个---- 实时统计 数据变更比较频繁,数据量特别大时尽量加上缓存以降低数据库负荷 定时统计 //暂时还没有遇到适用的场景。。

MySQL

mysql性能分析入门

插入查找等方面的性能如何分析 explain如何用 还有Query Profiler 执行时间分析,执行情况分析 1.profiling 是否开启:select @@profiling; show variables like '%profiling$';//是否支持及是否开启 开启:set profiling=1 查看开启后的sql执行时间:show profiles; 查看某个执行id的详细:show profile for query {queryId}; //这个show展示的所有信息都是从表INFORMATION_SCHEMA.PROFILIN

MySQL

mysql常用函数

--数字相关 floor(123.12) //返回一个小于这个数的最大 整数 rand() //产生一个【0,1)之间的小数 date_format(date,"%Y-%m-%d") --字符串相关 concat(s1,s2,s3,s4.....)//任意一个为null则整个为null charlength(str)//返回字符串str的长度 left(str,n); right(str,n);//截取字符串str的n个字符 substring(str,起始位置1开始,截取长度可选); lower(str)和lcase(str)//将所有字母转换为小写

MySQL

MySQL子查询

一个select语句中 嵌入了另一个select

MySQL