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

[CX] Use secondary indexes with composite key for prefix search

    XMLWordPrintable

Details

    • CX Sprint 219, CX Sprint 220, CX Sprint 221, CX Sprint 222, CX Sprint 223, CX Sprint 248, CX Sprint 249, CX Sprint 250, CX Sprint 251, CX Sprint 252, CX Sprint 253, CX Sprint 254, CX Sprint 255, CX Sprint 256, CX Sprint 257, CX Sprint 258, CX Sprint 259

    Description

      Composite secondary index is currently not chosen by the query optimizer if the predicate does not include all indexed fields.
      E.g.

      CREATE DATASET breweries ON `beer-sample` WHERE `type` = "brewery";
      CREATE INDEX idx_country_state ON breweries(country:string, state:string);
      

      Query:

      SELECT * 
      FROM breweries
      WHERE country = 'United States';
      

      The above secondary index is currently not used because the WHERE clause does not include predicate on the 'state' field.

      Attachments

        Issue Links

          Activity

            People

              umang.agrawal Umang
              dmitry.lychagin Dmitry Lychagin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty