当前位置:网站首页>数据库 SQL 优化大总结之:百万级数据库优化方案
数据库 SQL 优化大总结之:百万级数据库优化方案
2022-08-11 09:33:00 【InfoQ】
select id from t where num = 0
select id from t where num=10 or Name = 'admin'
select id from t where num = 10
union all
select id from t where Name = 'admin'
select id from t where num in(1,2,3)
select id from t where num between 1 and 3
select num from a where num in(select num from b)
select num from a where exists(select 1 from b where num=a.num)
select id from t where name like ‘%abc%’
select id from t where num = @num
select id from t with(index(索引名)) where num = @num
select id from t where num/2 = 100
select id from t where num = 100*2
select id from t where substring(name,1,3) = ’abc’ -–name以abc开头的id
select id from t where datediff(day,createdate,’2005-11-30′) = 0 -–‘2005-11-30’
select id from t where name like 'abc%'
select id from t where createdate >= '2005-11-30' and createdate < '2005-12-1'
select col1,col2 into #t from t where 1=0
create table
oracle(rownum),sqlserver(top)条件是一个好的方法。下面是一个mysql示例:
while(1){
mysql_query(“delete from logs where log_date <= ’2012-11-01’ limit 1000”);
if(mysql_affected_rows() == 0){
break;
}
usleep(50000)
}
边栏推荐
猜你喜欢

STM32之串口传输结构体

分割学习(loss and Evaluation)

基于 VIVADO 的 AM 调制解调(3)仿真验证

Primavera Unifier custom report creation and print sharing

Inventorying Four Entry-Level SSL Certificates

Network Models (DeepLab, DeepLabv3)

IPQ4019/IPQ4029 support WiFi6 MiniPCIe Module 2T2R 2×2.4GHz 2x5GHz MT7915 MT7975

神经网络参数如何确定的,神经网络参数个数计算

企业展厅制作要具备的六大功能

三次握手与四次挥手
随机推荐
基于 VIVADO 的 AM 调制解调(1)方案设计
四级独创的阅读词汇表
数据库事务
刷题错题录2-向上取整、三角形条件、字符串拼接匹配、三数排序思路
基于consul的注册发现的微服务架构迁移到servicemesh
Network Models (DeepLab, DeepLabv3)
Jupyter Notebook 插件 contrib nbextension 安装使用
神经网络需要的数学知识,神经网络的数学基础
pycharm cancel msyql expression highlighting
训练一个神经网络要多久,神经网络训练时间过长
【wxGlade学习】wxGlade环境配置
验证拦截器的执行流程
mindspore如何实现每50个epoch检测一次psnr
疫情当前,如何提高远程办公的效率,远程办公工具分享
Detailed Explanation of the Level 5 Test Center of the Chinese Institute of Electronics (1)-string type string
Inventorying Four Entry-Level SSL Certificates
qspi 接口与普通四线SPI 接口什么区别?
神经网络图怎么分析,画神经网络结构图
How to use QTableWidget
Primavera Unifier -AEM 表单设计器要点