RR模式下insert..selcet sending data状态是怎样的
RR模式下insert..selcet sending data状态是怎样的,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。
例如:
其中的sending data是什么意思。隔离级别为RR,语句为insert..select。
二、关于sending data以前就说过这个问题,实际上sending data可能包含如下:
Innodb 层数据的定位返回给MySQL 层
Innodb 层数据的查询返回给MySQL 层
Innodb 层数据的修改(如果是insert..select)
Innodb 层加锁以及等待
等待进入Innodb层(innodb_thread_concurrency参数)
MySQL 层发送数据给客户端
三、RR模式下对于insert..selcet 处于 sending data的原因总结RR模式下insert..select的select表会上S行锁,如果这行处于X锁则会出现 sending data状态
insert..selcet中insert记录如果处于堵塞(唯一性检查)状态会处于 sending data状态
整个过程如果需要操作的数据量较大,处于sending data状态。
四、每行数据处理方式929T@4:||||||THD::enter_stage:'Sendingdata'/cdh/mysqldebug/percona-server-5.7.29-32/sql/sql_executor.cc:202930T@4:||||||>PROFILING::status_change931T@4:||||||<PROFILING::status_change391932T@4:||||||info:Sendingdata933T@4:||||||>do_select934T@4:|||||||>sub_select935T@4:||||||||>init_read_record936T@4:|||||||||info:usingrr_sequential937T@4:|||||||||>ha_rnd_init938T@4:||||||||||>change_active_index939T@4:|||||||||||>innobase_get_index940T@4:|||||||||||<innobase_get_index10117941T@4:||||||||||<change_active_index10241942T@4:|||||||||<ha_rnd_init3111943T@4:|||||||||>innobase_trx_init944T@4:|||||||||<innobase_trx_init3109945T@4:||||||||<init_read_record349946T@4:||||||||>handler::ha_rnd_next947T@4:|||||||||>rnd_next948T@4:||||||||||>index_first949T@4:|||||||||||>index_read950T@4:||||||||||||>row_search_mvcc951T@4:|||||||||||||>row_sel_store_mysql_rec952T@4:||||||||||||||>row_sel_store_mysql_field_func953T@4:||||||||||||||<row_sel_store_mysql_field_func3275954T@4:||||||||||||||>row_sel_store_mysql_field_func955T@4:||||||||||||||<row_sel_store_mysql_field_func3275956T@4:|||||||||||||<row_sel_store_mysql_rec3465957T@4:||||||||||||<row_search_mvcc6574958T@4:|||||||||||<index_read10042959T@4:||||||||||<index_first10430960T@4:|||||||||<rnd_next10531961T@4:||||||||<handler::ha_rnd_next3172962T@4:||||||||>evaluate_join_record963T@4:|||||||||enter:join:0x7ffef8019970join_tabindex:0table:testlockcond:0x0964T@4:|||||||||counts:evaluate_join_recordjoin->examined_rows++:1965T@4:|||||||||>end_send966T@4:||||||||||>Query_result_insert::send_data967T@4:|||||||||||>fill_record968T@4:||||||||||||>Item_field::save_in_field_inner969T@4:||||||||||||<Item_field::save_in_field_inner6720970T@4:||||||||||||>Item_field::save_in_field_inner971T@4:||||||||||||<Item_field::save_in_field_inner6720972T@4:|||||||||||<fill_record9801973T@4:|||||||||||>write_record974T@4:||||||||||||>init_alloc_root975T@4:|||||||||||||enter:root:0x7fffe8e48c20976T@4:||||||||||||<init_alloc_root100977T@4:||||||||||||>COPY_INFO::set_function_defaults978T@4:||||||||||||<COPY_INFO::set_function_defaults135979T@4:||||||||||||>handler::ha_write_row980T@4:|||||||||||||>ha_innobase::write_row981T@4:||||||||||||||>row_ins982T@4:|||||||||||||||row_ins:table:test/testbb983T@4:|||||||||||||||>row_ins_index_entry_step984T@4:||||||||||||||||>row_ins_clust_index_entry985T@4:|||||||||||||||||>row_ins_clust_index_entry_low986T@4:||||||||||||||||||>btr_cur_search_to_nth_level987T@4:||||||||||||||||||<btr_cur_search_to_nth_level2092988T@4:||||||||||||||||||>thd_report_row_lock_wait989T@4:||||||||||||||||||<thd_report_row_lock_wait4280990T@4:|||||||||||||||||<row_ins_clust_index_entry_low2692991T@4:||||||||||||||||<row_ins_clust_index_entry3337992T@4:|||||||||||||||<row_ins_index_entry_step3619993T@4:||||||||||||||<row_ins3763994T@4:||||||||||||||>thd_mark_transaction_to_rollback995T@4:||||||||||||||<thd_mark_transaction_to_rollback4147996T@4:|||||||||||||<ha_innobase::write_row8895997T@4:||||||||||||<handler::ha_write_row8565
及RR模式下insert select的逻辑大概为查询一行加锁(RC下没有加锁步骤)一行插入一行,直到所有行处理完成。整个过程处于’Sending data’状态下面。因此insert select和普通的insert操作有较大的区别。
关于RR模式下insert..selcet sending data状态是怎样的问题的解答就分享到这里了,希望以上内容可以对大家有一定的帮助,如果你还有很多疑惑没有解开,可以关注亿速云行业资讯频道了解更多相关知识。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。