In this paper we examine the problem of query optimization for extended data manipulation languages we propose a set of tactics that can be used in optimizing sequences of data base operations and describe the corresponding transformation procedures these transformations result in new equivalent sequences with better space and time performance the proposed techniques are especially useful in artificial intelligence and engineering applications where sequences of commands are executed over thing volume databases.