当前位置:网站首页>【MYSQL】所有查询表中有2千万数据--sql如何优化
【MYSQL】所有查询表中有2千万数据--sql如何优化
2022-06-28 05:31:00 【weixin_43224306】
这条sql如何优化
所有查询表中有2千万数据
SELECT
*
FROM
(
( SELECT * FROM q_user_01 WHERE id < 1162922 ORDER BY create_time DESC LIMIT 10 ) UNION ALL
( SELECT * FROM q_user_02 WHERE id < 1162922 ORDER BY create_time DESC LIMIT 10 ) UNION ALL
( SELECT * FROM q_user_03 WHERE id < 1162922 ORDER BY create_time DESC LIMIT 10 ) UNION ALL
( SELECT * FROM q_user_04 WHERE id < 1162922 ORDER BY create_time DESC LIMIT 10 ) UNION ALL
( SELECT * FROM q_user_05 WHERE id < 1162922 ORDER BY create_time DESC LIMIT 10 ) UNION ALL
( SELECT * FROM q_user_06 WHERE id < 1162922 ORDER BY create_time DESC LIMIT 10 ) UNION ALL
( SELECT * FROM q_user_07 WHERE id < 1162922 ORDER BY create_time DESC LIMIT 10 ) UNION ALL
( SELECT * FROM q_user_08 WHERE id < 1162922 ORDER BY create_time DESC LIMIT 10 ) UNION ALL
( SELECT * FROM q_user_09 WHERE id < 1162922 ORDER BY create_time DESC LIMIT 10 ) UNION ALL
( SELECT * FROM q_user_10 WHERE id < 1162922 ORDER BY create_time DESC LIMIT 10 )
) AS u
WHERE
u.id < 1162922
ORDER BY
u.create_time DESC
LIMIT 10
执行时间:2.913s
边栏推荐
- Study on chemical properties and technology of biovendor rage ELISA Kit
- sqlmap工具使用手册
- It is the latest weapon to cross the blockade. It is one of the fastest ladders.
- CSCI GA scheduling design
- 8VC Venture Cup 2017 - Elimination Round D. PolandBall and Polygon
- 独立站卖家都在用的五大电子邮件营销技巧,你知道吗?
- When excel copies the contents of a row, the columns are separated by the tab "\t"
- Quartus replication IP core
- How to design an awesome high concurrency architecture from scratch (recommended Collection)
- A guide to P2P network penetration (stun) for metartc5.0 programming
猜你喜欢

电商转化率这么抽象,到底是个啥?

gorm事务体验

线条动画

Have you finished the examination of level II cost engineer? There are also qualification regulations!

Oracle 条件、循环语句
![[JVM] - Division de la mémoire en JVM](/img/d8/29a5dc0ff61e35d73f48effb858770.png)
[JVM] - Division de la mémoire en JVM

Jdbc的使用

Docker安装Mysql5.7并开启binlog

Shutter nestedscrollview sliding folding head pull-down refresh effect

Interpretation of cloud native microservice technology trend
随机推荐
Lhasa accordion
8VC Venture Cup 2017 - Elimination Round D. PolandBall and Polygon
JS text box loses focus to modify width text and symbols
Enum
Zzuli:1071 decomposing prime factor
Application of Beidou No.3 short message terminal in dam safety monitoring scheme
CpG solid support research: lumiprobe general CpG type II
Office is being updated and the application cannot start normally
TypeScript基础类型
Latest Windows version 5.0.14 of redis
【JVM】——JVM中内存划分
When using the MessageBox of class toplevel, a problem pops up in the window.
Carboxylic acid study: lumiprobe sulfoacyanine 7 dicarboxylic acid
jq图片放大器
? How to write the position to output true
How to do a good job of dam safety monitoring
Quartus replication IP core
Realizing color detection with OpenCV
JSP
【Linux】——使用xshell在Linux上安装MySQL及实现Webapp的部署