0307

mysql 创建 utf8md4 数据库

1
CREATE DATABASE `test`  DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ;

mysql utf8mb4 是 utf8的超集,兼容4字节的 unicode (Emoji)

https://www.jianshu.com/p/2b8629af8000

mysql 5.7.32-log 在 varchar(255) 创建索引失败,max key length is 767 bytes. 767字节/4字节每字符 = 191 字符。 须修改为 varchar(191) https://help.aliyun.com/document_detail/41707.html

查看已经合并的分支

1
2
3
4
git branch --merged

#删除
git branch --merged | egrep -v "(^\*|master|dev|stage)" | xargs git branch -d

vifm : za 显示隐藏文件

1
2
3
za: Toggle showing hidden files
zo: Show hidden files
zm: Hide hidden files

https://codeyarns.com/tech/2014-09-10-how-to-show-hidden-files-in-vifm.html#gsc.tab=0

Unicodde 是字符集 – 支持的所有字符的合集 Utf-8 是编码规则,代表 8 位一组表示 Unicode 字符的格式,使用 1 - 4 个字节来表示字符。

We should understand the distinction between a charset and an encoding:

  • A charset, as the name suggests, is a set of characters. For example, the Unicode charset contains 2^21 characters.
  • An encoding is the translation of a character’s list in binary. For example, UTF- 8 is an encoding standard capable of encoding all the Unicode characters in a variable number of bytes (from 1 to 4 bytes).

ChatGPT 是OpenAI 研发的一种生成式聊天机器人,可以理解人类的问题并提供答案, 对搜索引擎业务有着巨大的挑战 小Lin说 ChatGPT

感受太阳发热,其实是电磁波碰撞到物体产生的热量。 太阳如果是核聚变的化,太阳表面温度不好解释。 等离子体宇宙论,解释太阳拥有的日冕就是类似与闪电之类的东西,据说NASA太阳表面可能是27度。 老高说 太阳

0309

查看数据库表的大小

1
2
3
use information_schema;

select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='database_name' and table_name='table_name'; 

https://www.51cto.com/article/641931.html

varchar(50) 其中 50 在Mysql 5.1 版本之后代表的是字符长度, 以前代表的是字节长度

使用 varchat(50) 和直接使用 varchar(255) 存储的区别 空间占用基本一致

  1. 一般情况下255和50占用的空间大小是一致的。但如果是一utf8 可能会255超过255bytes 会需要2个bytes 标记变成 性能影响越小越优
  2. 255 会消耗更大的查询中间表的空间大小。
  3. 索引长度的大小的限制, InnoDB 限制为 3072bytes, 255长度无法建立索引
  4. 过大的字符长度可能会脱离数据页存储。 https://dba.stackexchange.com/a/76470

反思总结

逃避

当项目组的整个团队配合出问题的时候 – 工作开始不顺心, 没有想着怎么去解决, 团队的 矛盾, 而是在想着换工作

傲慢

喝酒敬酒的时候就很随意