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

[CX] Delivered properties of secondary index search operator incorrectly computed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • Morpheus
    • Morpheus
    • analytics
    • Untriaged
    • 0
    • Unknown

    Description

      The delivered properties of the secondary index btree search operator is incorrectly computed because it uses the properties computer of the dataset. The properties computer of the dataset computes the delivered properties based on the assumption that the scan variables are $PK0, $PK1,...$ds_record(,$meta_record?). This is not true for secondary index btree search operators because the scan variables are $SK0,$SK1,...$PK0,$PK1,..

      The usual usage of secondary index search operators in a query plan (such as the plan below) does not run into a problem because of this issue due to the fact that the delivered properties are not used. However, there could be other usages where this issue can cause problems.

      ...
        select (ge($$ds1.getField("age"), 20)) 
        -- STREAM_SELECT  |PARTITIONED|
          project ([$$ds1]) 
          -- STREAM_PROJECT  |PARTITIONED|
            exchange 
            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
              unnest-map [$$16, $$ds1] <- index-search("ds1", 0, "Default", "ds1", false, false, 1, $$20, 1, $$20, true, true, true) 
              -- BTREE_SEARCH  |PARTITIONED|
                exchange 
                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                  order (ASC, $$20) 
                  -- STABLE_SORT [$$20(ASC)]  |PARTITIONED|
                    exchange 
                    -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                      project ([$$20]) 
                      -- STREAM_PROJECT  |PARTITIONED|
                        exchange 
                        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                          unnest-map [$$19, $$20] <- index-search("ds1_idx", 0, "Default", "ds1", false, false, 1, $$18, 0, true, true, false) 
                          -- BTREE_SEARCH  |PARTITIONED|
                            exchange 
                            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                              assign [$$18] <- [0] 
                              -- ASSIGN  |PARTITIONED|
                                empty-tuple-source 
                                -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
      

      Attachments

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

        Activity

          People

            ali.alsuliman Ali Alsuliman
            ali.alsuliman Ali Alsuliman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty