Optimize resource list query

Instead of 2 queries per resource
to fetch min and max sample timestamp
value, replaced with a single query of
similar cost. Another query of lesser
cost to retrieve the resource details.

Change-Id: I50d4a63a387e6a83c6090ebeafe7a330c5fda61c
Closes-Bug: #1404076