mysql8新特性 hint variables

mysql 8 开始支持对sql临时生效variables

 

语法格式:

SELECT

/*+ SET_VAR(optimizer_switch = 'mrr_cost_based=off')

    SET_VAR(max_heap_table_size = 1G) */ *

FROM t1;

 

支持的参数列表:

auto_increment_increment

auto_increment_offset

big_tables

bulk_insert_buffer_size

default_tmp_storage_engine

div_precision_increment

end_markers_in_json

eq_range_index_dive_limit

foreign_key_checks

group_concat_max_len

insert_id

internal_tmp_mem_storage_engine

join_buffer_size

lock_wait_timeout

max_error_count

max_execution_time

max_heap_table_size

max_join_size

max_length_for_sort_data

max_points_in_geometry

max_seeks_for_key

max_sort_length

optimizer_prune_level

optimizer_search_depth variables

optimizer_switch

range_alloc_block_size

range_optimizer_max_mem_size

read_buffer_size

read_rnd_buffer_size

sort_buffer_size

sql_auto_is_null

sql_big_selects

sql_buffer_result

sql_mode

sql_safe_updates

sql_select_limit

timestamp

tmp_table_size

updatable_views_with_limit

unique_checks

windowing_use_high_precision

 

你可能感兴趣的:(实战技巧)