mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Adjust cost for re-creating a row from the JOIN CACHE
Creating a record from the join cache is faster than getting a row from the engine (less and simpler code to execute). Added JOIN_CACHE_ROW_COPY_COST_FACTOR (0.5 for now) as the factor to take this into account. This is multiplied with ROW_COPY_COST. Other things: - Added cost of copying rows to hash join, similar to join_cache joins.
This commit is contained in:
@@ -8786,7 +8786,8 @@ best_access_path(JOIN *join,
|
||||
row combinations, only a HASH_FANOUT (10%) rows in the cache.
|
||||
*/
|
||||
cmp_time= (rnd_records * record_count * HASH_FANOUT *
|
||||
WHERE_COST_THD(thd));
|
||||
(ROW_COPY_COST_THD(thd) * JOIN_CACHE_ROW_COPY_COST_FACTOR +
|
||||
WHERE_COST_THD(thd)));
|
||||
tmp= COST_ADD(tmp, cmp_time);
|
||||
|
||||
best_cost= tmp;
|
||||
@@ -9018,7 +9019,8 @@ best_access_path(JOIN *join,
|
||||
row.
|
||||
*/
|
||||
cmp_time= (rnd_records * record_count *
|
||||
(ROW_COPY_COST_THD(thd) * (idx - join->const_tables) +
|
||||
(ROW_COPY_COST_THD(thd) * (idx - join->const_tables) *
|
||||
JOIN_CACHE_ROW_COPY_COST_FACTOR +
|
||||
WHERE_COST_THD(thd)));
|
||||
tmp= COST_ADD(tmp, cmp_time);
|
||||
}
|
||||
|
Reference in New Issue
Block a user