当前位置:网站首页>[MySQL] all query tables contain 20million data -- how to optimize SQL
[MySQL] all query tables contain 20million data -- how to optimize SQL
2022-06-28 05:46:00 【weixin_ forty-three million two hundred and twenty-four thousan】
This article sql How to optimize
All query tables have 2 Millions of data
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
execution time :2.913s
边栏推荐
- qtcanpool 知 05:无边框
- 双向电平转换电路
- FB、WhatsApp群发消息在2022年到底有多热门?
- Mysql-17- create and manage tables
- Relevant implementation records of CSI and local disk
- Data warehouse: detailed explanation of hierarchical design
- codeforces每日5题(均1700)
- Rxswift -- (1) create a project
- Windows环境Redis使用AOF持久化,无法生成AOF文件,生成后无法加载AOF文件内容
- Question bank and answers of 2022 materialman general basic (materialman) operation certificate examination
猜你喜欢
随机推荐
Install kubebuilder
Concurrent wait/notify description
bash install.sh ********错误
安装 Ffmpefg
数据中台:一篇带你深入浅出了解数据中台
2022 new version NFT source code source code of China meta universe digital collection art trading platform
線條動畫
[untitled] drv8825 stepping motor drive board schematic diagram
[JVM] - Division de la mémoire en JVM
电商转化率这么抽象,到底是个啥?
Informatics Orsay all in one 1360: strange lift
numpy.reshape, numpy.transpose的理解
V4L2 驱动层分析
MR-WordCount
Solution of dam safety automatic monitoring system for medium and small reservoirs
TypeScript基础类型
How to develop the language pack in the one-to-one video chat source code
Qtcanpool knowledge 07:ribbon
A full set of excellent SEO tutorials worth 300 yuan [159 lessons]
容量调度绝对值配置队列使用与避坑









