If you have equality predicates it doesn’t matter which order you defined. You can try increase index memory and even indexer timeout. cc @deepkaran.salooja
Check query plan it should be using the IndexCountScan. Count might be large. 5.5.0 EE has Index aggregation feature SQL Group by Index | Aggregate Index SQL | Couchbase