N1QL and Total Record Count for Paging


I am wondering if there is an update or any change to the count(*) for a query. I am in the middle of starting to implement
paging support for my grid’s. One of the requirement is to return the total record count so that my grid can calculate the nbr of pages etc. I read in some discussions that there might be a support for count without a separate query but i could not find anything.


we already have support for count(*). More efficient. https://blog.couchbase.com/understanding-index-grouping-aggregation-couchbase-n1ql-query/

without any predicate is very fast. It reads from bucket stats and returns.
If you have any predicate we need go through index or fetch document and count on the fly.
If query needs sort and not using index order sortCount in metrics of N1QL query gives total qualified rows.
You also have option of using views and SDK.



I know there is the select count(*) but it requires a separate query to be send which takes, time, resources as well need to maintain separate N1QL query staments