惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
Spread Privacy
Spread Privacy
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
SecWiki News
SecWiki News
腾讯CDC
P
Privacy International News Feed
Webroot Blog
Webroot Blog
J
Java Code Geeks
爱范儿
爱范儿
A
About on SuperTechFans
S
Secure Thoughts
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
D
DataBreaches.Net
Cloudbric
Cloudbric
Security Archives - TechRepublic
Security Archives - TechRepublic
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Security Latest
Security Latest
Forbes - Security
Forbes - Security
小众软件
小众软件
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cybersecurity and Infrastructure Security Agency CISA
T
Threatpost
量子位
MongoDB | Blog
MongoDB | Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
W
WeLiveSecurity
P
Privacy & Cybersecurity Law Blog
Vercel News
Vercel News
Google Online Security Blog
Google Online Security Blog
云风的 BLOG
云风的 BLOG
GbyAI
GbyAI
S
Security @ Cisco Blogs
T
The Exploit Database - CXSecurity.com
Help Net Security
Help Net Security
V
Visual Studio Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - 聂微东
P
Proofpoint News Feed
C
CERT Recently Published Vulnerability Notes
Attack and Defense Labs
Attack and Defense Labs

裴先生笔记

[通胀十年]“消费驱动、自由化”转向“安全驱动、再工业化“ - 裴先生笔记 Jenkins + Docker 全流程实战(前后端构建 & 常见问题) 轻量级多节点系统监控方案实战:Node Exporter + Prometheus + Grafana & 替代方案 如何查询 Hive表 stored as 类型 [通胀十年]超级债务危机 - 裴先生笔记
查看 MYSQL 库大小、表大小、索引大小 - 裴先生笔记
2025-01-16 · via 裴先生笔记

共计 1050 个字符,预计需要花费 3 分钟才能阅读完成。

SELECT temp.`Table Name`                  AS tableName,
       CONCAT(temp.`Number of Rows`, 'M') AS NumberofRows,
       CONCAT(temp.`Data Size`, 'G')      AS DataSize,
       CONCAT(temp.`Index Size`, 'G')     AS IndexSize,
       CONCAT(temp.Total, 'G')            AS Total
FROM (SELECT CONCAT(table_schema, '.', table_name)                         AS 'Table Name',
             ROUND(table_rows / 1000000, 4)                                AS 'Number of Rows',
             ROUND(data_length / (1024 * 1024 * 1024), 4)                  AS 'Data Size',
             ROUND(index_length / (1024 * 1024 * 1024), 4)                 AS 'Index Size',
             ROUND((data_length + index_length) / (1024 * 1024 * 1024), 4) AS 'Total'
      FROM information_schema.TABLES
      WHERE table_schema LIKE 'YOUR_DATABASE_NAME') temp
ORDER BY temp.Total DESC

查询结果如下:

tableName NumberofRows DataSize IndexSize Total
umami_2.website_event 0.0406M 0.0142G 0.0662G 0.0805G
umami_2.session 0.0185M 0.0034G 0.0368G 0.0403G
umami_2.team_user 0.0000M 0.0000G 0.0000G 0.0001G
umami_2.team 0.0000M 0.0000G 0.0000G 0.0001G
umami_2.session_data 0.0000M 0.0000G 0.0000G 0.0001G
umami_2.report 0.0000M 0.0000G 0.0001G 0.0001G
umami_2.event_data 0.0000M 0.0000G 0.0001G 0.0001G
umami_2.website 0.0000M 0.0000G 0.0001G 0.0001G
umami_2._prisma_migrations 0.0000M 0.0000G 0.0000G 0.0000G
umami_2.user 0.0000M 0.0000G 0.0000G 0.0000G