Not quite documentation, but it is a start

    It supports:
    * SELECT-PROJECT-JOIN views.  
      + This is especially well suited for star/snowflake schemas.
      + Also good for most ERP schemas.
      + Updating of any/all base tables is supported.
    * Multiple refresh methods.
      + INCREMENTAL
        * Equijoins ( FROM a JOIN b [ON|USING] ) 
	    * aggregates supported 
              + AVG
              + SUM
              + COUNT
	* asynchronous with table updates 
      + COMPLETE
         * Complex views 
         * Unions
         * Cross products/Cartesian joins
         * OUTER join

API Functions

    +------------------------+ +------------------------+
    |    User Functions      | |   Internal Functions   |
    +------------------------+ +------------------------+
    | add_expr               | | ensure_validity        |
    | add_table              | | execute_refresh        |
    | set_definition         | | execute_refresh_step   |
    | create                 | | get_delta_aliases      |
    | create_mvlog           | | get_delta_from         |
    | disable                | | get_delta_groupby      |
    | enable                 | | get_delta_least_uowid  |
    | remove_expr            | | get_delta_select       |
    | get_id                 | | get_delta_where        |
    | refresh                | | get_insert             |
    | remove_table           | | get_trigger_body       |
    | rename                 | | has_aggregates         |
    | set_definition         | | mview_get_from_clause  | 
    |                        | | mview_get_keys         | 
    |                        | | mview_get_select_list  |
    |                        | | mview_refresh_complete |
    |                        | | mview_signal           |
    |                        | | uow_end                |
    |                        | | uow_execute            |
    |                        | | uow_from_dtime         |
    |                        | | uow_start              |
    |                        | | uow_state_change       |
    |                        | | apply_delta            |
    +------------------------+ +------------------------+
      

	

Creating a materialized view log

CALL flexviews.CREATE_MVLOG(TABLE_SCHEMA, TABLE_NAME);

A materialized view log is a table which stores the changes to rows so that the refresh algorithm can calculate the delta changes for a materialized view. A materialized view log must be created for each base table that will be part of an incrementally refreshed materialized view.

This call will output a script for you to run which will create the table as well as the triggers for the base table. MySQL does not support CREATE TRIGGER as a prepared statement, so the script must be run manually by a user with CREATE TABLE and CREATE TRIGGER privleges in the schema with the base table.

Creating an incrementally refreshable materialized view definition

CALL flexviews.CREATE(MV_SCHEMA, MV_TABLE, REFRESH_MODE := INCREMENTAL|COMPLETE);

This creates a materialized view identifier (MVID) for your new materialized view. Each materialized view has a unique MVID which is most easily captured by SET @MVID=LAST_INSERT_ID() after calling flexviews.CREATE(). Later the MVID can be retrieved with flexviews.GET_ID().

The table representing the materialized view is not created at this point. flexviews.CREATE() creates a skeleton definition to begin constructing the materialized view query by adding tables and expressions. Later, flexviews.ENABLE() will actually create the materialized view on disk.

Adding a table to the materialized view definition

CALL flexviews.ADD_TABLE(MVID, SCHEMA_NAME, TABLE_NAME, TABLE_ALIAS, JOIN_CONDITION := NULL|expression);

This adds a table and the given alias to the FROM clause of the specified materialized view definition. The first table added to the materialized view should have a NULL JOIN_CONDITION. Subsequent calls should specify the condition as either "USING (COLUMN_NAME)" or "ON ALIAS1.COLUMN_NAME = ALIAS2.COLUMN_NAME". All column references in an ON clauseMUST be fully qualified with the table's alias.

Adding an expression to the materialized view definition

CALL flexviews.ADD_EXPR(MVID, EXPR_TYPE := GROUP|SUM|AVG|COUNT|WHERE|PRIMARY|KEY|COLUMN, EXPRESSION, EXPR_ALIAS);

This adds the specified expression to the materialized view. If using aggregate functions, non-aggregated columns in the SELECT clause are GROUP expressions, otherwise, SELECT expressions are COLUMN expressions. Column references within an expression (regardless of type) must be fully qualified with the TABLE_ALIAS specified in flexviews.ADD_TABLE(). WHERE expressions are added to the WHERE clause of the view. The PRIMARY and KEY expressions represent keys on the materialized view table. Note that PRIMARY and KEY expressions do not reference base table columns, but instead you must specify one or more EXPR_ALIAS(es) previously defined.

Building the physical materialized view

CALL flexviews.ENABLE(MVID);

Enable will attempt to build the SQL statement from the definition and build the new materialized view.

Refreshing a materialized view

CALL flexviews.REFRESH(MVID, STEP=BOTH|COMPLETE|COMPUTE|APPLY);

This will bring the specified materialized view up to date when STEP=BOTH.
When STEP=COMPUTE, the deltas will be calculated and inserted into the materialized view delta table, but not applied to the table itself
When STEP=APPLY, then any unapplied deltas will be applied. In the future there will be an 'APPLY TO TIMESTAMP' option.