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

Allow partial pushdown of ANDed predicates

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • Morpheus
    • Morpheus
    • analytics

    Description

      Currently, we are too conservative on what to pushdown. For example, the following predicate in the WHERE clause will not be pushed as one of the ANDed predicates does not involve a constant:

      SELECT o.o_ol_cnt, 
                     SUM (case when o.o_carrier_id = 1 or o.o_carrier_id = 2 
                     THEN 1 ELSE 0 END) AS high_line_COUNT, 
                     SUM (case when o.o_carrier_id <> 1 AND o.o_carrier_id <> 2 
                     THEN 1 ELSE 0 END) AS low_line_COUNT 
      FROM orders o, o.o_orderline ol 
      WHERE  o.o_entry_d <= ol.ol_delivery_d -- NOT A CONSTANT
      AND  ol.ol_delivery_d >= '2016-01-01 00:00:00.000000'
      AND  ol.ol_delivery_d < '2017-01-01 00:00:00.000000' 
      GROUP BY o.o_ol_cnt 
      ORDER BY o.o_ol_cnt;

      However, we can safely push  ol.ol_delivery_d >= '2016-01-01 00:00:00.000000' AND  ol.ol_delivery_d < '2017-01-01 00:00:00.000000' 

      Attachments

        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:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty