Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-34662

Unknown response / unknown advise for query advisor

    XMLWordPrintable

Details

    • Untriaged
    • Unknown

    Description

      Summary: Certain query when fed into query advisor returns "Unknown response from server"

      Repro:

      1. Install Couchbase Server enterprise
      2. Create bucket with primary key (I named mine survey_results_public)
      3. Enable developer preview mode (so that index advisor is enabled)
      4. Run the query (see attached)

      Actual:

      Message "Unknown response from server" appears in the UI. See screenshot and see JavaScript response.

      Expected:

      This depends on what's happening behind the scenes.

      Is the advisor unable to make a recommendation? There isn't any "reason" or additional information in the response from the server. It would be nice if there was at least a short reason given why no indexes could be recommended.

      Another possibility is that this is a bug in the advisor.

      and/or

      This might be mitigated in the UI with a more descriptive error message. But it seems like the UI is really at the mercy of the backend here, so I'm not sure what that message could be. At the least, something like "Unable to recommend an index" is slightly better than "Unknown response from server".

      Attachments

        1. reproquery.n1ql
          0.6 kB
        2. reproresponse.json
          2 kB
        3. unknown_response.png
          unknown_response.png
          13 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          Build couchbase-server-6.5.0-3628 contains query-ee commit 6a39152 with commit message:
          MB-34662 Follow the valid index name pattern defined in indexing

          build-team Couchbase Build Team added a comment - Build couchbase-server-6.5.0-3628 contains query-ee commit 6a39152 with commit message: MB-34662 Follow the valid index name pattern defined in indexing

          Build couchbase-server-6.5.0-3764 contains query commit 241b308 with commit message:
          MB-34662 add test cases(part 2)

          build-team Couchbase Build Team added a comment - Build couchbase-server-6.5.0-3764 contains query commit 241b308 with commit message: MB-34662 add test cases(part 2)

          Build couchbase-server-6.5.0-3764 contains query-ee commit 8e0c3b4 with commit message:
          MB-34662 fix bug in unnest array index(part 1)

          build-team Couchbase Build Team added a comment - Build couchbase-server-6.5.0-3764 contains query-ee commit 8e0c3b4 with commit message: MB-34662 fix bug in unnest array index(part 1)
          ajay.bhullar Ajay Bhullar added a comment -

          verified in 6.5.0-3905

          SELECT lang, SUM(purchaseLittle) as totalLittle, SUM(purchaseGreat) AS totalGreat, SUM(purchaseSome) AS totalSome,
          SUM(purchaseGreat) / SUM(purchaseLittle) AS difference
          FROM default s
          UNNEST SPLIT(s.LanguageWorkedWith, ';') lang
          LET
          purchaseLittle = CASE WHEN s.PurchaseWhat LIKE 'I have little%' THEN 1 ELSE 0 END,
          purchaseGreat = CASE WHEN s.PurchaseWhat LIKE 'I have a great%' THEN 1 ELSE 0 END,
          purchaseSome = CASE WHEN s.PurchaseWhat LIKE 'I have some%' THEN 1 ELSE 0 END
          WHERE s.PurchaseWhat != 'NA'
          AND lang != 'NA'
          group by lang
          order by SUM(purchaseGreat) / SUM(purchaseLittle) desc

          now this query returns this advise:

          Index Currently Used
          CREATE PRIMARY INDEX #primary ON `default`
          Covered Index Recommendations
          CREATE INDEX adv_ALL_split_s_LanguageWorkedWith_PurchaseWhat ON `default`(ALL split((`LanguageWorkedWith`), ';'),`PurchaseWhat`)

          ajay.bhullar Ajay Bhullar added a comment - verified in 6.5.0-3905 SELECT lang, SUM(purchaseLittle) as totalLittle, SUM(purchaseGreat) AS totalGreat, SUM(purchaseSome) AS totalSome, SUM(purchaseGreat) / SUM(purchaseLittle) AS difference FROM default s UNNEST SPLIT(s.LanguageWorkedWith, ';') lang LET purchaseLittle = CASE WHEN s.PurchaseWhat LIKE 'I have little%' THEN 1 ELSE 0 END, purchaseGreat = CASE WHEN s.PurchaseWhat LIKE 'I have a great%' THEN 1 ELSE 0 END, purchaseSome = CASE WHEN s.PurchaseWhat LIKE 'I have some%' THEN 1 ELSE 0 END WHERE s.PurchaseWhat != 'NA' AND lang != 'NA' group by lang order by SUM(purchaseGreat) / SUM(purchaseLittle) desc now this query returns this advise: Index Currently Used CREATE PRIMARY INDEX #primary ON `default` Covered Index Recommendations CREATE INDEX adv_ALL_split_s_LanguageWorkedWith_PurchaseWhat ON `default`(ALL split((`LanguageWorkedWith`), ';'),`PurchaseWhat`)

          People

            ajay.bhullar Ajay Bhullar
            matthew.groves Matthew Groves
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty