功能简介
兼容Oracle创建表/索引指定compress/nocompress和logging/nologging关键字,compress/nocompress和logging/nologging谁在前都支持,没有区分。
从LightDB 23.2版本开始,LightDB在创建表/索引时支持compress/nocompress和logging/nologging关键字,compress/nocompress和logging/nologging关键字相对位置必须在tablespace关键字前面。
仅是语法糖功能,兼容Oracle语法,没有实现对应的功能。
用法
create table 语句
create table comp_log1(id int) compress;
create table comp_log2(id int) nocompress;
create table comp_log3(id int) logging;
create table comp_log4(id int) nologging;
create table comp_log5(id int) compress logging;
create table comp_log6(id int) compress nologging;
create table comp_log7(id int) nocompress logging;
create table comp_log8(id int) nocompress nologging;
create table comp_log9(id int) logging compress;
create table comp_log10(id int) logging nocompress;
create table comp_log11(id int) nologging compress;
create table comp_log12(id int) nologging nocompress;
create table as语句
-- CREATE TABLE AS
CREATE TABLE films_recent compress logging tablespace pg_default AS SELECT 10 age, 'xiaohong' name, 123456 id;
drop table films_recent;
CREATE TABLE if not exists films_recent compress logging tablespace pg_default AS SELECT 10 age, 'xiaohong' name, 123456 id;
drop table films_recent;
create index语句
-- create index
create table comp_log_test(id int);
create index idx_id on comp_log_test(id) nologging compress tablespace pg_default;
create index if not exists idx_id2 on comp_log_test(id) nocompress logging tablespace pg_default;
drop table comp_log_test;