forked from mysql/mysql-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug#36980184: Use first-row-count instead of init-cost as cost
dimension in hypergraph [2/2, compare] Make CompareAccessPaths() use first_row_cost() instead of init_cost() as cost dimension. When init_cost() is a cost dimension, the hypergraph optimizer will keep the candidates that are the cheapest ones to initialize and read zero rows from. A better dimension would be the cost of initializing the path and reading the amount of rows needed to reach the LIMIT in the query. Currently, there is no estimate for the number of rows that have to be read from a path to reach the LIMIT. But it's reasonable to expect that more often than not, at least one row will be read. So using first_row_cost() will in most cases be slightly better than using init_cost(). This change could give better plans for some queries using LIMIT. Another effect is that it could speed up planning time, because more candidates with a very high total cost and zero init cost can be rejected earlier when a fraction of the very high total cost is taken into the value. This is seen to reduce planning time in some complex queries. Change-Id: Ida4fcf734b0e5973010891bb97ee0423c9ff7840
- Loading branch information
Showing
7 changed files
with
161 additions
and
145 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.