Because the static materialized views lack of better response performance for dynamic query, an optimized algorithm DCO (dynamic cache optimization) is proposed, which generates a dynamic materialized views set to cooperate with the existing static materialized view set by cache. With the assistance of the additional materialized views, the dynamic adaptability and response capability to query increase greatly. Meanwhile, a novel method of allocating the space is presented to provide the alternative for realizing the dynamic cache, and then the free space of system can be used efficiently to store more materialized views for improving the response capability. Experimental results indicate the efficiency and feasibility of DCO, and also show that DCO can overcome the SPSE (space-performance saturation effect) of materialized views in some degree.