发布日期:. 2022年12月27日
        添加 guc 参数 lightdb_arch_mode,有两个值。
        classic 表示当前数据系统不是分布式架构。
        dist 表示当前数据系统是分布式架构,
        在此架构下,使用 create table 创建的表默认为分布式表。
        详情请参见
        兼容性。
      
        lt_check 是一个 LightDB 检查 sha256sum 的工具。
        确保 LightDB 安装目录中的文件完整。
        详情请参见
        lt_check。
      
新增检测无条件和无分页查询的功能。 详情请参见 LightDB DML 规范检测。
在以下场景中,会打印提示消息,指示用户应该使用分页/where:
            select 语句未指定 limit、offset 或 where
            。
          
            update 语句未指定 where。
          
            delete 语句未指定 where。
          
例如:
lightdb@lt_test=# set lightdb_best_practice_level to 'warn'; SET lightdb@lt_test=# set lightdb_best_practice_mode to 'no_paging'; SET lightdb@lt_test=# create table dc_np_t1(c_a int primary key, c_b varchar, gmt_create timestamp null, gmt_modified timestamp null); CREATE TABLE lightdb@lt_test=# SELECT * from dc_np_t1; WARNING: LightDB DML check warning! select sql not where/limit/offset clause! c_a | c_b | gmt_create | gmt_modified -----+-----+------------+-------------- (0 rows)
检查清单中的每个项目的正确性。 它可用于检测操作系统参数、LightDB 安装文件 sha256sum、LightDB 版本号等是否存在风险。 如果存在风险,则提供风险报告。 详情请参见 check_list。
        支持在 Oracle 和 Postgres 模式下均可使用 database() 函数。
        database() 函数位于扩展 ltfce 中。
        详情请参见
        ltfce。
      
例如:
lightdb@postgres=# select database(); database ---------- public (1 row) lightdb@postgres=# \c test_createdb_oracle You are now connected to database "test_createdb_oracle" as user "lightdb". lightdb@test_createdb_oracle=# show lightdb_dblevel_syntax_compatible_type; lightdb_dblevel_syntax_compatible_type ---------------------------------------- Oracle (1 row) lightdb@test_createdb_oracle=# select database(); database ---------- public (1 row)
优化归档日志清理。 详情请参见 lightdb_archive_dir。
优化归档日志清理。 详情请参见 lightdb_archive_dir。
            在启动LightDB时,当archive_mode打开时,请检查archive_command
            、lightdb_archive_retion_size和lightdb_archive_dir。
          
调整参数:
                  lightdb_archive_retion_size只能在启动时设置。
                
                  lightdb_archive_dir只能在启动时设置。
                
            确保在归档中删除的WAL日志比lt_wal目录中保留的日志数少。
          
        添加walminer扩展来挖掘WAL日志的所有有用信息,以提供LightDB数据恢复支持。
        数据库日志级别配置需要大于minimal。请参阅
        lt_walminer。
      
支持单实例多模式。请参阅 CREATE DATABASE。
例如:
lightdb@postgres=# create database test_createdb_oracle with lightdb_syntax_compatible_type oracle; CREATE DATABASE lightdb@postgres=# \c test_createdb_oracle You are now connected to database "test_createdb_oracle" as user "lightdb". lightdb@test_createdb_oracle=# show lightdb_dblevel_syntax_compatible_type; lightdb_dblevel_syntax_compatible_type ---------------------------------------- Oracle (1 row)
        添加lightdb_aborted_rollback参数,以支持在事务中报告当前语句的错误并回滚整个事务。请参阅
        lightdb_aborted_rollback。
      
在添加此功能之前,例如:
lightdb@lt_test=# begin;
BEGIN
lightdb@lt_test=*# create table aborted_rollback(name varchar(100));
CREATE TABLE
lightdb@lt_test=*# insert into aborted_rollback1 values(1);
ERROR:  relation "aborted_rollback1" does not exist
LINE 1: insert into aborted_rollback1 values(1);
                    ^
lightdb@lt_test=!# insert into aborted_rollback1 values(1);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
lightdb@lt_test=!# commit;
ROLLBACK
添加此功能后,例如:
lightdb@lt_test=# set lightdb_aborted_rollback to on;
SET
lightdb@lt_test=# begin;
BEGIN
lightdb@lt_test=*# create table aborted_rollback(name varchar(100));
CREATE TABLE
lightdb@lt_test=*# insert into aborted_rollback1 values(1);
ERROR:  relation "aborted_rollback1" does not exist
LINE 1: insert into aborted_rollback1 values(1);
                    ^
ERROR:  current transaction is aborted, "insert into aborted_rollback1 values(1);" causes transaction rollback.
        解决unknown类型参与运算时的类型不匹配问题。请参阅
        optional。
      
例如:
lightdb@lt_test=# select '1'+1;
 ?column? 
----------
        2
(1 row)
Note: Operator overloading may affect the return value of the expression. For example, for an expression such as select '1' * 1, it previously returned an int type, but now it returns a numeric type.
        优化lt_cron进程的问题,减少CPU使用率。请参阅
        lt_cron。
      
        添加了一个选项table_exists_action,用于告诉lt_restore如果正在尝试创建的表已经存在该怎么办。
        table_exists_action有四个选项:skip、append、truncate
        或replace。请参阅
        lt_restore。
      
        lt_upgrade 支持程序包升级。
        请查看
        lt_upgrade。
      
            lt_upgrade_check 支持程序包跨版本升级检查。
            请查看
            lt_upgrade_check。
          
