metamx/druid — pull request #238 by himadrisingh001 (2013-09-13 10:12:18+00:00)
Title: Query Results Cache

Caching the query result sequence in form of byte[], improving the performance of repeated queries and reducing load on druid broker.

Cache will ignore the queries which intervals beyond current time, as they are bound to have different results later on.

Performance results for the three cases. The queries were generated randomly should be more than 1k queries (as per the stats)

1. No segment-level and query-results caching
2. No query-results caching but with segment-level results caching
3. Both caching turned on.

![screen shot 2013-09-13 at 3 08 42 pm](https://f.cloud.github.com/assets/4350464/1137233/5eeab69c-1c58-11e3-80cd-e97e14b140b8.png)

Case	Broker CPU	Compute CPU	Response Time
testCache	0.78	0.48	4.28 ms
testNoCache	0.53	65.30	2,296.28 ms
testNoQueryCache	19.10	0.79	100.99 ms