1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +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:
Monty
2022-06-30 15:43:58 +03:00
committed by Sergei Petrunia
parent 4515a89814
commit 07df2029a3
15 changed files with 424 additions and 414 deletions

View File

@ -7046,8 +7046,8 @@ SELECT * FROM t1
WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index a a 5 NULL 2 Using where; Using index
2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
2 SUBQUERY <subquery3> eq_ref distinct_key distinct_key 4 test.t2.c 1
2 SUBQUERY <subquery3> ALL distinct_key NULL NULL NULL 1
2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
3 MATERIALIZED t3 ALL NULL NULL NULL NULL 2
SELECT * FROM t1
WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10;