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

Infinite loop with FLATTEN_KEYS index and nested ANY/ANY AND EVERY predicate

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 7.1.0
    • 7.1.0
    • query
    • Untriaged
    • 1
    • Unknown

    Description

      Adapted from unit test case flattenkeys at test/gsi/test_cases/flattenkeys.

      CREATE INDEX `ixf10n` ON `orders`.`_default`.`flattenkeys`(`isbn`,`author` DESC,(distinct (array (distinct (array flatten_keys((`pg`.`num`) DESC, (`pg`.`name`) DESC, (`ch`.`description`)) for `pg` in (`ch`.`pages`) end)) for `ch` in `chapters` end)),`year`,`name`) WHERE (`type` = "book");
      

      insert the 3 documents with insert.json.

      Query:

      explain SELECT META(f).id, f.isbn, f.author, f.year FROM flattenkeys AS f WHERE f.type = 'book' AND ANY ch IN f.chapters SATISFIES (ANY AND EVERY pg IN ch.pages SATISFIES pg.num = 1 AND pg.name = 'page 1' AND ch.description LIKE 'chapter 1 %' END) END AND f.isbn >= 1 AND f. year >= 2020 ORDER BY f.isbn, f.author DESC, f.year LIMIT 5;
      

      Server enters an infinite loop and exit when run out of memory.

      Attachments

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

        Activity

          People

            ajay.bhullar Ajay Bhullar
            bingjie.miao Bingjie Miao
            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