Release date: 2022-12-27
Add the guc parameter lightdb_arch_mode
, and there are two values.
classic
means that the current data system is not a distributed architecture.
dist
means that the current data system is a distributed architecture,
under this architecture, the table created with create table
defaults to a distributed table.
see Compatibility.
lt_check
is a LightDB check sha256sum tool.
Ensure that the files in the LightDB installation directory are complete.
see lt_check.
Added detection for unconditional and pageless queries. see LightDB DML Specification Check.
In the following scenarios, a prompt message is printed indicating that the user should use pagination/where:
select
does not specify limit
, offset
or where
.
update
does not specify where
.
delete
does not specify where
.
for example:
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)
Check the correctness of each item in the checklist. It can be used to detect whether there are risks in operating system parameters, LightDB installation file sha256sum, LightDB version number, etc. If there are risks, give a risk report. see check_list.
Support database()
functions can be used in both oracle and postgres modes.
The database()
function is placed in the extension ltfce
.
see ltfce.
for example:
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)
Archive log cleaning optimization. see lightdb_archive_dir.
Remove the settings for the cleanup logic in archive_command
from the installer script.
Set lightdb_archive_dir
at the same time.
When starting LightDB, check archive_command
,
lightdb_archive_retion_size
and lightdb_archive_dir
when archive_mode
is on.
Adjustment parameters:
lightdb_archive_retion_size
can only be set at startup.
lightdb_archive_dir
can only be set at startup.
Ensure that fewer wal logs are deleted in the archive than are retained in the lt_wal
directory.
Add walminer
extension to mine all the useful information of wal logs to provide LightDB data recovery support.
The database log level configuration needs to be greater than minimal
.
see lt_walminer.
Supports single-instance multi-mode. see CREATE DATABASE.
for example:
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)
Add the lightdb_aborted_rollback
parameter to support the error reporting of the current statement
in the transaction and rollback the entire transaction.
see lightdb_aborted_rollback.
Before adding this feature,for example:
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
After adding this feature,for example:
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.
Solve the problem of type mismatch when the unknown
type participates in the operation.
see optional.
for example:
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.
The problem of high CPU usage in optimizing the lt_cron
process.
see lt_cron.
Add an option table_exists_action
,
to tell lt_restore
what to do if the table it is tring to create already exists.
table_exists_action
has four options: skip
,append
,
truncate
or replace
.
see lt_restore.
lt_upgrade
supports package upgrade.
see lt_upgrade.
lt_upgradecheck
supports cross-version upgrade.
see lt_upgrade_check.
Statement level rollback optimization, This feature is supported in both Oracle and MySQL modes. Statement level rollback is enabled, and the performance loss is about 5%. see lt_statement_rollback_enable.
ltdts_ora
is a data synchronization tool for synchronizing Oracle data to LightDB.
see ltdts_ora.
ltdts_mysql
is a data synchronization tool for synchronizing MySQL|MariaDB data to LightDB.
see ltdts_mysql.
lt_patch
enhancements, and many of new parameters shown below have been added.
see lt_patch.
Support automatic execution of SQL scripts.
Added lt_patch
table to save patch information.
The apply_type
and apply_version
attributes are added to the patch description information.
Add the patch dependency directory.
Solve the half state problem in the patch success process.
More stringent verification and other details optimization.
Use lt_dump
and lt_restore
tools to implement backup and recovery of distributed clusters:
Use lt_dump
tools to implement backup of distributed clusters.
see lt_distributed_dump.
Use lt_restore
tools to implement recovery of distributed clusters.
see lt_distributed_restore.
Use lt_probackup
tools to implement backup and recovery of distributed clusters.
see lt_distributed_probackup.
Oracle
compatibility enhancements, and many of new features shown below have been added.
Online change from common table to partitioned table. see ALTER TABLE.
for example:
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')
Support oracle cardinality
and ordered_predicates
hint.
see lt_hint_plan.
for example:
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 modify, default values and not null attributes can swap locations. see ALTER TABLE.
for example:
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
New export tool ltuldr
(compatible with oracle sqluldr2
tool).
see ltuldr.
Support connect by
hierarchical query.
see CONNECT BY Clause.
for example:
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
Enhancements,see orafce.
varchar2
calculates the length in characters.
Support raw
type.
for example:
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 | | |