Commit 7f51be5c authored by osku's avatar osku

Disable prefetch and adaptive hash index for tables with rows over 1024

bytes in InnoDB's SQL parser.
parent 08209c5d
...@@ -45,6 +45,9 @@ to que_run_threads: this is to allow canceling runaway queries */ ...@@ -45,6 +45,9 @@ to que_run_threads: this is to allow canceling runaway queries */
#define SEL_COST_LIMIT 100 #define SEL_COST_LIMIT 100
/* The lower limit for what we consider a "big" row */
#define BIG_ROW_SIZE 1024
/* Flags for search shortcut */ /* Flags for search shortcut */
#define SEL_FOUND 0 #define SEL_FOUND 0
#define SEL_EXHAUSTED 1 #define SEL_EXHAUSTED 1
...@@ -1240,7 +1243,8 @@ table_loop: ...@@ -1240,7 +1243,8 @@ table_loop:
mtr_start(&mtr); mtr_start(&mtr);
if (consistent_read && plan->unique_search && !plan->pcur_is_open if (consistent_read && plan->unique_search && !plan->pcur_is_open
&& !plan->must_get_clust) { && !plan->must_get_clust
&& (plan->table->max_row_size < BIG_ROW_SIZE)) {
if (!search_latch_locked) { if (!search_latch_locked) {
rw_lock_s_lock(&btr_search_latch); rw_lock_s_lock(&btr_search_latch);
...@@ -1628,7 +1632,8 @@ rec_loop: ...@@ -1628,7 +1632,8 @@ rec_loop:
} }
if ((plan->n_rows_fetched <= SEL_PREFETCH_LIMIT) if ((plan->n_rows_fetched <= SEL_PREFETCH_LIMIT)
|| plan->unique_search || plan->no_prefetch) { || plan->unique_search || plan->no_prefetch
|| (plan->table->max_row_size >= BIG_ROW_SIZE)) {
/* No prefetch in operation: go to the next table */ /* No prefetch in operation: go to the next table */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment