1. A method for optimizing query processing, the method comprising: receiving, at a database system, a query that requires foreign data from an external data source; in response to receiving the query, determining whether the foreign data currently resides in a cache of the database system; in response to determining that the foreign data does not currently reside in the cache: retrieving the foreign data from the external data source; mapping the foreign data to a column granule of a table; and storing the column granule in the cache; wherein the method is performed by one or more computing devices.