1. In a database system, a method for optimizing a query requesting data from a database in an ordered form, the method comprising: generating a plurality of partial access plans for obtaining data requested by the query; constructing generalized orders representing requirements of the query for ordering of data, each generalized order representing a set of simple orders; creating generalized orders representing order properties of said partial access plans; intersecting the generalized orders representing requirements of the query for ordering of data with the generalized orders representing order properties of said partial access plans to determine partial access plans having favorable orderings; and building a query execution plan for obtaining and ordering the data requested by the query based, at least in part, on selecting partial access plans having favorable orderings.