A reverse routing system optimizes execution of a query that accesses data
stored in one or more materialized query tables in a database of a
computer system. The system receives a query directly referencing the
materialized query table. The system identifies the referenced
materialized query tables in a catalogue of materialized query tables and
a defining query associated with the referenced materialized query table.
The system substitutes the defining query for the referenced materialized
query table in the received query. The system adds the referenced
materialized query table to the set of eligible materialized query tables
that are selected using query matching algorithms so that they can be
considered for routing by the query optimizer.