This paper addresses the problem of query optimization for databases in which objects frequently change their values. A greedy, adaptive query optimization algorithm is proposed to evaluate relational queries and queries containing complex objects. Rather than contructing a full plan for an access path and executing it, the algorithm constructs a partial plan, executes it, updates the statistics, and constructs a new partial plan. Since a partial plan is constructed based on the latest statistics, the algorithm is adaptive to data modifications and errors from the statistics. It is proved that the algorithm can produce an optimal solution for a class of queries. Furthermore, experiments show that the overhead associated with the algorithm is negligible and the algorithm is efficient for other cases.