[MDEV-402] Take into account the cost of subqueries during optimization Created: 2012-07-18  Updated: 2013-05-27  Resolved: 2013-05-27

Status: Closed
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Major
Reporter: Timour Katchaounov (Inactive) Assignee: Timour Katchaounov (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None

Issue Links:
PartOf
includes MDEV-446 Reuse quick_condition_rows in fanout ... Closed

 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).



 Comments   
Comment by Timour Katchaounov (Inactive) [ 2013-05-27 ]

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

Generated at Thu Feb 08 06:28:28 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.