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

Improve Index selection based on pushdowns

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 6.5.0
    • 6.5.0
    • query
    • None

    Description

      create index ix1 ON default (x DESC , y, z);
      create index ix2 ON default (z,y,x);
       
      SELECT * 
      FROM default 
      WHERE x IS NOT NULL AND y = 5 AND z = 10 
      ORDER BY x DESC
      OFFSET 0 LIMIT 10;
      

      ix1 is better index because it can use index order and do pagination.

      Both indexes as same index keys only difference order and collation.
      For given query the number index keys can pushdown (longest sargable keys) on each index is same, one of them is eliminated randomly.

      Can we keep both indexes and see if any further index pushdown is possible? Yes.

      Attachments

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

        Activity

          People

            mihir.kamdar Mihir Kamdar (Inactive)
            Sitaram.Vemulapalli Sitaram Vemulapalli
            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