Kubernetes 入门到进阶实战

122 阅读1分钟

download:Kubernetes 入门到进阶实战

K8s,容器编排的事实标准,云原生时代的企业技术战略重点,也是未来后端开发、运维必备技能。但 K8s 包含技术点繁多复杂,学起来并不容易。本课程将提供一条更容易系统掌握 K8s 的学习路线,让大家学得轻松,学得透彻

技术要求

具备一定服务端基础知识及基本 linux 命令

对容器领域感兴趣的开发者和运维工程师

环境参数

Virtualbox 6

Centos 7

Docker 1.19

Kubernetes 1.19.3

函數操作對條件字段做函數操作走不了索引。select * from t1 where date(c) ='2019-05-21';
優化:改成範圍查询select * from t1 where c>='2019-05-21 00:00:00' and c<='2019-05-21 23:59:59';
隱式轉換操作符與不同類型的操作對象一同運用時,就會發作類型轉換以使操作兼容。select user_name,tele_phone from user_info where tele_phone =11111111111; /* tele_phone varchar */
實践會做函數操作:select user_name,tele_phone from user_info where cast(tele_phone as singed int) =11111111111; 
優化:類型統一select user_name,tele_phone from user_info where tele_phone ='11111111111';
含糊查询通配符在前面select * from t1 where a like '%1111%';
優化:含糊查询必需包含條件字段前面的值select * from t1 where a like '1111%';
範圍查询範圍查询數據量太多,需求回表,因而不走索引。select * from t1 where b>=1 and b <=2000;
優化:降低單次查询範圍,分屢次查询。(實践可能速度沒得快太多,倡議走索引)select * from t1 where b>=1 and b <=1000;
 show profiles;
+----------+------------+------------------------------------------+
| Query_ID | Duration   | Query                                    |
+----------+------------+------------------------------------------+
|        1 | 0.00534775 | select * from t1 where b>=1 and b <=1000 |
|        2 | 0.00605625 | select * from t1 where b>=1 and b <=2000 |
+----------+------------+------------------------------------------+
2 rows in set, 1 warning (0.00 sec)
計算操作即便是简單的計算explain select * from t1 where b-1 =1000;
優化:將計算操作放在等號後面explain select * from t1 where b =1000 + 1;