


The content of this article is about the difference between innoDB and myisam in the eighth PHP interview question. It has a certain reference value. Now I share it with you. Friends in need can refer to it
InnoDB:
Support transaction processing, etc.
Read without locking
Support foreign keys
Support row locks
Do not support FULLTEXT type indexes
Do not save the specific number of rows in the table, scan the table to calculate the number of rows How many rows
When DELETE a table, it is deleted row by row
InnoDB stores data and indexes in the table space
Can be directly copied and used across platforms
InnoDB must contain an index of the AUTO_INCREMENT type field
The table is difficult to be compressed
MyISAM:
Transactions are not supported, rollback will cause incomplete rollback, and are not atomic
Does not support foreign keys
Does not support foreign keys
Support full-text search
Save the specific number of rows in the table. Without where, the number of saved rows will be returned directly
When DELETE the table, first drop the table and then rebuild the table
MyISAM table is stored in three files . The frm file stores table definitions. The data file is MYD (MYData). The index file is an extension of MYI (MYIndex)
It is difficult to copy directly across platforms
In MyISAM, the AUTO_INCREMENT type field can be used to create a joint index
The table can be compressed
Select:
Because MyISAM It is relatively simple, so it is better than InnoDB in terms of efficiency. If the system reads more and writes less. Low atomicity requirements. Then MyISAM is the best choice. And MyISAM recovery speed is fast. Can be directly overwritten and restored with backup.
If the system reads less and writes more, especially when concurrent writes are high. InnoDB is the first choice.
Both types have their own advantages and disadvantages. Which one you choose depends entirely on your actual type.
InnoDB:
Support transaction processing, etc.
Read without locking
Support foreign keys
Support row locks
Does not support FULLTEXT type indexes
Does not save the table The specific number of rows, scan the table to calculate how many rows there are
When DELETE the table, it is deleted row by row
InnoDB stores the data and indexes in the table space
Cross-platform can be directly copied and used
InnoDB The index of the AUTO_INCREMENT type field must be included
The table is difficult to be compressed
MyISAM:
Does not support transactions, rollback will cause incomplete rollback, and is not atomic
Does not support external Key
Does not support foreign keys
Supports full-text search
Save the specific number of rows in the table. Without where, the number of saved rows will be returned directly
When DELETE the table, first drop the table, and then rebuild the table
MyISAM tables are stored in three files. The frm file stores table definitions. The data file is MYD (MYData). The index file is an extension of MYI (MYIndex)
It is difficult to copy directly across platforms
In MyISAM, the AUTO_INCREMENT type field can be used to create a joint index
The table can be compressed
Select:
Because MyISAM It is relatively simple, so it is better than InnoDB in terms of efficiency. If the system reads more and writes less. Low atomicity requirements. Then MyISAM is the best choice. And MyISAM recovery speed is fast. Can be directly overwritten and restored with backup.
If the system reads less and writes more, especially when concurrent writes are high. InnoDB is the first choice.
Both types have their own advantages and disadvantages. Which one you choose depends entirely on your actual type.
Related recommendations:
php interview question 7: How to configure nginx load balancing
php interview question 6: memcache and redis Difference
php interview question 5: How nginx calls php and the role and working principle of php-fpm
The above is the detailed content of PHP interview question 8: The difference between innoDB and myisam. For more information, please follow other related articles on the PHP Chinese website!

php把负数转为正整数的方法:1、使用abs()函数将负数转为正数,使用intval()函数对正数取整,转为正整数,语法“intval(abs($number))”;2、利用“~”位运算符将负数取反加一,语法“~$number + 1”。

php判断有没有小数点的方法:1、使用“strpos(数字字符串,'.')”语法,如果返回小数点在字符串中第一次出现的位置,则有小数点;2、使用“strrpos(数字字符串,'.')”语句,如果返回小数点在字符串中最后一次出现的位置,则有。

在PHP中,可以利用implode()函数的第一个参数来设置没有分隔符,该函数的第一个参数用于规定数组元素之间放置的内容,默认是空字符串,也可将第一个参数设置为空,语法为“implode(数组)”或者“implode("",数组)”。

InnoDB是一个将表中的数据存储到磁盘上的存储引擎,所以即使关机后重启我们的数据还是存在的。而真正处理数据的过程是发生在内存中的,所以需要把磁盘中的数据加载到内存中,如果是处理写入或修改请求的话,还需要把内存中的内容刷新到磁盘上。而我们知道读写磁盘的速度非常慢,和内存读写差了几个数量级,所以当我们想从表中获取某些记录时,InnoDB存储引擎需要一条一条的把记录从磁盘上读出来么?InnoDB采取的方式是:将数据划分为若干个页,以页作为磁盘和内存之间交互的基本单位,InnoDB中页的大小一般为16

InnoDB是MySQL的数据库引擎之一,现为MySQL的默认存储引擎,为MySQL AB发布binary的标准之一;InnoDB采用双轨制授权,一个是GPL授权,另一个是专有软件授权。InnoDB是事务型数据库的首选引擎,支持事务安全表(ACID);InnoDB支持行级锁,行级锁可以最大程度的支持并发,行级锁是由存储引擎层实现的。

去除方法:1、使用substr_replace()函数将首位数字替换为空字符串即可,语法“substr_replace($num,"",0,1)”;2、用substr截取从第二位数字开始的全部字符即可,语法“substr($num,1)”。

一、回退重新装mysql为避免再从其他地方导入这个数据的麻烦,先对当前库的数据库文件做了个备份(/var/lib/mysql/位置)。接下来将Perconaserver5.7包进行了卸载,重新安装原先老的5.1.71的包,启动mysql服务,提示Unknown/unsupportedtabletype:innodb,无法正常启动。11050912:04:27InnoDB:Initializingbufferpool,size=384.0M11050912:04:27InnoDB:Complete

1.Mysql的事务隔离级别这四种隔离级别,当存在多个事务并发冲突的时候,可能会出现脏读,不可重复读,幻读的一些问题,而innoDB在可重复读隔离级别模式下解决了幻读的一个问题,2.什么是幻读幻读是指在同一个事务中,前后两次查询相同范围的时候得到的结果不一致如图,第一个事务里面,我们执行一个范围查询,这个时候满足条件的数据只有一条,而在第二个事务里面,它插入一行数据并且进行了提交,接着第一个事务再去查询的时候,得到的结果比第一次查询的结果多出来一条数据,注意第一个事务的第一次和第二次查询,都在同


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft
