十五:MySQL层事务提交流程简析(笔记)

本文涉及的产品
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS PostgreSQL,集群系列 2核4GB
简介: 部分栈帧:2、prepare栈帧(gdb) bt#0 binlog_prepare (hton=0x346f260, thd=0x7fff2c000b70, all=false) at /root/mysql5.

部分栈帧:

2、prepare栈帧

(gdb) bt
#0  binlog_prepare (hton=0x346f260, thd=0x7fff2c000b70, all=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:1578
#1  0x0000000000f64e80 in ha_prepare_low (thd=0x7fff2c000b70, all=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:2348
#2  0x0000000001856176 in MYSQL_BIN_LOG::prepare (this=0x2dffe80, thd=0x7fff2c000b70, all=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:8165
#3  0x0000000000f63d1f in ha_commit_trans (thd=0x7fff2c000b70, all=false, ignore_global_read_lock=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:1803
#4  0x00000000016b3d7d in trans_commit_stmt (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/transaction.cc:458
#5  0x00000000015ac64f in mysql_execute_command (thd=0x7fff2c000b70, first_level=true) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5239
#6  0x00000000015adcae in mysql_parse (thd=0x7fff2c000b70, parser_state=0x7ffff035b600) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5836
#7  0x00000000015a1b6d in dispatch_command (thd=0x7fff2c000b70, com_data=0x7ffff035bd70, command=COM_QUERY)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1447
#8  0x00000000015a099e in do_command (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1010
#9  0x00000000016e28f0 in handle_connection (arg=0x384a5d0) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/conn_handler/connection_handler_per_thread.cc:312
#10 0x0000000001d7a514 in pfs_spawn_thread (arg=0x3848260) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/perfschema/pfs.cc:2188
#11 0x0000003f74807aa1 in start_thread () from /lib64/libpthread.so.0
#12 0x0000003f740e8bcd in clone () from /lib64/libc.so.6
(gdb) b innobase_trx_init
Breakpoint 7 at 0x19a5fdb: file /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc, line 2753.
(gdb) c
Continuing.
AI 代码解读

trx_prepare_low

Breakpoint 7, innobase_trx_init (thd=0x7fff2c000b70, trx=0x7ffff2f2db00) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc:2753
2753            DBUG_ENTER("innobase_trx_init");
(gdb) bt 
#0  innobase_trx_init (thd=0x7fff2c000b70, trx=0x7ffff2f2db00) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc:2753
#1  0x00000000019a6291 in check_trx_exists (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc:2816
#2  0x00000000019c2b90 in innobase_xa_prepare (hton=0x2e9cdd0, thd=0x7fff2c000b70, prepare_trx=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc:17458
#3  0x0000000000f64e80 in ha_prepare_low (thd=0x7fff2c000b70, all=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:2348
#4  0x0000000001856176 in MYSQL_BIN_LOG::prepare (this=0x2dffe80, thd=0x7fff2c000b70, all=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:8165
#5  0x0000000000f63d1f in ha_commit_trans (thd=0x7fff2c000b70, all=false, ignore_global_read_lock=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:1803
#6  0x00000000016b3d7d in trans_commit_stmt (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/transaction.cc:458
#7  0x00000000015ac64f in mysql_execute_command (thd=0x7fff2c000b70, first_level=true) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5239
#8  0x00000000015adcae in mysql_parse (thd=0x7fff2c000b70, parser_state=0x7ffff035b600) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5836
#9  0x00000000015a1b6d in dispatch_command (thd=0x7fff2c000b70, com_data=0x7ffff035bd70, command=COM_QUERY)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1447
#10 0x00000000015a099e in do_command (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1010
#11 0x00000000016e28f0 in handle_connection (arg=0x384a5d0) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/conn_handler/connection_handler_per_thread.cc:312
#12 0x0000000001d7a514 in pfs_spawn_thread (arg=0x3848260) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/perfschema/pfs.cc:2188
#13 0x0000003f74807aa1 in start_thread () from /lib64/libpthread.so.0
#14 0x0000003f740e8bcd in clone () from /lib64/libc.so.6
(gdb) 
AI 代码解读

3、flush 之前写redo 栈帧
1145 bool write_header = new_data_offset == 0;

(gdb) bt
#0  log_group_write_buf (group=0x33ef9f8, buf=0x7fffa5b38000 "\200\020\300\253\002", len=1024, pad_len=0, start_lsn=562123776, new_data_offset=465)
    at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/log/log0log.cc:1145
#1  0x0000000001a50dd5 in log_write_up_to (lsn=562124558, flush_to_disk=true) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/log/log0log.cc:1493
#2  0x0000000001a50ec7 in log_buffer_flush_to_disk (sync=true) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/log/log0log.cc:1524
#3  0x00000000019a9077 in innobase_flush_logs (hton=0x2e9cdd0, binlog_group_flush=true)
    at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc:4407
#4  0x0000000000f65893 in flush_handlerton (thd=0x0, plugin=0x7ffff03588e8, arg=0x7ffff0358944) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:2606
#5  0x00000000015d76ee in plugin_foreach_with_mask (thd=0x0, func=0xf65835 <flush_handlerton(THD*, plugin_ref, void*)>, type=1, state_mask=4294967287, 
    arg=0x7ffff0358944) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_plugin.cc:2318
#6  0x0000000000f658ef in ha_flush_logs (db_type=0x0, binlog_group_flush=true) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:2617
#7  0x000000000185725d in MYSQL_BIN_LOG::process_flush_stage_queue (this=0x2dffe80, total_bytes_var=0x7ffff0358a88, rotate_var=0x7ffff0358a87, 
    out_queue_var=0x7ffff0358a78) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:8541
#8  0x00000000018588bf in MYSQL_BIN_LOG::ordered_commit (this=0x2dffe80, thd=0x7fff2c000b70, all=false, skip_commit=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:9189
#9  0x0000000001856f2c in MYSQL_BIN_LOG::commit (this=0x2dffe80, thd=0x7fff2c000b70, all=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:8440
#10 0x0000000000f63df8 in ha_commit_trans (thd=0x7fff2c000b70, all=false, ignore_global_read_lock=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:1818
#11 0x00000000016b3d7d in trans_commit_stmt (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/transaction.cc:458
#12 0x00000000015ac64f in mysql_execute_command (thd=0x7fff2c000b70, first_level=true) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5239
#13 0x00000000015adcae in mysql_parse (thd=0x7fff2c000b70, parser_state=0x7ffff035b600) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5836
#14 0x00000000015a1b6d in dispatch_command (thd=0x7fff2c000b70, com_data=0x7ffff035bd70, command=COM_QUERY)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1447
#15 0x00000000015a099e in do_command (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1010
#16 0x00000000016e28f0 in handle_connection (arg=0x68e1060) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/conn_handler/connection_handler_per_thread.cc:312
#17 0x0000000001d7a514 in pfs_spawn_thread (arg=0x3848660) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/perfschema/pfs.cc:2188
#18 0x0000003f74807aa1 in start_thread () from /lib64/libpthread.so.0
#19 0x0000003f740e8bcd in clone () from /lib64/libc.so.6
AI 代码解读

4、order commit innodb层commit栈帧


Breakpoint 2, trx_purge_add_update_undo_to_history (trx=0x7ffff2f2e068, undo_ptr=0x7ffff2f2e488, undo_page=0x7fffb0244000 "E\373\332r", update_rseg_history_len=true, 
    n_added_logs=1, mtr=0x7ffff03582f0) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0purge.cc:332
332             undo = undo_ptr->update_undo;
(gdb) bt
#0  trx_purge_add_update_undo_to_history (trx=0x7ffff2f2e068, undo_ptr=0x7ffff2f2e488, undo_page=0x7fffb0244000 "E\373\332r", update_rseg_history_len=true, 
    n_added_logs=1, mtr=0x7ffff03582f0) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0purge.cc:332
#1  0x0000000001bef543 in trx_undo_update_cleanup (trx=0x7ffff2f2e068, undo_ptr=0x7ffff2f2e488, undo_page=0x7fffb0244000 "E\373\332r", update_rseg_history_len=true, 
    n_added_logs=1, mtr=0x7ffff03582f0) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0undo.cc:1962
#2  0x0000000001bddf57 in trx_write_serialisation_history (trx=0x7ffff2f2e068, mtr=0x7ffff03582f0)
    at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:1698
#3  0x0000000001bdf45d in trx_commit_low (trx=0x7ffff2f2e068, mtr=0x7ffff03582f0) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:2204
#4  0x0000000001bdf5d2 in trx_commit (trx=0x7ffff2f2e068) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:2274
#5  0x0000000001bdff38 in trx_commit_for_mysql (trx=0x7ffff2f2e068) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:2550
#6  0x00000000019a9101 in innobase_commit_low (trx=0x7ffff2f2e068) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc:4451
#7  0x00000000019a99e7 in innobase_commit (hton=0x2e9cdd0, thd=0x7fff2c000b70, commit_trx=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc:4740
#8  0x0000000000f64104 in ha_commit_low (thd=0x7fff2c000b70, all=false, run_after_commit=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:1923
#9  0x000000000185764b in MYSQL_BIN_LOG::process_commit_stage_queue (this=0x2dffe80, thd=0x7fff2c000b70, first=0x7fff2c000b70)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:8647
#10 0x0000000001858e7d in MYSQL_BIN_LOG::ordered_commit (this=0x2dffe80, thd=0x7fff2c000b70, all=false, skip_commit=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:9318
#11 0x0000000001856f2c in MYSQL_BIN_LOG::commit (this=0x2dffe80, thd=0x7fff2c000b70, all=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:8440
#12 0x0000000000f63df8 in ha_commit_trans (thd=0x7fff2c000b70, all=false, ignore_global_read_lock=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:1818
#13 0x00000000016b3d7d in trans_commit_stmt (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/transaction.cc:458
#14 0x00000000015ac64f in mysql_execute_command (thd=0x7fff2c000b70, first_level=true) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5239
#15 0x00000000015adcae in mysql_parse (thd=0x7fff2c000b70, parser_state=0x7ffff035b600) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5836
#16 0x00000000015a1b6d in dispatch_command (thd=0x7fff2c000b70, com_data=0x7ffff035bd70, command=COM_QUERY)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1447
#17 0x00000000015a099e in do_command (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1010
#18 0x00000000016e28f0 in handle_connection (arg=0x68e11d0) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/conn_handler/connection_handler_per_thread.cc:312
#19 0x0000000001d7a514 in pfs_spawn_thread (arg=0x38484d0) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/perfschema/pfs.cc:2188
#20 0x0000003f74807aa1 in start_thread () from /lib64/libpthread.so.0
#21 0x0000003f740e8bcd in clone () from /lib64/libc.so.6
(gdb) c
Continuing.

Breakpoint 8, trx_commit_in_memory (trx=0x7ffff2f2e068, mtr=0x7ffff03582f0, serialised=true)
    at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:1972
