MySQL Compatibility Overview
This chapter compares the M-compatible mode in GaussDB with MySQL 5.7. Only compatibility features added later than GaussDB Kernel 505.2 are described. You are advised to view the specifications and restrictions of the features in Developer Guide.
GaussDB is compatible with MySQL in terms of data types, SQL functions, and database objects.
The execution plan, optimization, and EXPLAIN result in GaussDB are different from those in MySQL.
The underlying framework implementation of the GaussDB is different from that of MySQL. Therefore, there are still some differences between GaussDB and MySQL.
The underlying architecture of GaussDB is different from that of MySQL. Therefore, the query performance of schemas with the same name as MySQL under information_schema and m_schema may be different. For details, see "Schema" in M-Compatibility Developer Guide. For example, the execution of the count function cannot be optimized. The time consumed by the SELECT * and SELECT COUNT(*) statements is similar.
Database and Schema Design
MySQL data objects include database, table, index, view, trigger, and proc. The mapping relationship between MySQL object layers and GaussDB is from top to bottom and one-to-many, as shown in the following figure.
- In MySQL, database and schema are synonyms. In GaussDB, a database can have multiple schemas. In this feature, each database in MySQL is mapped to a schema in GaussDB.
- In MySQL, an index belongs to a table. In GaussDB, an index belongs to a schema. As a result, an index name must be unique in a schema in GaussDB and must be unique in a table in MySQL. This difference will be retained as a current constraint.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot