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

[BP to 7.2.0 MB-54952] - planner gives error and not considering other indexes

    XMLWordPrintable

Details

    • Untriaged
    • 0
    • Yes

    Description

      CREATE INDEX ix20 ON default (ALL `arr1`, `c1`, `c2`) WHERE `type` = 'doc';
      CREATE INDEX ix21 ON default(`c3`, DISTINCT ARRAY `v1`.`ac1` FOR `v1` IN `arr1` END) WHERE `type` = 'doc';
      SELECT RAW META().id
      FROM default
      WHERE type = 'doc'
      AND ANY v1 IN arr1 SATISFIES ((v1.ac1 IS NOT VALUED OR v1.ac1 in [1])) END
      AND c2 IS NOT VALUED
      AND c3 IN [2];
      

      "errors": [
              {
                  "code": 4000,
                  "msg": "Sargable index not sarged; pred=(((((`default`.`type`) = \"doc\") and any `v1` in (`default`.`arr1`) satisfies (((`v1`.`ac1`) is not valued) or ((`v1`.`ac1`) in [1])) end) and ((`default`.`c2`) is not valued)) and ((`default`.`c3`) in [2])), sarg_keys=[(all ((`default`.`arr1`)))], error=\u003cnil\u003e"
              }
          ],
          "status": "fatal",
      

      Attachments

        Issue Links

          Activity

            People

              pierre.regazzoni Pierre Regazzoni
              bingjie.miao Bingjie Miao
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty