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

Use "rejected row count" for RelOptCost#getRows

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.21.0
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None

      Description

      Current cost#rows has a problem: it does not add well when computing cumulative cost.

      So the idea is to use the number of rejected rows.

      Then the field would have certain meaning:

      • If the value is high, the plan is probably rejecting a lot of unrelated rows, thus it is suboptimal
      • Extra Project/Calc nodes won't artificially increase rows in the cost fields. Currently each Project adds "rows" which is not very good.
      • It is clear what to put to the rows field: "rejected rows" is more-or-less understandable. For Project it would be 0.
      • Join/Filter/Calc nodes would show "estimated number of returned rows=X (from metadataquery), rejected rows=Y (from cost)" which would help understanding where the time is spent

      That is inspired by PostgreSQL's "rows removed by filter" when running explain analyze (which is statement execution + collecting statistics on each execution plan node):
      http://wiki.postgresql.org/wiki/What's_new_in_PostgreSQL_9.2#Explain_improvements

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                vladimirsitnikov Vladimir Sitnikov
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: