For MIN aggregate without group by, N1QL sends Limit 1 queries in API2 e.g. if the aggregate is on the first column or aggregate on second column but first column has equality.
With API3, this optimization is no longer available.
1. Indexer can have the extra logic to determine when such optimizations can be applied
2. N1QL can call API2 in such cases with LIMIT 1 or API3 without pushing down group aggr.
|For Gerrit Dashboard: MB-27861|
|93349,4||MB-27861: Optimize MIN, MAX aggregate without group by||unstable||indexing||Status: MERGED||+2||+1|
|113913,2||MB-29605: Optimize MIN aggregate without group by when KeyPos > 0||unstable||indexing||Status: MERGED||+2||+1|