Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-631

Add query service fast prepare support

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0-beta.2
    • None
    • None
    • 1
    • SDK34: Verify,Retry,DSv2, SDK38: Redaction,Releases,Test, SDK40: Verif2,Bugs,Docs,Retry, SDK42: Verif2,Retr,RTO,Circuit, SDK44: βref(1),CombT,Migration, SDK48: βref(2),CombT,Migr., SDK50: βref(2),CombT,Migr., SDK52: B/GA, Doc:Migr/Stngs/Co

    Description

      As an update to sdk-rfc #38, add the improvement relating to fast prepare.

      From the email sent out on this:

      Long promised, finally here – the (hopefully) final update to the enhanced prepared statements RFC.

      The RFC has been updated, please re-read this chapter: https://docs.google.com/document/d/1JhprmvL2HwHzkg7GxouGJc67eAvKFJekgyOG23T8mVU/edit#heading=h.jyt1um891uu

      It covers the new fast-prepare support, you can find more about it here too: https://docs.google.com/document/d/11w93jq_a6sAYqcJG5roIKAYm7WGTBD-obr9hqQTe9Ck/edit

      TL;DR:

      Prepare and execute are replaced with a single operation, which works as described in the document
      This helps us to cut down to a single operation even in the case where the cache is not primed with the given statement

      The java implementation for reference can be found in this gerrit change: http://review.couchbase.org/#/c/113494/

      Thanks,
      Michael

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          Ellis.Breen Ellis Breen added a comment - - edited

          As far as I can tell all the caching for this is performed automatically by LCB 3 alpha since this changeset:

          http://review.couchbase.org/c/111563/

          One simply needs to call prepare on the query once, and any subsequent calls to lcb_n1ql with the same query will use the cached query, at least until the cache is flushed or evicted. Is this correct, Sergey Avseyev? Have I missed any parameters?

          Ellis.Breen Ellis Breen added a comment - - edited As far as I can tell all the caching for this is performed automatically by LCB 3 alpha since this changeset: http://review.couchbase.org/c/111563/ One simply needs to call prepare on the query once, and any subsequent calls to lcb_n1ql with the same query will use the cached query, at least until the cache is flushed or evicted. Is this correct, Sergey Avseyev ? Have I missed any parameters?
          david.kelly David Kelly added a comment -

          Sergey Avseyev confirmed - this is done by lcb now, and so we don't have anything to do on our side. However, I'd like to test that it is working (meaning the ad_hoc parameter really was used). I'll hold this open for a bit till I can verify we can test for that. We could probably mock things and verify as well...

          david.kelly David Kelly added a comment - Sergey Avseyev confirmed - this is done by lcb now, and so we don't have anything to do on our side. However, I'd like to test that it is working (meaning the ad_hoc parameter really was used). I'll hold this open for a bit till I can verify we can test for that. We could probably mock things and verify as well...

          For manual verifying, just crank up the loglevel. For programmatic verification, perhaps if you turn on the profile option it'll be apparent in the profile results returned?

          ingenthr Matt Ingenthron added a comment - For manual verifying, just crank up the loglevel. For programmatic verification, perhaps if you turn on the profile option it'll be apparent in the profile results returned?
          david.kelly David Kelly added a comment -

          We will test option passing as a separate thing, so nothing to do here.

          david.kelly David Kelly added a comment - We will test option passing as a separate thing, so nothing to do here.
          david.kelly David Kelly added a comment -

          Matt Ingenthron I'll look at the profile option - maybe that is how we can do this in general...

          david.kelly David Kelly added a comment - Matt Ingenthron I'll look at the profile option - maybe that is how we can do this in general...

          People

            david.kelly David Kelly
            ingenthr Matt Ingenthron
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty