1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Adjust costs for rowid filter

- Use log2() insted of log()
- Added missing ''+' when calculating rowid setup cost
- Adjusted ROWID_FILTER_PER_ELEMENT_MODIFIER (from 3 to 1)

Other things:
- Adjusted cost for index_merge where rows_out < 1.0

The effects of the changes:
- rowid filter will have higher setup cost
- rowid filter will have slightly less costs per row

This can be seen in mtr where some tests, with 'small tables or
that uses rowid filters with many rows, will not use rowid filter anymore.
This commit is contained in:
Monty
2023-02-12 14:53:47 +02:00
committed by Sergei Petrunia
parent 9c401c8c39
commit 3c1b7fb03e
33 changed files with 438 additions and 748 deletions

View File

@ -394,8 +394,8 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
"index": "key2",
"index_scan_cost": 0.240986767,
"cumulated_index_scan_cost": 0.481973534,
"disk_sweep_cost": 0.088032868,
"cumulative_total_cost": 0.570006402,
"disk_sweep_cost": 0.089164506,
"cumulative_total_cost": 0.57113804,
"usable": true,
"matching_rows_now": 77.6360508,
"intersect_covering_with_this_index": false,
@ -420,7 +420,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
"cause": "no clustered pk index"
},
"rows": 77,
"cost": 0.572490756,
"cost": 0.573622393,
"covering": false,
"chosen": true
},
@ -436,7 +436,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary'))
{
"type": "index_roworder_intersect",
"rows": 77,
"cost": 0.572490756,
"cost": 0.573622393,
"covering": false,
"clustered_pk_scan": false,
"intersect_of":
@ -458,7 +458,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary'))
]
},
"rows_for_plan": 77,
"cost_for_plan": 0.572490756,
"cost_for_plan": 0.573622393,
"chosen": true
}
]
@ -572,8 +572,8 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
"index": "key2",
"index_scan_cost": 0.240986767,
"cumulated_index_scan_cost": 0.481973534,
"disk_sweep_cost": 0.088032868,
"cumulative_total_cost": 0.570006402,
"disk_sweep_cost": 0.089164506,
"cumulative_total_cost": 0.57113804,
"usable": true,
"matching_rows_now": 77.6360508,
"intersect_covering_with_this_index": false,
@ -586,7 +586,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
"cause": "no clustered pk index"
},
"rows": 77,
"cost": 0.572490756,
"cost": 0.573622393,
"covering": false,
"chosen": true
}
@ -616,8 +616,8 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
"index": "key4",
"index_scan_cost": 0.240986767,
"cumulated_index_scan_cost": 0.481973534,
"disk_sweep_cost": 0.088032868,
"cumulative_total_cost": 0.570006402,
"disk_sweep_cost": 0.089164506,
"cumulative_total_cost": 0.57113804,
"usable": true,
"matching_rows_now": 77.6360508,
"intersect_covering_with_this_index": false,
@ -630,7 +630,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
"cause": "no clustered pk index"
},
"rows": 77,
"cost": 0.572490756,
"cost": 0.573622393,
"covering": false,
"chosen": true
}
@ -655,7 +655,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary'))
{
"type": "index_roworder_intersect",
"rows": 77,
"cost": 0.572490756,
"cost": 0.573622393,
"covering": false,
"clustered_pk_scan": false,
"intersect_of":
@ -679,7 +679,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary'))
{
"type": "index_roworder_intersect",
"rows": 77,
"cost": 0.572490756,
"cost": 0.573622393,
"covering": false,
"clustered_pk_scan": false,
"intersect_of":