diff options
author | kostja@oak.local <> | 2003-09-16 21:20:16 +0400 |
---|---|---|
committer | kostja@oak.local <> | 2003-09-16 21:20:16 +0400 |
commit | de3019c61a34f885eb1936018634af0f652160a2 (patch) | |
tree | 72f1f53f09256da74d177800857d115bc9afe7b5 /sql/sql_select.cc | |
parent | 29eec6c7387eda257081438521471dffd4cce512 (diff) | |
download | mariadb-git-de3019c61a34f885eb1936018634af0f652160a2.tar.gz |
comment made more explanatory
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index bd0c21bb3b0..d537dccc5a6 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -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: - here we take into account rows read and skipped, as well as rows - passed to next select - */ - + We estimate the cost of making full cortesian product between + rows in the scanned table and generated records as + 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 || (tmp + record_count/(double) TIME_FOR_COMPARE*s->records < best + record_count/(double) TIME_FOR_COMPARE*records)) |