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

Advise Stmt recommending an index for unnest query that is already present

    XMLWordPrintable

Details

    • Untriaged
    • 1
    • Unknown

    Description

      Pls see the scenario in MB-39296.

      advise select min(addr) from `beer-sample` unnest address as addr

      is recommending the following -

      [
        {
          "#operator": "Advise",
          "advice": {
            "#operator": "IndexAdvice",
            "adviseinfo": {
              "current_indexes": [
                {
                  "index_statement": "CREATE INDEX idx_pairs ON `beer-sample`((distinct (pairs(self))))",
                  "keyspace_alias": "beer-sample"
                }
              ],
              "recommended_indexes": {
                "indexes": [
                  {
                    "index_statement": "CREATE INDEX adv_ALL_address ON `beer-sample`(ALL `address`)",
                    "keyspace_alias": "beer-sample",
                    "recommending_rule": "Index keys follow order of predicate types: 1. leading array index for unnest."
                  }
                ]
              }
            }
          },
          "query": "select min(addr) from `beer-sample` unnest address as addr"
        }
      ]
      

      While the same index already exists -
      CREATE INDEX `idx_addresses` ON `beer-sample`((all (`address`)))

      – Recommended index to be compared with all the existing indexes for this keyspace to deduplicate.

      Attachments

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

        Activity

          People

            ajay.bhullar Ajay Bhullar
            mihir.kamdar Mihir Kamdar (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty