Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-402

Take into account the cost of subqueries during optimization

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      When computing the cost of any query plan the optimizer should take into account the cost of subquery predicates. Currently plan costs are computed with the assumption that all rows read by a plan belong to the tables contained directly in the plan (that is, the tables from all JOIN_TABs).

      However, if a query plan contains subquery predicates, the evaluation
      of these predicates contributes to the total cost and number of examined rows of the outer plan.

      Not taking into account the additional cost of nested subqueries results in underestimating the cost of various execution methods.

      For instance, for Q20 from DBT3 currently the optimizer chooses materialization instead of a much more efficient semi-join (when combined with mdev-83).

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              timour Timour Katchaounov added a comment -

              This task is now part of MDEV-83. It will not be pushed separately.

              Show
              timour Timour Katchaounov added a comment - This task is now part of MDEV-83 . It will not be pushed separately.

                People

                • Assignee:
                  timour Timour Katchaounov
                  Reporter:
                  timour Timour Katchaounov
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 2 days, 1 hour, 15 minutes
                    2d 1h 15m