准备工作 准备两张表,orders,users 准备数据 SELECT count(*) FROM users; # 1896 SELECT count(*) FROM orders; # 15245293 联表查询 先执行两个查询,大表驱动小表和小表驱动大表,检查一下两者的差异。
目录结构├── build.sh├── docker-compose.yml└── init├── master│ └── master.sh└── slave└── slave.shdocker-compose.ymlversion: '3'services: master:
周末突然接到公司线上有个小项目出了问题。查看日志是数据库上面的错误。ERROR 1129 (HY000): Host 'xx.xx.xx.xx' is blocked because of many connection errors; unblock with 'mysql