asp.net 4.0网站开发实例教程,新闻发稿114,企业所得税是多少,jquery做的装修网站目录 1、存储引擎简介 1.1、查询建表语句#xff0c;默认存储引擎#xff1a;InnoDB 1.2、查看当前数据库支持的存储引擎 1.3、创建表#xff0c;并指定存储引擎 2、 存储引擎-InnoDB介绍 2.1、存储引擎特点 3、MyISAM存储引擎 4、Memory存储引擎 5、InnoDB、MyISAM、Memory… 目录 1、存储引擎简介 1.1、查询建表语句默认存储引擎InnoDB 1.2、查看当前数据库支持的存储引擎 1.3、创建表并指定存储引擎 2、 存储引擎-InnoDB介绍 2.1、存储引擎特点 3、MyISAM存储引擎 4、Memory存储引擎 5、InnoDB、MyISAM、Memory的区别 6、存储引擎的选择 1、存储引擎简介 1.1、查询建表语句默认存储引擎InnoDB -- 查询建表语句
show create table emp; 1.2、查看当前数据库支持的存储引擎 -- 查看当前数据库支持的存储引擎
show engines; 1.3、创建表并指定存储引擎 -- 创建表 my_myisam,并指定MYISAM存储引擎
create table my_myisam
(id int,name varchar(10)
) engine MyISAM;-- 创建表 my_memory,指定MEMORY存储引擎
create table my_memory
(id int,name varchar(10)
) engine MEMORY; 2、 存储引擎-InnoDB介绍 2.1、存储引擎特点 介绍InnoDB是一种兼顾高可靠性和高性能的通用存储引擎在MySQL 5.5之后InnoDB是默认的MySQL存储引擎。特点DML操作遵循ACID 原子性Atomicity、一致性Consistency、隔离性Isolation和持久性Durability模型支持 事务 行级锁提高并发访问性能支持 外键 FOREIGN KEY约束保证数据的完整性和正确性文件xxx.ibdxxx代表的是表名InnoDB引擎的每张表都会对应这样一个表空间文件存储该表的表结构frm、sdi、数据和索引。参数innodb_file_per_table 在InnoDB存储引擎中.ibd文件是表空间文件用于存储表的数据和索引。每个InnoDB表都有一个与之关联的.ibd文件除非该表被配置为使用共享表空间。.ibd文件通常包含表的元数据、数据和索引信息。 当InnoDB存储引擎的innodb_file_per_table配置选项被启用时每个InnoDB表都会有自己独立的.ibd文件。这样做的好处是可以更容易地管理单个表的大小和存储位置例如可以通过移动或删除.ibd文件来移动或删除表。 与.ibd文件相对应的是.frm文件它存储了表的元数据即表结构。而InnoDB的系统表空间文件通常命名为ibdata1、ibdata2等用于存储undo日志、插入缓冲区、锁信息等。 在某些情况下例如当表损坏或需要优化时可能需要直接操作.ibd文件。但是直接操作这些文件是危险的应该谨慎进行并在操作前备份相关数据。 show variables like innodb_file_per_table; C:\ProgramData\MySQL\MySQL Server 8.0\Data Microsoft Windows [版本 10.0.19045.3996]
(c) Microsoft Corporation。保留所有权利。C:\ProgramData\MySQL\MySQL Server 8.0\Data\mybatis002dexampleibd2sdi t_book.ibd
[ibd2sdi
,
{type: 1,id: 441,object:{mysqld_version_id: 80026,dd_version: 80023,sdi_version: 80019,dd_object_type: Table,dd_object: {name: t_book,mysql_version_id: 80026,created: 20231209065441,last_altered: 20231209065441,hidden: 1,options: avg_row_length0;encrypt_typeN;key_block_size0;keys_disabled0;pack_record1;stats_auto_recalc0;stats_sample_pages0;,columns: [{name: bid,type: 16,is_nullable: false,is_zerofill: false,is_unsigned: false,is_auto_increment: false,is_virtual: false,hidden: 1,ordinal_position: 1,char_length: 80,numeric_precision: 0,numeric_scale: 0,numeric_scale_null: true,datetime_precision: 0,datetime_precision_null: 1,has_no_default: true,default_value_null: false,srs_id_null: true,srs_id: 0,default_value: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,default_value_utf8_null: true,default_value_utf8: ,default_option: ,update_option: ,comment: ,generation_expression: ,generation_expression_utf8: ,options: interval_count0;,se_private_data: table_id1162;,engine_attribute: ,secondary_engine_attribute: ,column_key: 2,column_type_utf8: varchar(20),elements: [],collation_id: 255,is_explicit_collation: false},{name: bname,type: 16,is_nullable: true,is_zerofill: false,is_unsigned: false,is_auto_increment: false,is_virtual: false,hidden: 1,ordinal_position: 2,char_length: 80,numeric_precision: 0,numeric_scale: 0,numeric_scale_null: true,datetime_precision: 0,datetime_precision_null: 1,has_no_default: false,default_value_null: true,srs_id_null: true,srs_id: 0,default_value: ,default_value_utf8_null: true,default_value_utf8: ,default_option: ,update_option: ,comment: ,generation_expression: ,generation_expression_utf8: ,options: interval_count0;,se_private_data: table_id1162;,engine_attribute: ,secondary_engine_attribute: ,column_key: 1,column_type_utf8: varchar(20),elements: [],collation_id: 255,is_explicit_collation: false},{name: stuid,type: 16,is_nullable: true,is_zerofill: false,is_unsigned: false,is_auto_increment: false,is_virtual: false,hidden: 1,ordinal_position: 3,char_length: 80,numeric_precision: 0,numeric_scale: 0,numeric_scale_null: true,datetime_precision: 0,datetime_precision_null: 1,has_no_default: false,default_value_null: true,srs_id_null: true,srs_id: 0,default_value: ,default_value_utf8_null: true,default_value_utf8: ,default_option: ,update_option: ,comment: ,generation_expression: ,generation_expression_utf8: ,options: interval_count0;,se_private_data: table_id1162;,engine_attribute: ,secondary_engine_attribute: ,column_key: 4,column_type_utf8: varchar(20),elements: [],collation_id: 255,is_explicit_collation: false},{name: DB_TRX_ID,type: 10,is_nullable: false,is_zerofill: false,is_unsigned: false,is_auto_increment: false,is_virtual: false,hidden: 2,ordinal_position: 4,char_length: 6,numeric_precision: 0,numeric_scale: 0,numeric_scale_null: true,datetime_precision: 0,datetime_precision_null: 1,has_no_default: false,default_value_null: true,srs_id_null: true,srs_id: 0,default_value: ,default_value_utf8_null: true,default_value_utf8: ,default_option: ,update_option: ,comment: ,generation_expression: ,generation_expression_utf8: ,options: ,se_private_data: table_id1162;,engine_attribute: ,secondary_engine_attribute: ,column_key: 1,column_type_utf8: ,elements: [],collation_id: 63,is_explicit_collation: false},{name: DB_ROLL_PTR,type: 9,is_nullable: false,is_zerofill: false,is_unsigned: false,is_auto_increment: false,is_virtual: false,hidden: 2,ordinal_position: 5,char_length: 7,numeric_precision: 0,numeric_scale: 0,numeric_scale_null: true,datetime_precision: 0,datetime_precision_null: 1,has_no_default: false,default_value_null: true,srs_id_null: true,srs_id: 0,default_value: ,default_value_utf8_null: true,default_value_utf8: ,default_option: ,update_option: ,comment: ,generation_expression: ,generation_expression_utf8: ,options: ,se_private_data: table_id1162;,engine_attribute: ,secondary_engine_attribute: ,column_key: 1,column_type_utf8: ,elements: [],collation_id: 63,is_explicit_collation: false}],schema_ref: mybatis-example,se_private_id: 1162,engine: InnoDB,last_checked_for_upgrade_version_id: 0,comment: ,se_private_data: ,engine_attribute: ,secondary_engine_attribute: ,row_format: 2,partition_type: 0,partition_expression: ,partition_expression_utf8: ,default_partitioning: 0,subpartition_type: 0,subpartition_expression: ,subpartition_expression_utf8: ,default_subpartitioning: 0,indexes: [{name: PRIMARY,hidden: false,is_generated: false,ordinal_position: 1,comment: ,options: flags0;,se_private_data: id289;root4;space_id101;table_id1162;trx_id10390;,type: 1,algorithm: 2,is_algorithm_explicit: false,is_visible: true,engine: InnoDB,engine_attribute: ,secondary_engine_attribute: ,elements: [{ordinal_position: 1,length: 80,order: 2,hidden: false,column_opx: 0},{ordinal_position: 2,length: 4294967295,order: 2,hidden: true,column_opx: 3},{ordinal_position: 3,length: 4294967295,order: 2,hidden: true,column_opx: 4},{ordinal_position: 4,length: 4294967295,order: 2,hidden: true,column_opx: 1},{ordinal_position: 5,length: 4294967295,order: 2,hidden: true,column_opx: 2}],tablespace_ref: mybatis-example/t_book},{name: fk_book_stuid,hidden: false,is_generated: true,ordinal_position: 2,comment: ,options: flags0;,se_private_data: id290;root5;space_id101;table_id1162;trx_id10390;,type: 3,algorithm: 2,is_algorithm_explicit: false,is_visible: true,engine: InnoDB,engine_attribute: ,secondary_engine_attribute: ,elements: [{ordinal_position: 1,length: 80,order: 2,hidden: false,column_opx: 2},{ordinal_position: 2,length: 4294967295,order: 2,hidden: true,column_opx: 0}],tablespace_ref: mybatis-example/t_book}],foreign_keys: [{name: fk_book_stuid,match_option: 1,update_rule: 1,delete_rule: 1,unique_constraint_name: PRIMARY,referenced_table_catalog_name: def,referenced_table_schema_name: mybatis-example,referenced_table_name: t_stu,elements: [{column_opx: 2,ordinal_position: 1,referenced_column_name: sid}]}],check_constraints: [],partitions: [],collation_id: 255}
}
}
,
{type: 2,id: 106,object:{mysqld_version_id: 80026,dd_version: 80023,sdi_version: 80019,dd_object_type: Tablespace,dd_object: {name: mybatis-example/t_book,comment: ,options: autoextend_size0;encryptionN;,se_private_data: flags16417;id101;server_version80026;space_version1;statenormal;,engine: InnoDB,engine_attribute: ,files: [{ordinal_position: 1,filename: .\\mybatis002dexample\\t_book.ibd,se_private_data: id101;}]}
}
}
]C:\ProgramData\MySQL\MySQL Server 8.0\Data\mybatis002dexample 3、MyISAM存储引擎 介绍MyISAM是MySQL早期的默认存储引擎特点不支持事务不支持外键支持表锁不支持行锁访问速度快文件xxx.sdi存储表结构信息xxx.MYD存储数据xxx.MYI存储索引 https://www.json.cn/ 4、Memory存储引擎 介绍Memory引擎的表数据时存储在内存中的由于受到硬件问题、或断电问题的影响只能将这些表作为临时表或缓存使用。特点内存存放hash索引默认文件xxx.sdi存储表结构信息 5、InnoDB、MyISAM、Memory的区别 6、存储引擎的选择 InnoDB用于大多数业务场景MyISAM用于业务系统中的日志相关的数据电商当中足迹和评论相关的数据已经被 MongoDB 取代MEMORY用于缓存已经被 redis 取代