Bug #33321 | print_plan does not print appropriate values. | ||
---|---|---|---|
Submitted: | 18 Dec 2007 6:34 | Modified: | 18 Feb 2014 15:43 |
Reporter: | Sadao Hiratsuka (Basic Quality Contributor) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 5.0.52, 5.0-bzr, 5.1-bzr | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | Optimizer, print_plan, qc |
[18 Dec 2007 6:34]
Sadao Hiratsuka
[31 Mar 2009 16:24]
Valeriy Kravchuk
I can confirm that we still have this calls in the best_extension_by_limited_search() function in current 5.0 sources from bzr: DBUG_EXECUTE("opt", print_plan(join, idx, record_count, read_time, read_time, "part_plan");); DBUG_EXECUTE("opt", print_plan(join, idx+1, current_record_count, read_time, (current_read_time + current_record_count / (double) TIME_FOR_COMPARE), "prune_by_cost");); DBUG_EXECUTE("opt", print_plan(join, idx+1, current_record_count, read_time, current_read_time, "pruned_by_heuristic");); DBUG_EXECUTE("opt", print_plan(join, idx+1, current_record_count, read_time, current_read_time, "full_plan");); Also note that print_plan() is defined in sql/sql_test.cc as follows: /* Print the current state during query optimization. SYNOPSIS print_plan() join pointer to the structure providing all context info for the query read_time the cost of the best partial plan record_count estimate for the number of records returned by the best partial plan idx length of the partial QEP in 'join->positions'; also an index in the array 'join->best_ref'; info comment string to appear above the printout DESCRIPTION This function prints to the log file DBUG_FILE the members of 'join' that are used during query optimization (join->positions, join->best_positions, and join->best_ref) and few other related variables (read_time, record_count). Useful to trace query optimizer functions. RETURN None */ void print_plan(JOIN* join, uint idx, double record_count, double read_time, double current_read_time, const char *info) { ... } As you can see, read_time is explained as "the cost of the best partial plan", but there is NO explanation what current_read_time is then. I think we need at least more clear comments here.
[18 Feb 2014 15:43]
Paul DuBois
Per the development team, this is not a bug, but the print_plan() function header comment was not clear. To address this, the comment has been revised to be more informative.
[18 Feb 2014 15:43]
Paul DuBois
The change was made in 5.7.4.