diff options
author | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2022-06-30 14:31:54 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2022-07-10 15:09:32 +0300 |
commit | e50c7d2baf1f0a36f8654ffd5cd39ac35dfe1b40 (patch) | |
tree | b0150a5740bc2d1737f53341b8ef2bd7a115f4a8 /sql/sql_analyse.h | |
parent | 6040afbea74d9d359e77ab5708f271623f8e2dc0 (diff) | |
download | mariadb-git-e50c7d2baf1f0a36f8654ffd5cd39ac35dfe1b40.tar.gz |
Rewrite cost computation for filesort operations
This is a rework of how filesort calculates costs to allow functions
like test_if_skip_sort_order() to calculate the cost of filesort to
decide between filesort and using a key to resolve ORDER BY.
Changes:
- Split cost calculation of qsort + optional merge sort and priority queue
to dedicated functions.
- Fixed some wrong calculations of cost in old code (use of log() instead
of log2()).
- Added costs realted to fetching the rows if addon fields are not used.
- Updated get_merge_cost() to take into account that we are going to
read data from temporary files in big chuncks (DISK_CHUNCK_SIZE (64K) and
not in IO_SIZE (4K).
- More code documentation including various variables in Sort_param.
One effect of the cost update is that the cost of priority queue
with addon field has decreased slightly and is used in more cases.
When the rowid is large (like with InnoDB where rowid is the priority key),
using addon fields is in many cases preferable.
Reviewer: Monty
Diffstat (limited to 'sql/sql_analyse.h')
0 files changed, 0 insertions, 0 deletions