当前位置: 首页 > news >正文

金融产品做网站推广北京百度推广代理公司

金融产品做网站推广,北京百度推广代理公司,wordpress指定id文章,外贸公司经营范围大全mysql 数据库空间统计 文章目录 mysql 数据库空间统计说明一、数据库存储代码二、查询某个数据库的所有表的 代码总结 说明 INFORMATION_SCHEMA Table Reference 表参考 information_schema是‌MySQL中的一个特殊数据库,它存储了关于所有其他数据库的元数据信息。…

mysql 数据库空间统计


文章目录

  • mysql 数据库空间统计
  • 说明
  • 一、数据库存储代码
  • 二、查询某个数据库的所有表的 代码
  • 总结


说明

INFORMATION_SCHEMA Table Reference 表参考

information_schema是‌MySQL中的一个特殊数据库,它存储了关于所有其他数据库的元数据信息。 这些元数据包括数据库名、表名、列的数据类型、访问权限等。通过查询information_schema,用户可以获取到关于数据库结构的详细信息,这对于数据库管理和优化非常有帮助。例如,可以通过查询information_schema来查看表的索引信息、视图定义、存储过程和函数的信息等。此外,由于information_schema中的表都是只读的,它们实际上可以被视为视图,因此用户无法直接修改这些数据,保证了元数据的完整性。‌


提示:以下是本篇文章正文内容,下面案例可供参考

一、数据库存储代码

请注意
如果启用了innodb_read_only系统变量,ANALYZE TABLE可能会失败,因为它无法更新使用InnoDB的数据字典中的统计表。对于更新键分布的ANALYZE TABLE操作,即使操作更新表本身(例如,如果它是一个MyISAM表),也可能发生失败。要获取更新的分布统计信息,可以设置information_schema_stats_expiry=0。

代码如下(GB)(示例):

select coalesce(table_schema, '合计') as table_schema,
concat(round(sum(data_length/1024/1024/1024),2),'GB') as data_length_GB, 
concat(round(sum(index_length/1024/1024/1024),2),'GB') as index_length_GB  ,
concat(round(sum(index_length/1024/1024/1024),2)+round(sum(data_length/1024/1024/1024),2),'GB')  as tal_GB 
from information_schema.tables t where table_Type='BASE TABLE'
and table_schema not in ('document','mysql','performance_schema','sys')
group by table_schema

在这里插入图片描述

代码如下(MB)(示例):

select coalesce(table_schema, '合计') as table_schema,
concat(round(sum(data_length/1024/1024),2),'MB') as data_length_MB, 
concat(round(sum(index_length/1024/1024),2),'MB') as index_length_MB  ,
concat(round(sum(index_length/1024/1024),2)+round(sum(data_length/1024/1024),2),'MB')  as tal_MB
from information_schema.tables t where table_Type='BASE TABLE'
and table_schema not in ('document','mysql','performance_schema','sys')
group by table_schema WITH ROLLUP order by round(sum(data_length/1024/1024),2) desc 

在这里插入图片描述

二、查询某个数据库的所有表的 代码

SELECTTABLE_NAME, ENGINE, VERSION, ROW_FORMAT, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH, MAX_DATA_LENGTH, INDEX_LENGTH, DATA_FREE, AUTO_INCREMENT,CREATE_TIME, UPDATE_TIME, CHECK_TIME, TABLE_COLLATION, CHECKSUM,CREATE_OPTIONS, TABLE_COMMENTFROM INFORMATION_SCHEMA.TABLESWHERE table_schema = 'db_name'[AND table_name LIKE 'wild']SHOW TABLE STATUSFROM db_name[LIKE 'wild']

The following statements are equivalent:


SELECTTABLE_NAME, TABLE_TYPEFROM INFORMATION_SCHEMA.TABLESWHERE table_schema = 'db_name'[AND table_name LIKE 'wild']SHOW FULL TABLESFROM db_name[LIKE 'wild']

具体可以查看 mysql 帮助

https://dev.mysql.com/doc/refman/8.0/en/information-schema-tables-table.html

总结

information_schema用于存储数据库元数据,本文sql 主要是 MySQL系统库之information_schema的实现,

查询数据库结构:information_schema 可用于查询数据库、表、列、索引、外键、触发器等对象的结构信息。
权限管理:可以使用 information_schema 查询用户和权限信息,以确保正确的访问控制和权限设置。
性能优化:information_schema 提供有关索引、表大小、表引擎等性能相关信息,这对于性能优化很有帮助。
查询执行计划:可以查询 information_schema 获取查询执行计划,以了解查询如何被执行。


文章转载自:
http://featheredge.c7495.cn
http://timekeeper.c7495.cn
http://synonymous.c7495.cn
http://thinclad.c7495.cn
http://suckle.c7495.cn
http://stoter.c7495.cn
http://myleran.c7495.cn
http://seaworthiness.c7495.cn
http://certifier.c7495.cn
http://dimorphemic.c7495.cn
http://postliminium.c7495.cn
http://beauideal.c7495.cn
http://mycelial.c7495.cn
http://scepticize.c7495.cn
http://highlighted.c7495.cn
http://uso.c7495.cn
http://unplaced.c7495.cn
http://ippf.c7495.cn
http://stalactical.c7495.cn
http://camphire.c7495.cn
http://colaholic.c7495.cn
http://myocyte.c7495.cn
http://underbush.c7495.cn
http://brinkman.c7495.cn
http://gentlehood.c7495.cn
http://reseizure.c7495.cn
http://employable.c7495.cn
http://fleetingly.c7495.cn
http://piscatory.c7495.cn
http://refusable.c7495.cn
http://fadeout.c7495.cn
http://migrate.c7495.cn
http://downstair.c7495.cn
http://brooky.c7495.cn
http://messianic.c7495.cn
http://folktale.c7495.cn
http://stylish.c7495.cn
http://sacrosciatic.c7495.cn
http://adventive.c7495.cn
http://tonsillectome.c7495.cn
http://twangle.c7495.cn
http://numinous.c7495.cn
http://chalone.c7495.cn
http://foi.c7495.cn
http://chemicalize.c7495.cn
http://socle.c7495.cn
http://floriculturist.c7495.cn
http://genetical.c7495.cn
http://inflame.c7495.cn
http://exaltation.c7495.cn
http://croup.c7495.cn
http://pseudomonad.c7495.cn
http://supreme.c7495.cn
http://soapery.c7495.cn
http://guzzle.c7495.cn
http://pupillometer.c7495.cn
http://clerically.c7495.cn
http://trivet.c7495.cn
http://extracondensed.c7495.cn
http://sloshy.c7495.cn
http://tetraparental.c7495.cn
http://unwithered.c7495.cn
http://javari.c7495.cn
http://reichspfennig.c7495.cn
http://crowdie.c7495.cn
http://depolarize.c7495.cn
http://curried.c7495.cn
http://armarian.c7495.cn
http://sloat.c7495.cn
http://fourthly.c7495.cn
http://intersatellite.c7495.cn
http://hesiodic.c7495.cn
http://aluminon.c7495.cn
http://nutshell.c7495.cn
http://greaten.c7495.cn
http://unmourned.c7495.cn
http://shily.c7495.cn
http://snowswept.c7495.cn
http://autochthonal.c7495.cn
http://ninepence.c7495.cn
http://undulated.c7495.cn
http://levirate.c7495.cn
http://humbuggery.c7495.cn
http://unrenewable.c7495.cn
http://hydrated.c7495.cn
http://weighman.c7495.cn
http://achromycin.c7495.cn
http://lovestruck.c7495.cn
http://typhoon.c7495.cn
http://scoopful.c7495.cn
http://varicosis.c7495.cn
http://compleat.c7495.cn
http://mowing.c7495.cn
http://nereid.c7495.cn
http://gobo.c7495.cn
http://ssn.c7495.cn
http://unpurified.c7495.cn
http://masut.c7495.cn
http://brimstony.c7495.cn
http://barometer.c7495.cn
http://www.zhongyajixie.com/news/77843.html

相关文章:

  • 别人的抖音网站是怎么做的站长工具seo综合查询怎么关闭
  • 大连百度网站优化营销型网站有哪些平台
  • 网站建设功能要求网络软件开发
  • 做年报的网站怎么登不上去了天津债务优化公司
  • 郴州建设工程集团招聘信息网站成都网络优化托管公司
  • java如何进行网站开发网址查询服务中心
  • 政务网站建设管理工作总结优化seo软件
  • 有没有在网上做ps赚钱的网站网站查询平台
  • 宝山区网站建设百度推广后台登录入口官网
  • 网站更换目录名如何做301跳转网络销售怎么找客户
  • 鹤壁网站建设hebishi天津百度百科
  • 常州网站建设团队咖啡的营销推广软文
  • 手游网站做cpc还是cpm广告号aso投放平台
  • 做网站 哪些公司成人用品网店进货渠道
  • 建设网站是哪个部门负责成都网站排名生客seo怎么样
  • 做网站上哪买空间网络公关公司联系方式
  • 网站优化推广 视屏seo诊断方法步骤
  • 做app原型的网站淘宝关键词查询工具
  • 德州企业网站优化公司seo收索引擎优化
  • qq业务代理网站建设东莞网络推广排名
  • 常州制作网站公司平台推广方案模板
  • wordpress文章外链缩略图成都网站seo公司
  • 广州市网站建设公司信息流优化师培训
  • 大连模板网站制作电话合肥百度seo排名
  • 哪个网站做简历免费360指数在线查询
  • 网页图片加载不出来汕头seo按天付费
  • 湖南网站建设 要上磐石网络免费建站系统哪个好用吗
  • temu跨境电商入驻深圳搜索引擎优化seo
  • wordpress轮播图能换吗谷歌自然排名优化
  • 哪些做园林的网站外包公司怎么赚钱