HomeMogDBMogDB StackUqbar
v2.1

Documentation:v2.1

Supported Versions:

MogDB 2.1.0

1. Version Description

MogDB version 2.1.0 was released on January 11, 2022. MogDB version 2.1.0 is further enhanced based on MogDB version 2.0 and incorporates the new features of openGauss 2.1.0.

Note: MogDB 2.1.0 is the Preview version, and the life cycle of this version is half a year.

2. New Features

2.1 Incorporate new features of openGauss 2.1.0

  • The stored procedure compatibility is enhanced.
  • The SQL engine capability is enhanced.
  • The Ustore storage engine is supported.
  • Segment-page storage is supported.
  • High availability is based on the Paxos distributed consistency protocol.
  • AI4DB and DB4AI competitiveness is continuously built.
  • The log framework and error codes are modified.
  • JDBC client load is balanced and read and write are isolated.
  • The CMake script compilation is supported.
  • The column-store table supports the primary key constraint and unique key constraint.
  • The jsonb data type is supported.
  • Automatic elimination of unique SQL statements is supported.
  • The UCE fault detection is supported.
  • The GB18030 character set is supported.
  • The standby server catch is optimized.
  • The client tool gsql supports automatic supplement of the readline command.
  • The dynamic data masking is supported.
  • The State Cryptography Administration (SCA) algorithms are supported.
  • The tamper-proof ledger database is supported.
  • The built-in role and permission management mechanism is supported.
  • The transparent encryption is supported.
  • The fully-encrypted database is enhanced.
  • The dblink is supported.
  • The Ubuntu system is supported.
  • The hash index is supported.
  • UPSERT supports subqueries.
  • The MIN/MAX function supports the IP address type.
  • The array_remove, array_replace, first, and last functions are added.
  • The Data Studio client tool adapts the kernel features.

2.2 Performance Optimization for x86 Architecture

Optimize the multi-core performance on x86 architecture. The performance of TPC-C under high concurrency is 1.5-5 times that of PostgreSQL 14. The main optimization points are:

  • Support NUMA binding
  • Unlocked WAL
  • Cache friendly data structure

2.3 Create and Rebuild Indexes Concurrently

Supports specifying the CONCURRENTLY option when executing create index and reindex index to create and rebuild indexes without blocking the execution of DML statements, improving index maintainability. Supports creating and rebuilding of indexes on ordinary tables and global indexes on partitioned tables concurrently.

Compared with ordinary index creation and rebuilding, creating and rebuilding concurrently may take longer to complete.

Indexes on column-store tables, local indexes on partitioned tables, and indexes on temporary tables do not support concurrent index creation and rebuilding.

Related Topics

2.4 Enhanced Oracle compatibility

2.4.1 Support for Orafce plugin

Note: Users need to download the plugin package and install it manually.

By integrating the orafce plugin, the following Oracle compatible syntax is supported:

  • SQL Queries
    • DUAL table
  • SQL Functions
    • Mathematical functions
      • BITAND
      • COSH
      • SINH
      • TANH
    • String functions
      • INSTR
      • LENGTH
      • LENGTHB
      • LPAD
      • LTRIM
      • NLSSORT
      • REGEXP_COUNT
      • REGEXP_INSTR
      • REGEXP_LIKE
      • REGEXP_SUBSTR
      • REGEXP_REPLACE
      • RPAD
      • RTRIM
      • SUBSTR
      • SUBSTRB
    • Date/time functions
      • ADD_MONTHS
      • DBTIMEZONE
      • LAST_DAY
      • MONTHS_BETWEEN
      • NEXT_DAY
      • ROUND
      • SESSIONTIMEZONE
      • SYSDATE
      • TRUNC
    • Data type formatting functions
      • TO_CHAR
      • TO_DATE
      • TO_MULTI_BYTE
      • TO_NUMBER
      • TO_SINGLE_BYTE
    • Conditional expressions
      • DECODE
      • LNNVL
      • NANVL
      • NVL
      • NVL2
    • Aggregate functions
      • LISTAGG
      • MEDIAN
    • Functions that return internal information
      • DUMP
  • SQL Operators
    • Datetime operator
  • Packages
    • DBMS_ALERT
    • DBMS_ASSERT
    • DBMS_OUTPUT
    • DBMS_PIPE
    • DBMS_RANDOM
    • DBMS_UTILITY
    • UTL_FILE

Related Topics

2.4.2 Support CONNECT BY Syntax

Provide Oracle-compatible connect by syntax, implement level data query control, and display levels, loops, starting levels, etc.

Provides an oracle-compatible level query function, which can display data content, data levels, paths, etc. in a tree-like structure according to the specified connection relationship, starting conditions, etc.

Specify the root row of the level query through the start with condition, and perform a recursive query based on these rows to obtain all sub-rows, sub-rows of sub-rows, etc.

The relationship between the parent row and the child row between the levels is specified by the connect by condition to determine all the child rows of each row that meet the condition.

If there is a connection, whether it is a connection statement, or in the from or where clause, the result set after the connection is obtained first, and then the level query is performed.

If there is a where filter condition in the statement, execute the level query first and then filter the result set, instead of filtering out unsatisfied rows and all its sub-rows.

You can view the level of the row through the level pseudo column, sys_connect_by_path to view the path from the root row to the row, and connect_by_root to view auxiliary functions such as the root row.

Related Topics

2.4.3 Updatable View

Supports updatable views. Users can perform Insert/Update/Delete operations on the view, and the update operation will directly affect the base table corresponding to the view.

Not all views can be updated. There must be a one-to-one correspondence between the rows in the view and the rows in the base table, that is, the content of the view cannot be created based on aggregates or window functions.

For a view connected by multiple tables, if the primary key (unique key) of a base table can be used as the primary key (unique key) of the view, the view also supports updating, and the update result applies to the base table from which the primary key is derived.

Related Topics

2.4.4 Alter Columns When Rebuilding View

When the view is rebuilt, it supports the operations of reducing columns and changing column names. This command is only valid for non-materialized views.

Related Topics

2.4.5 Support systimestamp Function

Returns the current system date and time of the server where the database is located, as well as time zone information.

Related Topics

2.4.6 Support sys_guid Function

The system generates and returns a 16-byte globally unique identifier based on the current time and machine code.

Related Topics

2.5 Support PostgreSQL Plugins

Note: Users need to download the plugin package and install it manually.

  • pg_repack: Through the trigger mechanism, it provides the function of rebuilding the table online, which is mainly used to reduce the size of the free space in the table online.
  • wal2json: Through the logical replication mechanism, continuous data changes are provided in the form of json, which are mainly used for heterogeneous replication and other situations.
  • pg_trgm: Implement the trgm word segmentation algorithm to achieve better full-text retrieval capabilities.
  • pg_prewarm: Pre-cache the specified data table in shared memory to speed up data access.
  • pg_bulkload: The data is directly loaded into the data file without going through the shared memory, which speeds up the batch import of the database.

2.6 Support Read Extensibility

Note: Comes with ShardingSphere 5.1.0 and later versions, which need to be downloaded and installed manually by the user.

MogDB supports read extensibility by integrating with ShardingSphere's Proxy.

  • Read and write transactions are automatically routed to the primary library for execution, and read-only transactions are automatically routed to the backup library for execution; in scenarios with higher read consistency requirements, read-only transactions can also be routed to the primary library for execution through hint control.

  • Support for automatic identification and configuration of read and write nodes, without the need to configure primary and secondary roles, and automatic discovery of the primary and secondary libraries in the configuration list.

  • Support for automatic identification of primary and backup roles after switching, with no additional operation required to automatically identify the new primary and backup roles and route them correctly.

  • Support automatic load balancing of backup nodes: when the backup library is down and recovered or when a new backup library is added, it will be automatically added to the read load balancing after the replication status of the backup library is normal.

2.7 Others

  • The nlssort function supports sorting by pinyin for the GBK character set of rare characters

    Related Topics: SELECT

  • ALTER SEQUENCE supports modification of increment

    Related Topics: ALTER SEQUENCE

  • For TIMESTAMP WITH TIME ZONE type, you can use TZH, TZM, TZD, TZR parameters in TO_CHAR to output time zone information

    Related Topics: Type Conversion Functions

2.8 Preview Features

Note: Preview features need to be enabled manually.

alter system set enable_poc_feature = on;
-- or
alter system set enable_poc_feature to on;
-- Or add ‘enable_poc_feature = on’ to the postgresql.conf file in the MogDB data directory
-- Take effect after restart

2.8.1 Row-store Table Compression

Supports specifying whether a row-store table (astore) is a compressed table when it is created. For a compressed row-store table, the system compresses the table data automatically to save storage space. When writing data to the compressed table, the system automatically selects the appropriate compression algorithm according to the characteristics of each column, and the user can also specify the compression algorithm used for each column directly.

There is a strong correlation between the actual compression ratio and the data content, and the compression ratio can reach 50% in the typical scenario, and the performance loss is less than 5% in the typical TPC-C model, the actual performance impact depends on the actual system load.

For the non-compressed table, you can also use Alter Table to change the table to a compressed table, subsequent new write data will be automatically compressed.

Related Topics

2.8.2 SubPartition

Support to create subpartition table, data automatically partition storage according to the partition mode, to improve the storage and query efficiency of large data volumes. The supported subpartition combinations include:

  • List-List
  • List-Range
  • List-Hash
  • Range-List
  • Range-Range
  • Range-Hash

Support querying a single Partition and SubPartition;

Supports partition pruning for Partition Key, SubPartition Key or their combined conditions to further optimize partition query efficiency;

Supports truncate and vacuum operations on partition tables or first-level partitions;

During Update operation, data movement across partitions is supported (Partition/SubPartition Key is not supported as List or Hash partition type);

Backup and restore of subpartition are supported.

Related Topics


3. Modified Defects

3.1 Incorporate openGauss 2.1.0 Modified Defects

  • I435UP An error is reported when the EXPLAIN statement is executed.
  • I44QS6 When the select get_local_active_session() limit 1 ; function is executed, the database breaks down.
  • I4566H After UPDATE GLOBAL INDEX is performed on a partition of a partitioned table, the query result is inconsistent with the master version.
  • I45822 An error occurs when the GPC global plan cache information is queried in the global temporary table.
  • I442TY Failed to recover to the timestamp specified by PITR.
  • I45T7A Remote backup is abnormal when the database is installed in environment variable separation mode.
  • I464G5 Failed to use gs_ctl build to rebuild a specified non-instance directory on a standby node. The error information is inconsistent.
  • I45TTB The foreign table is successfully created for the file type that is not supported by file_fdw, but no error is reported.
  • I491CN When the subnet mask of the network address of the cidr type is 32, an error is reported when the MAX function is called.
  • I496VN After a large number of Xlogs are stacked on the standby node, the archiving address is corrected. As a result, the archiving fails.
  • I49HRV When the standby node archiving is enabled, the standby node archiving is slow. After the switchover, the new primary node is abnormal.
  • I492W4 When operations related to the mysql_fdw and oracle_fdw foreign tables are performed on the database installed using the OM, a core dump occurs in the database.
  • I498QT In the maximum availability mode, when the synchronous standby parameter is ANY2 and the primary server is under continuous pressure, running the kill-9 command to stop one synchronous standby server causes transaction congestion on the primary server for 2s.
  • I49L15 Two standby nodes are enabled for archiving. After one node is scaled in and out, the archiving of the other node is abnormal.
  • I43MTG The developer guide does not contain information related to new functions.
  • I42YW8 The UPSERT subquery information is not supplemented.
  • I45WDH file_fdw does not support the fixed format. The related description needs to be deleted from the developer guide.
  • I484J0 The gs_initdb -T parameter is not verified, and the value is incorrect after being set according to the guide.
  • I471CS When pgxc_node_name contains hyphens (-), the database exits abnormally. If residual temporary tables are not cleared, automatic clearance and vacuum cannot be performed.
  • I40QM1 When gs_basebackup is executed, an exception occurs on the standby node. As a result, the gs_basebackup process is blocked and cannot exit.
  • I3RTQK The standby node fails to be backed up using gs_basebackup, and the message "could not fetch mot checkpoint info:, status:7" is displayed.

3.2 MogDB 2.1.0 Modified Defects

  • It prompts which doesn't support recovery_target_lsn when gs_probackup restores the database

  • Statement_history table cannot be cleaned up

  • Abnormal database downtime caused by schema cascade delete operation

  • \d in gsql cannot query the field information of the table or view corresponding to the synonym

  • The lengthb function does not support large object fields such as blob

  • After enabling sha256 authentication, the original md5 encrypted users can still successfully login through md5 authentication

  • The output of raise inside nested stored procedures in MogDB is too detailed

4. Compatibility

This version supports the following operating system and CPU architecture combinations.

OS CPU Architecture
CentOS 7.x X86_64 (Intel, AMD, Hygon, ZHAOXIN)
Redhat 7.x X86_64 (Intel, AMD, Hygon, ZHAOXIN)
openEuler 20.03LTS ARM (Kunpeng), X86_64 (Intel, AMD, Hygon, ZHAOXIN)
Kylin V10 ARM (Kunpeng), X86_64 (Intel, AMD, Hygon, ZHAOXIN)
UOS V20-D / V20-E ARM (Kunpeng), X86_64 (Intel, AMD, Hygon, ZHAOXIN)
UOS V20-A X86_64 (Intel, AMD, Hygon, ZHAOXIN)
Copyright © 2011-2024 www.enmotech.com All rights reserved.