WL#3732: Information schema optimization

Affects: Server-5.5   —   Status: Complete

The current implementation of I_S retrieves the contents of several of
its tables directly from FRM, MYD, and MYI database files and the file
system itself. These tables are:
COLUMNS, KEY_COLUMN_USAGE, PARTITIONS, REFERENTIAL_CONSTRAINTS,
STATISTICS, TABLES, TABLE_CONSTRAINTS, TRIGGERS and VIEWS.

In order to retrieve the contents of any of the tables, the function
sql_show.cc:get_all_tables() needs to perform many my_dir() and
open_table() calls that require costly disc access. As a result the
current implementation results in orders of magnitude slower query
times over these I_S tables compared to accessing regular tables.

The goal of this task is to improve query times over the tables
above by reducing the accesses to FRM, MYD, and MYI files and the
file system to the possible minimum.

This is needed to help solve BUG#19588.