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

Utilize secondary indexes with "arbitrary" expressions

    XMLWordPrintable

Details

    • 0

    Description

      Secondary indexes currently cannot be utilized beyond simple range and point lookups. There's a missed opportunity to exploit secondary indexes for arbitrary expressions. 

      Example:

       

      SELECT e.name, e.salary
      FROM Employee e
      WHERE lowercase(e.name) LIKE "%smith"

       If we have an index on Employee.name (call it name_idx), it won't be utilized.

      However, we can do a scan on the secondary index and apply the expression on secondary key(s):

      ... <The rest is similar to what's currently done for unnest-map> ...
      select like(lowercase($$name), "%smith")
        data-scan []<-[$$name, $$PK] <- Employee.name_idx

       

      Attachments

        Issue Links

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

          Activity

            People

              wail.alkowaileet Wail Alkowaileet
              wail.alkowaileet Wail Alkowaileet
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty