Hi All,
Is there any most efficient way to get a total count of a large data set of an Entity without pulling all the data itself from the data set . Use case is to retrieve only total no records in an enitity.Thanks in advance.
Discussion posts and replies are publicly visible
Using a!queryEntity(fetchTotalCount: true) will get the total count of a large set. You should then set your pagingInfo to a!pagingInfo(1,1) which will only return one entry from the entity
I'd think it more efficient to use a!pagingInfo(1, 0) which will return only the metadata including totalCount, but no DB rows. Should be at least a bit more slender than returning 1 row. This should also negate the need to request a specially trim set of columns to return, since this returns no columns.