File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -481,6 +481,14 @@ MySQL 提供了两个方法来处理 ip 地址
481481
482482插入数据前,先用 ` INET_ATON()` 把 ip 地址转为整型,显示数据时,使用 ` INET_NTOA()` 把整型的 ip 地址转为地址显示即可。
483483
484+ # ## 有哪些常见的 SQL 优化手段?
485+
486+ [《Java 面试指北》](https://www.yuque.com/docs/share/f37fc804-bfe6-4b0d-b373-9c462188fec7) 的「技术面试题篇」有一篇文章详细介绍了常见的 SQL 优化手段,非常全面,清晰易懂!
487+
488+ ! [常见的 SQL 优化手段](https://guide-blog-images.oss-cn-shenzhen.aliyuncs.com/javamianshizhibei/javamianshizhibei-sql-optimization.png)
489+
490+
491+
484492# # 参考
485493
486494- 《高性能 MySQL》第 7 章 MySQL 高级特性
Original file line number Diff line number Diff line change @@ -157,4 +157,4 @@ MySQL 中时间到底怎么存储才好?Datetime?Timestamp? 数值保存的时
157157
158158每种方式都有各自的优势,根据实际场景才是王道。下面再对这三种方式做一个简单的对比,以供大家实际开发中选择正确的存放时间的数据类型:
159159
160- < img src = " https://my-blog-to-use.oss-cn-beijing.aliyuncs.com/2019-11/总结-常用日期存储方式.jpg " style = " zoom : 50 % ; " />
160+ ![ ] ( https://my-blog-to-use.oss-cn-beijing.aliyuncs.com/2019-11/总结-常用日期存储方式.jpg )
Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ addr3: 2433733894944
15915972340172838076673
160160```
161161
162- 分析一下运行结果,首先使用` allocateMemory ` 方法申请 4 字节长度的内存空间,在循环中调用 ` setMemory ` 方法向每个字节写入内容为` byte ` 类型的 1,当使用 Unsafe 调用` getInt ` 方法时,因为一个` int ` 型变量占 4 个字节,会一次性读取 4 个字节,组成一个` int ` 的值,对应的十进制结果为 16843009。
162+ 分析一下运行结果,首先使用` allocateMemory ` 方法申请 4 字节长度的内存空间,调用 ` setMemory ` 方法向每个字节写入内容为` byte ` 类型的 1,当使用 Unsafe 调用` getInt ` 方法时,因为一个` int ` 型变量占 4 个字节,会一次性读取 4 个字节,组成一个` int ` 的值,对应的十进制结果为 16843009。
163163
164164你可以通过下图理解这个过程:
165165
You can’t perform that action at this time.
0 commit comments