Performance concerns with USE KEYS?

Nope, just straight up fetching all the docs. It’s a near-textbook implementation of the call from the Bulk Operations page I linked above.

Now mind you, there are a large-ish number of them (~4k). The docs themselves are pretty small – under 512B, would be my guess. But during testing for a release that included a CB client upgrade, we encountered some broken automated tests due to timeouts getting hit. We traced this back to a series of these bulk fetches, which were getting called multiple times, and were now taking vastly longer than they had under the older CB client.

Where this whole thread came from was me taking this (partial) test dataset & dropping it into a local instance of couchbase, then running a series of tests against it. Bulk fetching 3700 documents locally consistently takes around 700ms. However, taking the same set of keys and building a giant N1QL string query with all the keys in it in a USE KEYS clause takes about 70ms. A 10x performance increase is not consistent with what I’m hearing from anybody who knows anything about Couchbase going from KV -> N1QL. So it seems like we’re doing something wrong somewhere, though it’s eluding me what it could be, or how to figure it out.