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

Improve index selection on functional index for RBO

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • Major
    • Morpheus
    • 7.1.0
    • query
    • None
    • 1

    Description

      Repro from: Marco Greco , Bingjie Miao 

      CREATE INDEX `ix1` ON `default`(c1);
      CREATE INDEX `ix2` ON `default`(upper(c1)) ;
      EXPLAIN select raw count(1) as count from  default  as b  where upper(c1) like 'abc_xyz_%'
      EXPLAIN select b.* from  default  as b  where upper(c1) like 'abc%';

      We randomly pick the index because both has same sargable keys.

      If sargable keys same try to see if we can further explore (some of the options) before random selection.

      • If key pos depends on other give preference
      • If span is not full span (not superset) give preference.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            Sitaram.Vemulapalli Sitaram Vemulapalli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty