Databases Reference
In-Depth Information
Information Schema Plugins
The Information Schema was introduced in MySQL 5.0 as a standard way of
providing database metadata accessible using normal SELECT queries. To make
this work the metadata is made available via read-only tables in a database called
INFORMATION_SCHEMA . In the MySQL mailing lists these tables are often informally
referred to as I_S tables . The name of the schema, names of tables, and their structure
is defined in the SQL standard (ISO/IEC 9075-11:2003 part 11). However, MySQL
extends the standard by providing more tables than the standard dictates. This is
where plugins come into the game. There is an Information Schema plugin type in
MySQL 5.1. Plugins of this type can add new tables to the INFORMATION_SCHEMA
database. These plugins are great for exposing information (possibly a lot of it) to
the user in tabular form. Often these plugins are not distributed as standalone, but
accompany other plugins, for example, complex storage engines, and expose their
statistics or other internal information to the user.
In this first chapter on Information Schema plugins we will go over the basics of this
plugin type and illustrate them with two simple example plugins.
Why write Information Schema plugins
The MySQL plugin API provides plugin developers with two ways of reporting
status or statistical information to the user. Status variables were discussed in the
previous chapter. They are best suited for reporting a small number of values that
can be sorted into a fixed number of categories.
Search WWH ::




Custom Search