1. A method comprising: receiving a logical description that references an abstract datatype in a database system, wherein the database system supports multiple database representations for the abstract datatype; receiving one or more sample queries that reference the abstract datatype; evaluating the one or more sample queries, wherein evaluating one or more sample queries comprises: determining a plurality of database representations that the database system supports for the abstract datatype; re-writing the one or more sample queries based on the plurality of database representations; performing a cost analysis of the re-written sample queries; based on the logical description and said evaluating said one or more sample queries, determining a database representation for the abstract datatype; wherein said database representation includes one or more base structures that are used to store data for the abstract datatype; wherein the method is performed by one or more computing devices.