DeveloperBreeze

Information_Schema Development Tutorials, Guides & Insights

Unlock 1+ expert-curated information_schema tutorials, real-world code snippets, and modern dev strategies. From fundamentals to advanced topics, boost your information_schema skills on DeveloperBreeze.

Viewing the Database Size and Identifying the Largest Table in MySQL

Tutorial August 12, 2024
mysql

  • information_schema.tables: This system table stores metadata about tables in all databases.
  • table_schema: Represents the database name.
  • data_length and index_length: Represent the size of the table data and indexes, respectively.
  • ROUND(..., 2): Rounds the result to two decimal places for readability.
  • GROUP BY table_schema: Groups results by database name to aggregate sizes.

This query will output the size of the specified database in megabytes (MB).