1. A method of optimizing execution of a query that accesses data stored in one or more base tables in a database of a computer system, comprising: using data in one or more materialized query tables (MQTs), wherein the data is generated from the base tables, as statistics for determining an optimal execution plan for the query.