The complex system formalism is utilized for describing structural and behavioral properties of complexly structured systems. A complex system is a production system that models database with complex objects and explicitly supports time and nondeterminism. Consequently, complex systems can be used to predict the evolution of databases. To obtain predictions about future behavior, a futuristic query language is defined. A query optimization algorithm is provided for a subset of this language. In general, complex systems do not yield unique answers to futuristic queries because of the inherent nondetermination. Therefore, an optimal control problem is formulated that finds behavior satisfying user-defined goals. Subsequently, such goals can be converted into additional system constraints, thus reducing nondeterminism and providing for the optimal system's behavior.