Commit de3019c6 authored by kostja@oak.local's avatar kostja@oak.local

comment made more explanatory

parent 29eec6c7
...@@ -2149,11 +2149,13 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count, ...@@ -2149,11 +2149,13 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
} }
/* /*
In case of full scan we check every row in the table: We estimate the cost of making full cortesian product between
here we take into account rows read and skipped, as well as rows rows in the scanned table and generated records as
passed to next select record_count*s->records/TIME_FOR_COMPARE. Taking into account
cost of evaluating WHERE clause for s->found_records is not
necessary because it costs much less than the cost mentioned
above.
*/ */
if (best == DBL_MAX || if (best == DBL_MAX ||
(tmp + record_count/(double) TIME_FOR_COMPARE*s->records < (tmp + record_count/(double) TIME_FOR_COMPARE*s->records <
best + record_count/(double) TIME_FOR_COMPARE*records)) best + record_count/(double) TIME_FOR_COMPARE*records))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment