18. The method of claim 15 , wherein generating the intermediate representation of the physical query, comprises: resolving any indirect references to the physical database included in the physical query; dividing the physical query into a set of regions; and for each region, creating an abstract query plan fragment corresponding to the region, wherein each abstract query plan fragment includes a set of one or more table instances, wherein each table instance includes: (i) a table from the physical database, wherein the table is referenced by the corresponding region of the physical query; (ii) an indication of the columns, in the table, that are referenced by the corresponding region of the physical query; and (iii) any conditions specified by the physical query that are applied against the tables and columns for the corresponding region; and joining the created abstract query plan fragments together to form an abstract query plan, wherein the fragments are joined according to relationships between tables in the physical database.
18. The method of claim 15 , wherein generating the intermediate representation of the physical query, comprises: resolving any indirect references to the physical database included in the physical query; dividing the physical query into a set of regions; and for each region, creating an abstract query plan fragment corresponding to the region, wherein each abstract query plan fragment includes a set of one or more table instances, wherein each table instance includes: (i) a table from the physical database, wherein the table is referenced by the corresponding region of the physical query; (ii) an indication of the columns, in the table, that are referenced by the corresponding region of the physical query; and (iii) any conditions specified by the physical query that are applied against the tables and columns for the corresponding region; and joining the created abstract query plan fragments together to form an abstract query plan, wherein the fragments are joined according to relationships between tables in the physical database. 19. The method of claim 18 , wherein an indirect reference comprises one of a view, common table expression, or temporary relational table.