n
n
notebook
Search
⌃K
n
n
notebook
Search
⌃K
coding
2016/11/03_sql optimization principle
2017/06/03_shadowsocks
2017/08/19_docker for gitlab install
2018/02/15_dotnet core
2018/06/16_vs key
2018/09/12_network protocol
2018/10/23_Distributed service framework
2018/10/24_knowledge
2018/11/03_environment deployment
2018/11/23_release nuget package
2018/12/04_free https
2020/04/29_EFmigrationCmdLine
2020/12/18_push docker image to aws
2022/12/16_HttpClient-multipart
2023/02/17_postgresSql-function
living
playing
Powered By
GitBook
2016/11/03_sql optimization principle
表设计时 的优化
字段设计时使用not null
大表按业务需求拆分成小表 比如说时间
字段尽量设计为定长
索引优化
经常在where子句使用的列,设置索引
多个列where或者order by子句的,建立复合索引
语句优化(慢查询优化)
使用explain和profile分析查询语句
查看慢查询日志
千万级分页时使用limit
不要select *
多表连接时 小表join大表
经常使用的查询,可以开启缓存
不要使用not in和<>操作
Previous
coding
Next
2017/06/03_shadowsocks
Last modified
3yr ago