Created
February 27, 2024 11:59
-
-
Save spetrunia/90032801478118d9c9eb4c918e1a3881 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/sql/sql_select.cc b/sql/sql_select.cc | |
index a62aa1c158b..0c42ebb4892 100644 | |
--- a/sql/sql_select.cc | |
+++ b/sql/sql_select.cc | |
@@ -8129,6 +8129,8 @@ best_access_path(JOIN *join, | |
if (table->opt_range[key].key_parts >= max_key_part) // (2) | |
{ | |
double rows= (double) table->opt_range[key].rows; | |
+ // psergey: make records optimistic: | |
+ records= rows/2; | |
if (!found_ref && // (1) | |
records < rows) // (3) | |
{ | |
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc | |
index d2b6bd62520..5addf00171b 100644 | |
--- a/storage/innobase/handler/ha_innodb.cc | |
+++ b/storage/innobase/handler/ha_innodb.cc | |
@@ -14254,6 +14254,18 @@ ha_innobase::records_in_range( | |
mem_heap_t* heap; | |
DBUG_ENTER("records_in_range"); | |
+ //psergey | |
+ if (!strcmp(table->s->table_name.str, "action_integer")) | |
+ { | |
+ if (!strcmp(table->key_info[keynr].name.str, "type_e_integer_index")) | |
+ DBUG_RETURN(2005818); | |
+ if (!strcmp(table->key_info[keynr].name.str, "type_element_id_event_date_index")) | |
+ DBUG_RETURN(11593995); | |
+ if (!strcmp(table->key_info[keynr].name.str, "event_date_type_e_integer_index")) | |
+ DBUG_RETURN(894846); | |
+ if (!strcmp(table->key_info[keynr].name.str, "event_date_index")) | |
+ DBUG_RETURN(965898); | |
+ } | |
ut_a(m_prebuilt->trx == thd_to_trx(ha_thd())); | |
@@ -14779,6 +14791,11 @@ ha_innobase::info_low( | |
ut_a(ib_table->stat_initialized); | |
n_rows = ib_table->stat_n_rows; | |
+ if (!strcmp(table->s->table_name.str, "action_integer")) | |
+ { | |
+ n_rows= ib_table->stat_n_rows= 23187991; | |
+ ib_table->stat_clustered_index_size= 204544; | |
+ } | |
stat_clustered_index_size | |
= ib_table->stat_clustered_index_size; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment