Derby
  1. Derby
  2. DERBY-4650

Predicates in HAVING clause should be pushed down to restricted VTIs

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.6.1.0
    • Fix Version/s: None
    • Component/s: SQL
    • Urgency:
      Normal
    • Issue & fix info:
      Repro attached
    • Bug behavior facts:
      Performance

      Description

      If you perform a query with an aggregate function against a restricted table function, the predicates in the HAVING clause are not pushed down to the table function.

      1. test.diff
        1 kB
        Knut Anders Hatlen

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        The attached patch adds a test case to RestrictedVTITest that shows that the predicate is not pushed in the following query:

        select s_r, count from table(integerList()) t group by s_r having s_r > 1

        Only the rows with s_r > 1 have to be returned by the table function integerList, so pushing the predicate could be useful.

        Committed the new test case to trunk with revision 943088.

        Show
        Knut Anders Hatlen added a comment - The attached patch adds a test case to RestrictedVTITest that shows that the predicate is not pushed in the following query: select s_r, count from table(integerList()) t group by s_r having s_r > 1 Only the rows with s_r > 1 have to be returned by the table function integerList, so pushing the predicate could be useful. Committed the new test case to trunk with revision 943088.

          People

          • Assignee:
            Unassigned
            Reporter:
            Knut Anders Hatlen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development