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

Add SUFFIXES() function to enhance pattern matching

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 4.5.1, 5.0.0
    • 4.5.0
    • query
    • None

    Description

      We see customer queries of the form

      WHERE x LIKE '%abc%'

      Currently. such a query cannot effectively use an index on x. With a SUFFIXES() function that generates an array of all the suffixes of a string, the following index and query can be used.

      CREATE INDEX idx ON b( DISTINCT ARRAY s FOR s IN SUFFIXES END );

      WHERE ANY s IN SUFFIXES SATISFIES s LIKE 'abc%' END;

      Attachments

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

        Activity

          People

            gerald Gerald Sangudi (Inactive)
            gerald Gerald Sangudi (Inactive)
            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