1972            trx->must_flush_log_later = false;
(gdb) bt
#0  trx_commit_in_memory (trx=0x7ffff2f2e068, mtr=0x7ffff03582f0, serialised=true) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:1972
#1  0x0000000001bdf52a in trx_commit_low (trx=0x7ffff2f2e068, mtr=0x7ffff03582f0) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:2250
#2  0x0000000001bdf5d2 in trx_commit (trx=0x7ffff2f2e068) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:2274
#3  0x0000000001bdff38 in trx_commit_for_mysql (trx=0x7ffff2f2e068) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:2550
#4  0x00000000019a9101 in innobase_commit_low (trx=0x7ffff2f2e068) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc:4451
#5  0x00000000019a99e7 in innobase_commit (hton=0x2e9cdd0, thd=0x7fff2c000b70, commit_trx=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc:4740
#6  0x0000000000f64104 in ha_commit_low (thd=0x7fff2c000b70, all=false, run_after_commit=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:1923
#7  0x000000000185764b in MYSQL_BIN_LOG::process_commit_stage_queue (this=0x2dffe80, thd=0x7fff2c000b70, first=0x7fff2c000b70)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:8647
#8  0x0000000001858e7d in MYSQL_BIN_LOG::ordered_commit (this=0x2dffe80, thd=0x7fff2c000b70, all=false, skip_commit=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:9318
#9  0x0000000001856f2c in MYSQL_BIN_LOG::commit (this=0x2dffe80, thd=0x7fff2c000b70, all=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:8440
#10 0x0000000000f63df8 in ha_commit_trans (thd=0x7fff2c000b70, all=false, ignore_global_read_lock=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:1818
#11 0x00000000016b3d7d in trans_commit_stmt (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/transaction.cc:458
#12 0x00000000015ac64f in mysql_execute_command (thd=0x7fff2c000b70, first_level=true) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5239
#13 0x00000000015adcae in mysql_parse (thd=0x7fff2c000b70, parser_state=0x7ffff035b600) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5836
#14 0x00000000015a1b6d in dispatch_command (thd=0x7fff2c000b70, com_data=0x7ffff035bd70, command=COM_QUERY)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1447
#15 0x00000000015a099e in do_command (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1010
#16 0x00000000016e28f0 in handle_connection (arg=0x68e11d0) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/conn_handler/connection_handler_per_thread.cc:312
#17 0x0000000001d7a514 in pfs_spawn_thread (arg=0x38484d0) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/perfschema/pfs.cc:2188
#18 0x0000003f74807aa1 in start_thread () from /lib64/libpthread.so.0
#19 0x0000003f740e8bcd in clone () from /lib64/libc.so.6
(gdb) c
Continuing.

