1. A method in a distributed database system comprising: receiving a query in a query language from a client with a distributed database system; locating an index that matches the query, wherein the index is pre-generated from a database table in the distributed database system; implementing a map function of a MapReduce programming model using the index; and implementing a reduce function of the MapReduce programming model using the output of the map function.