Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering MariaDB

You're reading from   Mastering MariaDB Debug, secure, and back up your data for optimum server performance with MariaDB

Arrow left icon
Product type Paperback
Published in Sep 2014
Publisher
ISBN-13 9781783981540
Length 384 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Federico Razzoli Federico Razzoli
Author Profile Icon Federico Razzoli
Federico Razzoli
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Understanding the Essentials of MariaDB FREE CHAPTER 2. Debugging 3. Optimizing Queries 4. Transactions and Locks 5. Users and Connections 6. Caches 7. InnoDB Compressed Tables 8. Backup and Disaster Recovery 9. Replication 10. Table Partitioning 11. Data Sharding 12. MariaDB Galera Cluster Index

The information_schema database

The information_schema database (often called I_S for brevity) is a virtual database that contains informative tables. These tables can be divided into several groups:

  • Metadata tables: Tables such as SCHEMATA, TABLES, and COLUMNS contain information about the structure of databases, tables, columns, and so on.
  • Status and variables tables: The GLOBAL_VARIABLES and SESSION_VARIABLES tables list the values of the server's system variables. The GLOBAL_STATUS and SESSION_STATUS tables provide information about the operations performed by the server.
  • Privilege tables: The tables whose names end with _PRIVILEGES indicate users that have various permissions on objects.
  • The PROFILING table: This table can be used to monitor the queries executed during the current session, and see which low-level operations are performed by the server.
  • The PROCESSLIST table: This table shows the active sessions and their status.

Several tables provide information about InnoDB. Some of them are XtraDB-specific. These table names begin with INNODB_ or XTRADB_ if they only exist for XtraDB, discussed as follows:

  • InnoDB locks tables: The INNODB_LOCKS, INNODB_LOCK_WAITS, and INNODB_TRX tables contain information about active locks, waits, and transactions that acquired a lock or are waiting for a lock, respectively.
  • InnoDB buffer pool tables: Tables whose names start with INNODB_BUFFER_ are the buffer pool contents and page usage.
  • The INNODB_METRICS table: This table provides information about some low-level operations performed by InnoDB.
  • InnoDB compression tables: Tables whose names start with INNODB_CMP provide information about the performance of compressed pages.
  • InnoDB full-text tables: Tables whose names start with INNODB_FT_ provide information about full-text indexes in InnoDB tables.
  • InnoDB data dictionary tables: Tables whose names start with INNODB_SYS_ provide metadata about InnoDB tables, columns, and foreign keys. They are similar to the more generic tables that contain metadata, but these tables are specific to InnoDB. They also contain statistics and information about files.

Generally, the information that can be read from information_schema can also be obtained with the SHOW statements and vice versa. Querying information_schema is a more flexible and standard way to retrieve such information, but is also more verbose.

Information on the InnoDB activities can also be obtained in a human-readable form via the SHOW ENGINE InnoDB STATUS and SHOW ENGINE InnoDB MUTEX statements.

To answer the queries of information_schema, the server opens and reads the database files, which can be a slow operation. For this reason, the queries that are often executed on a production server should be optimized to only read the necessary files. This can usually be done with a good WHERE clause.

You have been reading a chapter from
Mastering MariaDB
Published in: Sep 2014
Publisher:
ISBN-13: 9781783981540
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime