This topic describes other specifications related to OceanBase Database.
DataX specifications
After data is exported by using DataX, split the data into multiple files, and then import the data to the database in batches. The size of each file should not exceed 1 GB.
Others
The
FORCE INDEX,IGNORE INDEX,STRAIGHT_JOIN, andSQL_NO_CACHEkeywords are not supported in a production environment.Complex statements such as
BEGIN...END,LOOP...END LOOP,REPEAT...UNTIL...END REPEAT, andWHILE...DO...END WHILEare not supported.Note
Complex logic should be handled in applications to avoid writing complex SQL statements.
Left-side wildcard matching or full wildcard matching is not allowed in search conditions.
Note
In SQL queries that use the LIKE statement, use the leftmost prefix matching mode.
A partitioned table must have a partitioning key. Do not scan all partitions without using the partitioning key.
We recommend that you join no more than three tables.
In a multi-table join query, select the table with the smallest result set as the driving table.
We recommend that you rewrite SQL statements with nested subqueries into sequential table join statements.
Do not perform multi-table joins in the
INSERT,UPDATE,DELETE, orREPLACEstatement.Use covering indexes to avoid table relookups.
Use custom functions, types, and stored procedures sparingly.
or judgments such as the statement, which consumes a large amount of performance and takes a long time to execute. This will cause a decline in system concurrency performance. If there is an arithmetic operation in the stored procedure, it will also cause serious performance problems.Note
Stored procedures are not conducive to locating problems and have poor portability. Additionally, from a performance perspective, SQL in stored procedures often involves multiple tables.
Use non-logical conditions such as
!=,<>, orNOTsparingly.Use aggregation functions sparingly.
Avoid the
INoperation. If you must use a subquery that contains theINkeyword, rewrite it into aJOINstatement. If you must use theINkeyword, ensure that the number of constants in theIN listdoes not exceed 100.Use the
WHEREclause or theLIMITclause in a statement. Otherwise, the database scans the entire table.Control the size of intermediate result sets.
Note
In queries that contain the
distinct,order by, orgroup byclause, the size of intermediate result sets must not exceed 10,000 rows. If you need to sort or group result sets that contain more than 10,000 rows, implement the sorting or grouping in applications.The number of hash partitions should be a power of 2. Otherwise, data is unevenly distributed among partitions.
We recommend that you do not use full-text search.
We recommend that you do not use the event
EVENTfeature.Do not use or operate on the OceanBase database or the test database in your programs. You can create only one test database, and its name must start with the test prefix.
Do not use user-defined variables in OceanBase databases.
Do not perform real-time business statistics or summary calculations in databases. You can export the data and then perform the statistics or summary calculations by using another tool or in the offline backup database.
Avoid using the
HAVINGclause.The
HAVINGclause is used to filter data after theGROUP BYclause sorts data, whereas theWHEREclause is used to filter data during processing. Therefore, theWHEREclause can eliminate a large amount of sorting and I/O time.