mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Removed double records_in_range calls from multi_range_read_info_const
This was to remove a performance regression between 10.3 and 10.4 In 10.5 we will have a better implementation of records_in_range that will enable us to get more statistics. This change was not done in 10.4 because the 10.5 will be part of a larger change that is not suitable for the GA 10.4 version Other things: - Changed default handler block_size to 8192 to fix things statistics for engines that doesn't set the block size. - Fixed a bug in spider when using multiple part const ranges (Patch from Kentoku)
This commit is contained in:
@@ -10373,6 +10373,7 @@ int spider_mbase_handler::append_is_null(
|
||||
key->flag == HA_READ_KEY_EXACT ||
|
||||
key->flag == HA_READ_KEY_OR_NEXT
|
||||
) {
|
||||
#ifdef SPIDER_HANDLER_SUPPORT_MULTIPLE_KEY_PARTS
|
||||
if (tgt_final)
|
||||
{
|
||||
if (str->reserve(SPIDER_SQL_EQUAL_LEN))
|
||||
@@ -10383,11 +10384,23 @@ int spider_mbase_handler::append_is_null(
|
||||
if (str->reserve(SPIDER_SQL_NULL_LEN))
|
||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||
str->q_append(SPIDER_SQL_NULL_STR, SPIDER_SQL_NULL_LEN);
|
||||
#else
|
||||
if (str_part->length() == SPIDER_SQL_OPEN_PAREN_LEN)
|
||||
{
|
||||
if (str->reserve(SPIDER_SQL_EQUAL_LEN))
|
||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||
str->q_append(SPIDER_SQL_EQUAL_STR, SPIDER_SQL_EQUAL_LEN);
|
||||
str = str_part;
|
||||
if (str->reserve(SPIDER_SQL_NULL_LEN))
|
||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||
str->q_append(SPIDER_SQL_NULL_STR, SPIDER_SQL_NULL_LEN);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
#ifdef SPIDER_HANDLER_SUPPORT_MULTIPLE_KEY_PARTS
|
||||
if (str_part->length() == SPIDER_SQL_OPEN_PAREN_LEN)
|
||||
{
|
||||
str = str_part;
|
||||
/* first index column */
|
||||
str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN);
|
||||
ha_next_pos = str->length();
|
||||
if (str->reserve(SPIDER_SQL_FIRST_LEN))
|
||||
@@ -10404,6 +10417,19 @@ int spider_mbase_handler::append_is_null(
|
||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||
str->q_append(SPIDER_SQL_NULL_STR, SPIDER_SQL_NULL_LEN);
|
||||
}
|
||||
#else
|
||||
if (str_part->length() == SPIDER_SQL_OPEN_PAREN_LEN)
|
||||
{
|
||||
str = str_part;
|
||||
/* first index column */
|
||||
str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN);
|
||||
ha_next_pos = str->length();
|
||||
if (str->reserve(SPIDER_SQL_FIRST_LEN))
|
||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||
str->q_append(SPIDER_SQL_FIRST_STR, SPIDER_SQL_FIRST_LEN);
|
||||
spider->result_list.ha_read_kind = 1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
str = str_part2;
|
||||
}
|
||||
@@ -10485,7 +10511,9 @@ int spider_mbase_handler::append_where_terminator(
|
||||
} else {
|
||||
str_part2->length(str_part2->length() - SPIDER_SQL_AND_LEN);
|
||||
|
||||
#ifdef SPIDER_HANDLER_SUPPORT_MULTIPLE_KEY_PARTS
|
||||
str_part->length(str_part->length() - SPIDER_SQL_COMMA_LEN);
|
||||
#endif
|
||||
if (!result_list->ha_read_kind)
|
||||
str_part->q_append(SPIDER_SQL_CLOSE_PAREN_STR,
|
||||
SPIDER_SQL_CLOSE_PAREN_LEN);
|
||||
|
Reference in New Issue
Block a user