I discovered a magical parameter today: -site:xxxx.net
1. Selection of storage engine (table type)
1. Introduction to storage engine
The difference from most relational databases is that MySQL has the concept of a storage engine, which can be used for different purposes. You can choose the most appropriate storage engine according to your storage needs. The plug-in storage engine in MySQL is a major feature. Users can choose how to store, whether to index, and whether to use transactions according to the needs of the application. Hehe, you can also adapt the storage engine that is most suitable for your business according to the business environment.
Oracle sensed business opportunities, acquired MySQL, and has since then had an enterprise version (commercial support). The community version is still available for free download. Another great charm is also because of open source, the community is highly active and everyone can contribute. Next, we will introduce several commonly used storage engines. There is no distinction between good and bad storage engines. There is only one that is more suitable for the corresponding production business environment.
The storage engines supported in MySQL5.0 are FEDERATED, MRG_MYISAM, MyISAM, BLACKHOLE, CSV, MEMORY, ARCHIVE, NDB Cluster, BDB, EXAMPLE, InnoDB (the default storage engine after MySQL5.5 and MariaDB10.2), PERFORMANCE_SCHEMA (unconventional storage data engine). The following is a comparison of the storage engines supported by MySQL and MariaDB. It can be seen that MariaDB has added the Aria engine:
View storage engine
Enter show engines\G;
through the character interface that comes with MySQL login, or use tools that support MySQL query, such as SQLyog, phpMyAdmin, MySQL workbench, etc. to query supported engines. Only some of them are shown here:
[test@cnwangk ~]$ mysql -uroot -p Enter password: mysql> show engines\G;*************************** 2. row *************************** Engine: MRG_MYISAM Support: YES Comment: Collection of identical MyISAM tablesTransactions: NO XA: NO Savepoints: NO*************************** 3. row *************************** Engine: MyISAM Support: YES Comment: MyISAM storage engineTransactions: NO XA: NO Savepoints: NO*************************** 6. row *************************** Engine: MEMORY Support: YES Comment: Hash based, stored in memory, useful for temporary tablesTransactions: NO XA: NO Savepoints: NO*************************** 8. row *************************** Engine: InnoDB Support: DEFAULT Comment: Supports transactions, row-level locking, and foreign keysTransactions: YES XA: YES Savepoints: YES9 rows in set (0.00 sec)
Function description:
Engine: engine name (description);
Support: current version Whether the database supports this storage engine, YES: supported, NO: not supported; Supports transactions, row-level locking, and foreign keys, I personally translate this sentence: support transactions, row-level Locks and foreign keys;
Comment: A detailed description of the storage engine, such as whether the engine supports transactions and foreign keys;
-
Transactions: A description of whether the storage engine supports transactions, YES: supported, NO: not supported;
XA: whether it meets the XA specification. The XA specification is an open group specification for distributed transaction processing (DTP). YES: Support, NO: Not supported;
Savepoints: Literally means save points, whether the control of things is supported, YES: Supported, NO: Not supported.
Beep quietly, if you can read and understand some official English documents, this will help you further understand the MySQL storage engine and develop the ability to read source code or documents.
By the way, I would like to mention MariaDB, the sister of MySQL. In MariaDB, the forked version of MySQL, the new engine Aria was used before 10.2. The default storage engine used after MariaDB 10.2 is also InnoDB, which is enough to show the excellence of the InnoDB storage engine. MariaDB's API and protocol are compatible with MySQL, and some additional features have been added to support local non-blocking operations and progress reporting. This means that all connectors, libraries and applications that use MySQL will also work with MariaDB. On this basis, due to concerns about a more closed software project of Oracle MySQL, Linux distributions such as Fedora have replaced MySQL with MariaDB in the latest version, and the servers of the Wikimedia Foundation have also used MariaDB instead of MySQL.
MainSeveral storage engines that need to be understood:
MyISAM
InnoDB
MEMORY
MERGE
The following will focus on introducing several commonly used storage engines that I have recently learned from reading books, comparing the differences between each storage engine, and helping us understand how to use different storage engines. For more details, please refer to MySQL's official documentation.
2. Features of some storage engines
Storage engine/support features | Storage restrictions | Transaction security | Lock mechanism | B-tree index | Hash index | Full-text index | Cluster index | Data cache | Index cache | Data can be compressed | Space usage | Memory usage | Batch insertion speed | Foreign key support |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
MyISAM | has | support |
##Support |
Support | Low | Low | High | |||||||
Support | Row lock | Support | Support (5.6) | SupportSupport | Support | High | HighLow | Support | MEMORY | |||||
Table lock | supportsupport | Support | SupportN/A | MEDIUMHIGH |
##MERGE |
|||||||||
##Table lock | Support |
##Support |
Low |
High |
##NDB | has |
||||||||
row lock | support |
##Support |
Support |
High | 高 |
The above is the detailed content of How to understand MySQL storage engine. For more information, please follow other related articles on the PHP Chinese website!

InnoDBBufferPool reduces disk I/O by caching data and indexing pages, improving database performance. Its working principle includes: 1. Data reading: Read data from BufferPool; 2. Data writing: After modifying the data, write to BufferPool and refresh it to disk regularly; 3. Cache management: Use the LRU algorithm to manage cache pages; 4. Reading mechanism: Load adjacent data pages in advance. By sizing the BufferPool and using multiple instances, database performance can be optimized.

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

MySQL is worth learning because it is a powerful open source database management system suitable for data storage, management and analysis. 1) MySQL is a relational database that uses SQL to operate data and is suitable for structured data management. 2) The SQL language is the key to interacting with MySQL and supports CRUD operations. 3) The working principle of MySQL includes client/server architecture, storage engine and query optimizer. 4) Basic usage includes creating databases and tables, and advanced usage involves joining tables using JOIN. 5) Common errors include syntax errors and permission issues, and debugging skills include checking syntax and using EXPLAIN commands. 6) Performance optimization involves the use of indexes, optimization of SQL statements and regular maintenance of databases.

MySQL is suitable for beginners to learn database skills. 1. Install MySQL server and client tools. 2. Understand basic SQL queries, such as SELECT. 3. Master data operations: create tables, insert, update, and delete data. 4. Learn advanced skills: subquery and window functions. 5. Debugging and optimization: Check syntax, use indexes, avoid SELECT*, and use LIMIT.

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

SQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA


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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Dreamweaver CS6
Visual web development tools