Mihir Kamdar - Yes. Although this is just an optimization task, it would be good to add additional tests for this scenario.
Details about change: If there is scan with MIN aggregate (with no group by) and if keyPos of aggregate can be anything (first or otherwise), we have optimized the scanning to pick first result that is returned instead of scanning all rows and pick minimum (since minimum value will always be the first). The same optimization is applicable to MAX where desc is true for MAX position.
For verification purposes, please test out scenarios involving MIN aggregates on various key positions without any group by.
Build couchbase-server-6.5.0-4156 contains indexing commit 732b0f2 with commit message:
MB-29605: Optimize MIN aggregate without group by when KeyPos > 0