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

predicate is function on two keyspaces unnest not picking index

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 5.5.0
    • 5.5.0
    • query
    • None
    • Untriaged
    • Unknown

    Description

      CREATE INDEX ixd2 ON default (DISTINCT ARRAY [op.name, META().id] FOR op IN OBJECT_PAIRS(META().id) END);
      EXPLAIN SELECT META(d).id AS id FROM default AS d  UNNEST  OBJECT_PAIRS(META(d).id) AS op WHERE [op.name, META(d).id] > [1,10];
      

      Above one is not selecting index.
      Below query META(d).id replaced with op.id it works

      CREATE INDEX ixd1 ON default (DISTINCT ARRAY [op.name, op.id] FOR op IN OBJECT_PAIRS(META().id) END);
      EXPLAIN SELECT META(d).id AS id FROM default AS d  UNNEST  OBJECT_PAIRS(META(d).id) AS op WHERE [op.name, op.id] > [1,10];
      

      Attachments

        For Gerrit Dashboard: MB-28720
        # Subject Branch Project Status CR V

        Activity

          People

            bingjie.miao Bingjie Miao
            Sitaram.Vemulapalli Sitaram Vemulapalli
            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