mysql 源码分析.ppt

上传人:s****8 文档编号:67571664 上传时间:2022-12-25 格式:PPT 页数:26 大小:1.10MB
返回 下载 相关 举报
mysql 源码分析.ppt_第1页
第1页 / 共26页
mysql 源码分析.ppt_第2页
第2页 / 共26页
点击查看更多>>
资源描述

《mysql 源码分析.ppt》由会员分享,可在线阅读,更多相关《mysql 源码分析.ppt(26页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。

1、1MySQL展示功能与源码对应丹臣/赵林2010-10-12提 纲Mysql客户端的一些展示命令与源码Mysqld服务端的展示命令与源码Mysql复制状态信息的查看命令与源码Innodb monitor信息展示与源码客户端status命令客户端status命令client/Mysql.cc源文件客户端status命令这部份信息来自于哪里?Sql_parse.cc源程序中的dispatch_command函数服务端常用的一些命令show processlistshow authorsshow contributorsshow create table/viewshow create databa

2、seshow privileges神奇的information_schemaShow processlistshow processlist三个步骤:1.先定义id,user,Host,db,Command,Time,State,Info字段信息到field_list变量中,并通过protocol-send_fields发送到客户端2.锁定线程总数,遍历所有线程,将所有线程的信息填入thread_infos链表变量中3.向客户端传送thread_infos链表中的数据,通过protocol-write()完成写操作实际中遇到的问题:如果一个mysql线程很多,那么大部份的sleep线程将干扰查

3、看processlist列表Show authorsshow contributorsshow create table/viewshow create databaseshow privilegesinformation_schema中的对象schema_information中的对象st_schema_table结构体定义show table statusTable的各种信息,都在tables_fields_info数组里定义义,Name,Engine,Version,Row_format,Rows,Avg_row_lenght,Data_length 等等show table statu

4、s再看ST_SCHEMA_TABLE schema_tables关于tables的定义表的名字:TABLES表结构的定义:tables_fields_info表的创建函数:create_schema_table填冲数据函数:by function get_all_tables and get_schema_tables_recordMySQL复制的常用命令show slave status;show master status;show slave statussql/Slave.cc源文件如何把一台mysql做成多台master的slave?show master statussql/Sql

5、_repl.cc源文件Show innodb statusshow innodb statussrv_printf_innodb_monitorINNODB MONITOR OUTPUTsrv_print_master_thread_info(file)注解:BACKGROUND THREADsync_print(file)注解:SEMAPHORESlock_print_info_summary()汇总事务信息lock_print_info_all_transactions()每个事务的信息注解:TRANSACTIONSos_aio_print(file);注解:FILE I/Oibuf_pr

6、int(file)/insert bufferha_print_info(file)/hash table注解:INSERT BUFFER AND ADAPTIVE HASH INDEXtrx_sys_structtrx_purge_structlog_print(file)注解:LOGlog_structbuf_print_io(file)注解:BUFFER POOL AND MEMORYbuf_pool_structROW OPERATIONS(根据全局变量值计算)ibuf_structhash_table_structos_aio_array_struct/*The asynchrono

7、us i/o array structure*/sync_array_print_infosync_print_wait_info/*Synchronization array*/sync_array_struct源文件位置:storage/innodb_plugin/srv/srv0srv.cInnodb monitor信息展示与源码.srv/Srv0srv.c源文件中的srv_monitor_thread主函数INNODB TABLESPACE and TABLE MONITOR OUTPUTdict_table_print_low,dict_update_statistics_low,dict_col_print_low,dtype_print收集表与索引统计数据Follow me团队blog:http:/个人blog:http:/Twitter:http:/

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 生活常识

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知得利文库网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号-8 |  经营许可证:黑B2-20190332号 |   黑公网安备:91230400333293403D

© 2020-2023 www.deliwenku.com 得利文库. All Rights Reserved 黑龙江转换宝科技有限公司 

黑龙江省互联网违法和不良信息举报
举报电话:0468-3380021 邮箱:hgswwxb@163.com