USE Keys vs Py SDK get_multi

Hello,

I am trying to evaluate the performance of 2 similar operations.

Let’s say I want to get a few documents and I have a list of document ids. I have 2 different ways to fetch the documents.

  1. Create a n1ql query utilizing use keys - “USE KEYS [doc_id_1, doc_id_2, doc_id_3]”
  2. Use PyDK’s get_multi - “get_multi([doc_id_1, doc_id_2, doc_id_3])”
    Is there any recommendation to use one over another?

Thanks!

The kv api (get, get_multi) will be quicker because the client will send the request to the node that holds the document. Query requests are sent to any query node, and the documents are pulled from their nodes and sent back to the client.
Mike

1 Like

Sounds good, thank you!