语句级回滚优化,此特性在Oracle和MySQL两种模式下都支持。 启用了语句级回滚,性能损失约为5%。 请查看 lt_statement_rollback_enable。
        ltdts_ora 是一种用于将Oracle数据同步到LightDB的数据同步工具。
        请查看
        ltdts_ora。
      
        ltdts_mysql 是一种用于将MySQL|MariaDB数据同步到LightDB的数据同步工具。
        请查看
        ltdts_mysql。
      
        lt_patch 已进行增强,并添加了下面展示的许多新参数。
        请查看
        lt_patch。
      
支持自动执行SQL脚本。
            添加了 lt_patch 表以保存补丁信息。
            补丁描述信息中添加了 apply_type 和 apply_version 属性。
          
添加了补丁依赖目录。
解决了补丁成功进程中的半状态问题。
更为严格的验证和其他细节优化。
        使用 lt_dump 和 lt_restore 工具实现分布式集群的备份和恢复:
      
            使用 lt_dump 工具实现分布式集群的备份。
            请查看
            lt_distributed_dump。
          
            使用 lt_restore 工具实现分布式集群的恢复。
            请查看
            lt_distributed_restore。
          
        使用 lt_probackup 工具实现分布式集群的备份和恢复。
        请查看
        lt_distributed_probackup。
      
        Oracle 兼容性增强,并添加了下面展示的许多新功能。
      
从普通表在线更改为分区表。 请查看 ALTER TABLE。
例如:
lightdb@test_createdb_oracle=# CREATE TABLE lt_oracle_partition_range5
lightdb@test_createdb_oracle-# (
lightdb@test_createdb_oracle(# a int,
lightdb@test_createdb_oracle(# b float,
lightdb@test_createdb_oracle(# c date,
lightdb@test_createdb_oracle(# d timestamp
lightdb@test_createdb_oracle(# )PARTITION BY RANGE (c)
lightdb@test_createdb_oracle-# (
lightdb@test_createdb_oracle(# PARTITION p1 VALUES LESS THAN(to_date('2022-01-01', 'yyyy-mm-dd')),
lightdb@test_createdb_oracle(#     PARTITION p2 VALUES LESS THAN(to_date('2022-02-01', 'yyyy-mm-dd')),
lightdb@test_createdb_oracle(#     PARTITION p3 VALUES LESS THAN(to_date('2022-03-01', 'yyyy-mm-dd'))
lightdb@test_createdb_oracle(# );
CREATE TABLE
lightdb@test_createdb_oracle=# 
lightdb@test_createdb_oracle=# \d+ lt_oracle_partition_range5
                            Partitioned table "public.lt_oracle_partition_range5"
 Column |            Type             | Collation | Nullable | Default | Storage | Stats target | Description 
--------+-----------------------------+-----------+----------+---------+---------+--------------+-------------
 a      | integer                     |           |          |         | plain   |              | 
 b      | double precision            |           |          |         | plain   |              | 
 c      | date                        |           |          |         | plain   |              | 
 d      | timestamp without time zone |           |          |         | plain   |              | 
Partition key: RANGE (c)
Partitions: lt_oracle_partition_range5_1_prt_p1 FOR VALUES FROM (MINVALUE) TO ('2022-01-01'),
            lt_oracle_partition_range5_1_prt_p2 FOR VALUES FROM ('2022-01-01') TO ('2022-02-01'),
            lt_oracle_partition_range5_1_prt_p3 FOR VALUES FROM ('2022-02-01') TO ('2022-03-01')
            支持 Oracle 的 cardinality 和 ordered_predicates 提示。请参见
            lt_hint_plan。
          
例如:
lightdb@postgres=# explain select /*+ cardinality(b 1000)use_nl(a b) leading(a b)*/* from t1 a , t2 b where a.key1=b.key1;
                                    QUERY PLAN                                    
----------------------------------------------------------------------------------
 Nested Loop  (cost=0.15..433.43 rows=1000 width=16)
   ->  Seq Scan on t1 a @"lt#0"  (cost=0.00..32.60 rows=2260 width=8)
   ->  Index Scan using t2_pkey on t2 b @"lt#0"  (cost=0.15..0.18 rows=1 width=8)
         Index Cond: (key1 = a.key1)
(4 rows)
lightdb@postgres=# EXPLAIN (COSTS false) select /*+ordered_predicates*/* from test1 where mod(key1,10)=2 and key2=2;
                   QUERY PLAN                   
------------------------------------------------
 Seq Scan on test1 @"lt#0"
   Filter: ((mod(key1, 10) = 2) AND (key2 = 2))
(2 rows)
修改表的时候,可以交换默认值和非空属性的位置。 请参见 ALTER TABLE。
例如:
lightdb@lt_test=# create table aborted_rollback(name varchar(100)); CREATE TABLE lightdb@lt_test=# alter table aborted_rollback modify name text not null default 1; ALTER TABLE
            新增导出工具 ltuldr(与 Oracle 的 sqluldr2 工具兼容)。
            请参见
            ltuldr。
          
            支持 connect by 层次查询。
            请参见
            CONNECT BY Clause。
          
例如:
lightdb@test_createdb_oracle=# SELECT id, manager_id from t_tab CONNECT BY prior id = manager_id order by id; id | manager_id ----+------------ 1 | 0 2 | 1 2 | 1 3 | 2 3 | 2 3 | 2 (6 rows)
            orafce 的改进,详情请参见
            orafce。
          
                varchar2 计算字符长度。
              
                支持 raw 类型。
              
例如:
lightdb@test_createdb_oracle=# create table test_type(name varchar2(100), id raw);
CREATE TABLE
lightdb@test_createdb_oracle=# \d test_type
                Table "public.test_type"
 Column |     Type      | Collation | Nullable | Default 
--------+---------------+-----------+----------+---------
 name   | varchar2(100) |           |          | 
 id     | raw           |           |          |