get all ids query
fetching measurements from database