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

n1fty: flex index relax closed end range

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • feature-backlog
    • Cheshire-Cat
    • fts
    • None
    • 1

    Description

      At present N1QL predicates are open ended i.e comparisons are done across types and qualify documents vs FTS done specific type.

      INSERT INTO default VALUES("k01", {"a":10}), VALUES("k02", {"a":"abc"}), VALUES("k03", {"a":"xyz"});
      CREATE INDEX ix1 ON default(a);
      SELECT * FROM default WHER a < "xyz";   -- you get "k01", "k02"
      Direct FTS only gives "k02"
      

      Due to that FTS Flex Index consider some restrictions index is considered only predicate has closed range.

      https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/flex-indexes.html#ranges

      Is it worth consider open ended range if customers indicate through hint (same as FTS behavior)

      Example:
      FROM default USE INDEX (USING FTS ONLY)

      Only FTS indexes considered. None qualify error out
      Index sargable open end and FTS index only gives keys on the specific type of predicate, Will not give keys if type is changed.
      N1QL will follow its rules.

      This is gives Flex Index queries don't need to add additional predicates. The results similar to using FTS index directly i.e. relax validation little bit.

      Attachments

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

        Activity

          People

            abhinav Abhi Dangeti
            Sitaram.Vemulapalli Sitaram Vemulapalli
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty