facebook/presto — pull request #1803 by martint (2014-10-12 01:25:25+00:00)
Title: Optimize aggregations over partition keys into simple metadata queries

Queries with the following shape are executed against partition metadata

```sql
SELECT min(key), max(key) FROM t
SELECT DISTINCT key FROM t
```