summaryrefslogtreecommitdiff
path: root/sql/opt_split.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2022-06-16 13:12:01 +0300
committerSergei Petrunia <sergey@mariadb.com>2023-02-02 22:58:38 +0300
commit4515a89814adaa61b26a900086a54b8cf51f188a (patch)
tree342a15a1e5b132e651bc24753d32053e9c9da597 /sql/opt_split.cc
parent1d82e5daf7174a402a603c553357dcb78515eb04 (diff)
downloadmariadb-git-4515a89814adaa61b26a900086a54b8cf51f188a.tar.gz
Fixed cost calculations for materialized tables
One effect of this change in the test suite is that tests with very few rows changed to use sub queries instead of materialization. This is correct and expected as for these the materialization overhead is too high. A lot of tests where fixed to still use materialization by adding a few rows to the tables (most tests has only 2-3 rows and are thus easily affected when cost computations are changed). Other things: - Added more variables to TMPTABLE_COSTS for better cost calculation - Added cost of copying rows to TMPTABLE_COSTS lookup and write - Added THD::optimizer_cache_hit_ratio for easier cost calculations - Added DISK_FAST_READ_SIZE to be used when calculating costs when reading big blocks from a disk
Diffstat (limited to 'sql/opt_split.cc')
-rw-r--r--sql/opt_split.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/opt_split.cc b/sql/opt_split.cc
index 6c31b895378..8cb82693d96 100644
--- a/sql/opt_split.cc
+++ b/sql/opt_split.cc
@@ -672,7 +672,7 @@ double spl_postjoin_oper_cost(THD *thd, double join_record_count, uint rec_len)
{
double cost;
TMPTABLE_COSTS tmp_cost= get_tmp_table_costs(thd, join_record_count,
- rec_len, 0);
+ rec_len, 0, 1);
// cost to fill tmp table
cost= tmp_cost.create + tmp_cost.write * join_record_count;
// cost to perform post join operation used here