Implement a cache system.
Sigiloso
Create an intermediary object that fetches and returns the expensive data. It should implement the same interface as the actual data source so that it can be easily tested and used or not used as needed. Have that intermediary hold onto a private set of data consisting of all the unique values returned. Make the query implementation first check to see if it is already holding the desired result and if so, simply return it; otherwise query and store (cache) the new data. If memory is precious, you can maintain only the N most recently used values (MRU), or the N most expensive values, or some combination of those ideas.