Breakpoint 3, trx_commit_complete_for_mysql (trx=0x7ffff2f2e068) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:2570
2570            if (trx->id != 0
(gdb) bt
#0  trx_commit_complete_for_mysql (trx=0x7ffff2f2e068) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/trx/trx0trx.cc:2570
#1  0x00000000019a9aab in innobase_commit (hton=0x2e9cdd0, thd=0x7fff2c000b70, commit_trx=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/storage/innobase/handler/ha_innodb.cc:4762
#2  0x0000000000f64104 in ha_commit_low (thd=0x7fff2c000b70, all=false, run_after_commit=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:1923
#3  0x000000000185764b in MYSQL_BIN_LOG::process_commit_stage_queue (this=0x2dffe80, thd=0x7fff2c000b70, first=0x7fff2c000b70)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:8647
#4  0x0000000001858e7d in MYSQL_BIN_LOG::ordered_commit (this=0x2dffe80, thd=0x7fff2c000b70, all=false, skip_commit=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:9318
#5  0x0000000001856f2c in MYSQL_BIN_LOG::commit (this=0x2dffe80, thd=0x7fff2c000b70, all=false) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/binlog.cc:8440
#6  0x0000000000f63df8 in ha_commit_trans (thd=0x7fff2c000b70, all=false, ignore_global_read_lock=false)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/handler.cc:1818
#7  0x00000000016b3d7d in trans_commit_stmt (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/transaction.cc:458
#8  0x00000000015ac64f in mysql_execute_command (thd=0x7fff2c000b70, first_level=true) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5239
#9  0x00000000015adcae in mysql_parse (thd=0x7fff2c000b70, parser_state=0x7ffff035b600) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:5836
#10 0x00000000015a1b6d in dispatch_command (thd=0x7fff2c000b70, com_data=0x7ffff035bd70, command=COM_QUERY)
    at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1447
#11 0x00000000015a099e in do_command (thd=0x7fff2c000b70) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/sql_parse.cc:1010
#12 0x00000000016e28f0 in handle_connection (arg=0x68e11d0) at /root/mysql5.7.14/percona-server-5.7.14-7/sql/conn_handler/connection_handler_per_thread.cc:312
#13 0x0000000001d7a514 in pfs_spawn_thread (arg=0x38484d0) at /root/mysql5.7.14/percona-server-5.7.14-7/storage/perfschema/pfs.cc:2188
#14 0x0000003f74807aa1 in start_thread () from /lib64/libpthread.so.0
#15 0x0000003f740e8bcd in clone () from /lib64/libc.so.6
AI 代码解读
相关实践学习
如何快速连接云数据库RDS MySQL
本场景介绍如何通过阿里云数据管理服务DMS快速连接云数据库RDS MySQL,然后进行数据表的CRUD操作。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
打赏
0
0
0
0
91
分享
相关文章
MySQL执行流程
本文介绍了MySQL的执行流程,分为server层和引擎层。server层包含连接器、查询缓存、解析器、预处理器、优化器等组件,负责SQL的接收、解析、优化及执行;引擎层负责数据的存储与读取。文章详细解释了各组件的功能,如连接器负责用户身份认证,查询缓存提高查询效率,解析器进行SQL的词法和语法分析,预处理器验证表和字段的存在性,优化器选择最优执行计划,最终由查询执行引擎完成查询并将结果返回给客户端。
MySQL执行流程
MySQL事务日志-Undo Log工作原理分析
事务的持久性是交由Redo Log来保证,原子性则是交由Undo Log来保证。如果事务中的SQL执行到一半出现错误,需要把前面已经执行过的SQL撤销以达到原子性的目的,这个过程也叫做"回滚",所以Undo Log也叫回滚日志。
MySQL事务日志-Undo Log工作原理分析
【MySQL基础篇】事务(事务操作、事务四大特性、并发事务问题、事务隔离级别)
事务是MySQL中一组不可分割的操作集合,确保所有操作要么全部成功,要么全部失败。本文利用SQL演示并总结了事务操作、事务四大特性、并发事务问题、事务隔离级别。
【MySQL基础篇】事务(事务操作、事务四大特性、并发事务问题、事务隔离级别)
MySQL进阶突击系列(04)事务隔离级别、AICD、CAP、BASE原则一直搞不懂? | 看这篇就够了
本文详细介绍了数据库事务的四大特性(AICD原则),包括原子性、隔离性、一致性和持久性,并深入探讨了事务并发问题与隔离级别。同时,文章还讲解了分布式系统中的CAP理论及其不可能三角关系,以及BASE原则在分布式系统设计中的应用。通过具体案例和图解,帮助读者理解事务处理的核心概念和最佳实践,为应对相关技术面试提供了全面的知识准备。
MySQL的事务隔离级别
【10月更文挑战第17天】MySQL的事务隔离级别
141 43
mysql事务特性
原子性:一个事务内的操作统一成功或失败 一致性:事务前后的数据总量不变 隔离性:事务与事务之间相互不影响 持久性:事务一旦提交发生的改变不可逆
MySQL事务隔离级别及默认隔离级别的设置
在数据库系统中,事务隔离级别是一个关键的概念,它决定了事务在并发执行时如何相互隔离。MySQL提供了四种事务隔离级别,每种级别都解决了不同的并发问题。本文将详细介绍这些隔离级别以及MySQL的默认隔离级别。
【深入了解MySQL】优化查询性能与数据库设计的深度总结
本文详细介绍了MySQL查询优化和数据库设计技巧,涵盖基础优化、高级技巧及性能监控。
12 0
数据库传奇:MySQL创世之父的两千金My、Maria
《数据库传奇:MySQL创世之父的两千金My、Maria》介绍了MySQL的发展历程及其分支MariaDB。MySQL由Michael Widenius等人于1994年创建,现归Oracle所有,广泛应用于阿里巴巴、腾讯等企业。2009年,Widenius因担心Oracle收购影响MySQL的开源性,创建了MariaDB,提供额外功能和改进。维基百科、Google等已逐步替换为MariaDB,以确保更好的性能和社区支持。掌握MariaDB作为备用方案,对未来发展至关重要。
59 3
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等