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

Index Advisor continues to advise new indexes even after the recommended index is created

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • Morpheus
    • Cheshire-Cat
    • query
    • None
    • Untriaged
    • 1
    • Unknown

    Description

      ADVISE will recommend a composite index with all the fields in the OR clause with a leading key. Then after you created the recommended index, and run ADVISE again, it will recommend another permutation of the same composite index.

      ADVISE SELECT * FROM crm a
      WHERE a.type='activity'
      AND ( a.dept = 'iA88'
        OR a.region > '59416'
        OR a.priority = 'High'
        OR ( a.act_date BETWEEN '2018-01-01' AND '2018-08-31')
        OR a.event.location = 'Moscone Center'
        OR a.account.id = 'acc100')

      {
      "adviseResult": {
      "current_indexes": [

      { "index_statement": "CREATE PRIMARY INDEX #primary ON `crm`", "keyspace_alias": "crm_a" }

      ],
      "recommended_indexes": {
      "indexes": [

      { "index_statement": "CREATE INDEX adv_type_event_location_dept_priority_account_id_act_date_region ON `crm`(`type`,`event`.`location`,`dept`,`priority`,`account`.`id`,`act_date`,`region`)", "index_statement_relative": "", "keyspace_alias": "crm_a", "query_context": "default:", "recommending_rule": "Index keys follow order of predicate types: 1. Common leading key for disjunction (2. equality/null/missing), 2. equality/null/missing, 4. not less than/between/not greater than, 5. less than/greater than." }

      ]
      }
      }
      }

       

      Attachments

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

        Activity

          People

            bingjie.miao Bingjie Miao
            binh.le Binh Le
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty