diff options
author | Monty <monty@mariadb.org> | 2020-02-27 19:12:27 +0200 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2020-03-27 03:54:45 +0200 |
commit | f36ca142f7fa59598e34e842b60372b963067766 (patch) | |
tree | 4b797dcf88e98fd9fe83e3a29bfaabc10b7219c2 /include/maria.h | |
parent | 9b061990801b5c8309149794145f9c361bb8cfc6 (diff) | |
download | mariadb-git-f36ca142f7fa59598e34e842b60372b963067766.tar.gz |
Added page_range to records_in_range() to improve range statistics
Prototype change:
- virtual ha_rows records_in_range(uint inx, key_range *min_key,
- key_range *max_key)
+ virtual ha_rows records_in_range(uint inx, const key_range *min_key,
+ const key_range *max_key,
+ page_range *res)
The handler can ignore the page_range parameter. In the case the handler
updates the parameter, the optimizer can deduce the following:
- If previous range's last key is on the same block as next range's first
key
- If the current key range is in one block
- We can also assume that the first and last block read are cached!
This can be used for a better calculation of IO seeks when we
estimate the cost of a range index scan.
The parameter is fully implemented for MyISAM, Aria and InnoDB.
A separate patch will update handler::multi_range_read_info_const() to
take the benefits of this change and also remove the double
records_in_range() calls that are not anymore needed.
Diffstat (limited to 'include/maria.h')
-rw-r--r-- | include/maria.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/maria.h b/include/maria.h index 2c711b0d31d..a4c425ced47 100644 --- a/include/maria.h +++ b/include/maria.h @@ -324,7 +324,9 @@ extern int maria_extra(MARIA_HA *file, enum ha_extra_function function, void *extra_arg); extern int maria_reset(MARIA_HA *file); extern ha_rows maria_records_in_range(MARIA_HA *info, int inx, - key_range *min_key, key_range *max_key); + const key_range *min_key, + const key_range *max_key, + page_range *page); extern int maria_is_changed(MARIA_HA *info); extern int maria_delete_all_rows(MARIA_HA *info); extern uint maria_get_pointer_length(ulonglong file_length, uint def); |