WL#3340: add DataMemory and IndexMemory fixed/varsize usage to INFORMATION_SCHEMA.FILES

Status: Un-Assigned   —   Priority: Low

Add reporting of IndexMemory and DataMemory usage (per table) to

Varsized attributes are allocated in a separate set of pages in 5.1. so there
are two places to get usage from.

In NDB, IndexMemory and DataMemory usage can be different on each node. This is
less of a problem in 5.1 as we don't support initial NR as a form of repacking

See WL#1359 for details of columns.

I propose we have the following "files" with the following behaviour:

foreach node:
  FREE_EXTENTS= number of free IndexMemory pages for node X
  TOTAL_EXTENTS= total number of IndexMemory pages
  EXTENT_SIZE=size of IndexMemory page
  EXTRA= "NODE=X" (where X is node id) - format as for DATAFILES and UNDOFILES.
  - other columns are NULL

  same for DataMemory

these rows exist so that you can get reports when there are no tables in NDB

for each NDB table:
  a row for IndexMemory and DataMemory as above, but DataMemory is split into
two parts (i.e. THREE rows per table)
    - FILE_NAME="Fixed Sized Columns", TABLESPACE_NAME="DataMemory"
    - FILE_NAME="Variable Sized Columns", TABLESPACE_NAME="DataMemory"
  - ROW_FORMAT (fixed for fixed column part, variable for varsized part)
  - TABLE_ROWS is row count for the table
  - AVG_ROW_LENGTH (constant for fixed, possibly estimate for varsize)
  -  FREE_EXTENTS if we know we have free extents, number. else NULL
  -  TOTAL_EXTENTS= total number of pages allocated to this table
  -  EXTENT_SIZE=size of page
  - DATA_LENGTH actual space used, in bytes. NULL if we cannot easily find this out.
  - MAX_DATA_LENGTH size we can be if we use all pages allocated to us. 
  - INDEX_LENGTH, always NULL - even for indexmemory.
  - DATA_FREE (in bytes) the free space inside the pages allocated to us.
possibly an estimate.
  - EXTRA: node id as per DATAFILE. also OVERHEAD - the overhead per page.

In the case of BLOB tables and Index tables:
- another row for index/data memory but with FILE_NAME being the name of the
index/blob table