Optimize slice and one element access to queries

For some queries it is needed to access just some elements, not all.
But all elements are retrieved from database and only then are accessed by index (or slice).

Please look at comments in attached modified files.