Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-5091

RelMdRowCount can return more accurate rowCount when fetch is deterministic and offset is dynamic

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.30.0
    • 1.31.0
    • core

    Description

      The sql from CALCITE-5048

      select * from emp order by ename limit 1 offset ?
      

      RelMdRowCount#getRowCount will return 14d, because it always return rowCount when offset is dynamic.

          if (rel.offset instanceof RexDynamicParam) {
            return rowCount;
          }
      

      Obviously, rowCount will not exceed 1 because LIMIT 1. We can improve it.

      Attachments

        Issue Links

          Activity

            People

              jiajunbernoulli Jiajun Xie
              jiajunbernoulli Jiajun Xie
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m