Details

    • Type: Task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.2
    • Fix Version/s: 1.2.0
    • Component/s: library
    • Security Level: Public
    • Labels:
      None
    • Environment:
      Mac OS X, CentOS

      Description

      I'm querying a view using the PHP SDK using the view method, $object->view($ddocname [, $viewname ] [, $viewoptions ]), and finding that when I pass in a certain number of keys in the viewoptions param, the method silently fails and just returns null. It appears that 164 keys is OK, but 179 is not. I didn't see documentation indicating a key limit and would expect an error if there were.
      Here's the call:
      // 179 keys breaks, 164 OK
      $result = $this->cb->view(self::VIEW_DAP,'modelcount',array('keys' => $keys,
      'group_level' => 2,
      'group' => true,
      'skip' => 0)

      Here's a link to the forum thread I created:
      http://www.couchbase.com/forums/thread/key-limit-view-queries

      As you'll see in the responses, this is probably a much more general issue that the PHP SDK uses GET calls that have a string length limit. It seems that the SDK should either use POSTs to avoid the limit or document the size limits in the documentation.

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

        Activity

        Hide
        ingenthr Matt Ingenthron added a comment -

        Thanks for the report. That's definitely an issue and we'll need to get it addressed.

        Having said that, what's the reason for doing a view query with a large number of keys? Usually you'll get much better performance from getMulti():
        https://github.com/couchbase/php-ext-couchbase/blob/1.1.5/example/couchbase-api.php#L337

        Generally, there's not a case I can think of where I'd do this through a view, but maybe you have something in mind that I can't think of.

        Show
        ingenthr Matt Ingenthron added a comment - Thanks for the report. That's definitely an issue and we'll need to get it addressed. Having said that, what's the reason for doing a view query with a large number of keys? Usually you'll get much better performance from getMulti(): https://github.com/couchbase/php-ext-couchbase/blob/1.1.5/example/couchbase-api.php#L337 Generally, there's not a case I can think of where I'd do this through a view, but maybe you have something in mind that I can't think of.
        Hide
        trond Trond Norbye added a comment -

        Lets just use POST all the time to have a single code path to test..

        Show
        trond Trond Norbye added a comment - Lets just use POST all the time to have a single code path to test..
        Show
        trond Trond Norbye added a comment - http://review.couchbase.org/#/c/28721/

          People

          • Assignee:
            trond Trond Norbye
            Reporter:
            rdominy Robert Dominy
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes