[FEAT MERGE] column store ddl
Co-authored-by: simonjoylet <simonjoylet@gmail.com> Co-authored-by: Monk-Liu <1152761042@qq.com> Co-authored-by: renju96 <fcbrenju@163.com>
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
alter system enable_table_without_all_cg = false;
|
||||
create table t1(a int, b varchar(3048), primary key (a), c int) with column group for all columns, each column;
|
||||
create table t2(pk int, c1 int, c2 int unsigned, c3 varchar(100)) block_size=2048 with column group for all columns, each column;
|
||||
create table t1(a int, b varchar(3048), primary key (a), c int) with column group (all columns, each column);
|
||||
create table t2(pk int, c1 int, c2 int unsigned, c3 varchar(100)) block_size=2048 with column group (all columns, each column);
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
150
|
||||
@ -330,8 +330,8 @@ count(*) count(c1) min(c1) max(c1) sum(c1) count(c2) min(c2) max(c2)
|
||||
drop table t1,t2;
|
||||
alter system enable_table_without_all_cg = true;
|
||||
alter system flush plan cache;
|
||||
create table t1(a int, b varchar(3048), primary key (a), c int) with column group for all columns, each column;
|
||||
create table t2(pk int, c1 int, c2 int unsigned, c3 varchar(100)) block_size=2048 with column group for all columns, each column;
|
||||
create table t1(a int, b varchar(3048), primary key (a), c int) with column group (all columns, each column);
|
||||
create table t2(pk int, c1 int, c2 int unsigned, c3 varchar(100)) block_size=2048 with column group (all columns, each column);
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
150
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
drop table if exists ct1;
|
||||
create table ct1(c1 int, c2 int) with column group for all columns, each column;
|
||||
create table ct1(c1 int, c2 int) with column group (all columns, each column);
|
||||
alter system major freeze;
|
||||
select * from ct1 where c1 < 1;
|
||||
c1 c2
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
drop table if exists ct1;
|
||||
set session ob_trx_timeout=100000000000;
|
||||
create table ct1(c1 int primary key, c2 int, c3 number, c4 varchar(60000), c5 varchar(60000)) ROW_FORMAT = redundant COMPRESSION = 'none' with column group for all columns, each column;
|
||||
create table ct1(c1 int primary key, c2 int, c3 number, c4 varchar(60000), c5 varchar(60000)) ROW_FORMAT = redundant COMPRESSION = 'none' with column group (all columns, each column);
|
||||
alter system minor freeze;
|
||||
alter system major freeze;
|
||||
select c1, c2, c3, length(c4) from ct1 where c1 < 1;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
drop table if exists ct1;
|
||||
set session ob_trx_timeout=100000000000;
|
||||
create table ct1(c1 int primary key, c2 int, c3 number, c4 varchar(60000), c5 varchar(60000)) ROW_FORMAT = redundant COMPRESSION = 'none' with column group for all columns, each column;
|
||||
create table ct1(c1 int primary key, c2 int, c3 number, c4 varchar(60000), c5 varchar(60000)) ROW_FORMAT = redundant COMPRESSION = 'none' with column group (all columns, each column);
|
||||
alter system minor freeze;
|
||||
alter system major freeze;
|
||||
update ct1 set c3 = 0 where c1 = 0;
|
||||
@ -449,7 +449,7 @@ drop table ct1;
|
||||
alter system enable_table_without_all_cg = false;
|
||||
alter system set _rowsets_enabled = true;
|
||||
alter system flush plan cache;
|
||||
create table ct1(c1 int primary key, c2 int, c3 number, c4 varchar(60000), c5 varchar(60000)) ROW_FORMAT = redundant COMPRESSION = 'none' with column group for all columns, each column;
|
||||
create table ct1(c1 int primary key, c2 int, c3 number, c4 varchar(60000), c5 varchar(60000)) ROW_FORMAT = redundant COMPRESSION = 'none' with column group (all columns, each column);
|
||||
alter system minor freeze;
|
||||
alter system major freeze;
|
||||
update ct1 set c3 = 0 where c1 = 0;
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
create table tt1(a int, b int, c int, primary key(a)) with column group for all columns, each column;
|
||||
create table tt1(a int, b int, c int, primary key(a)) with column group (all columns, each column);
|
||||
create index idx_tt1 on tt1(b);
|
||||
create table tt2(d int, e int);
|
||||
alter table tt1 drop column c;
|
||||
ERROR 0A000: drop column with column store table not supported
|
||||
alter table tt1 modify column c varchar(20);
|
||||
ERROR 0A000: alter column with column store table not supported
|
||||
alter table tt1 drop column c;
|
||||
drop table tt1;
|
||||
drop table tt2;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
create table t1(a int, b varchar(3048), primary key (a)) with column group for all columns, each column;
|
||||
create table t2(c0 int, c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, c8 int, c9 int, c10 int, c11 int, c12 int) with column group for all columns, each column;
|
||||
create table t3(a int, b varchar(3048), primary key (a)) with column group for all columns, each column;
|
||||
create table t1(a int, b varchar(3048), primary key (a)) with column group (all columns, each column);
|
||||
create table t2(c0 int, c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, c8 int, c9 int, c10 int, c11 int, c12 int) with column group (all columns, each column);
|
||||
create table t3(a int, b varchar(3048), primary key (a)) with column group (all columns, each column);
|
||||
insert into t1 values(1, 1);
|
||||
insert into t2 values(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
|
||||
insert into t3 values(1, 1);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
create table t1(a int, b varchar(3048), primary key (a)) with column group for each column;
|
||||
create table t2(c0 int, c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, c8 int, c9 int, c10 int, c11 int, c12 int) with column group for each column;
|
||||
create table t3(a int, b varchar(3048), primary key (a)) with column group for each column;
|
||||
create table t1(a int, b varchar(3048), primary key (a)) with column group (each column);
|
||||
create table t2(c0 int, c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, c8 int, c9 int, c10 int, c11 int, c12 int) with column group (each column);
|
||||
create table t3(a int, b varchar(3048), primary key (a)) with column group (each column);
|
||||
insert into t1 values(1, 1);
|
||||
insert into t2 values(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
|
||||
insert into t3 values(1, 1);
|
||||
|
||||
@ -10,8 +10,8 @@ drop table if exists t1,t2;
|
||||
--enable_query_log
|
||||
|
||||
alter system enable_table_without_all_cg = false;
|
||||
create table t1(a int, b varchar(3048), primary key (a), c int) with column group for all columns, each column;
|
||||
create table t2(pk int, c1 int, c2 int unsigned, c3 varchar(100)) block_size=2048 with column group for all columns, each column;
|
||||
create table t1(a int, b varchar(3048), primary key (a), c int) with column group (all columns, each column);
|
||||
create table t2(pk int, c1 int, c2 int unsigned, c3 varchar(100)) block_size=2048 with column group (all columns, each column);
|
||||
|
||||
sleep 10;
|
||||
|
||||
@ -189,8 +189,8 @@ drop table t1,t2;
|
||||
alter system enable_table_without_all_cg = true;
|
||||
alter system flush plan cache;
|
||||
|
||||
create table t1(a int, b varchar(3048), primary key (a), c int) with column group for all columns, each column;
|
||||
create table t2(pk int, c1 int, c2 int unsigned, c3 varchar(100)) block_size=2048 with column group for all columns, each column;
|
||||
create table t1(a int, b varchar(3048), primary key (a), c int) with column group (all columns, each column);
|
||||
create table t2(pk int, c1 int, c2 int unsigned, c3 varchar(100)) block_size=2048 with column group (all columns, each column);
|
||||
|
||||
sleep 10;
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ connection conn1;
|
||||
--disable_warnings
|
||||
drop table if exists ct1;
|
||||
--enable_warnings
|
||||
create table ct1(c1 int, c2 int) with column group for all columns, each column;
|
||||
create table ct1(c1 int, c2 int) with column group (all columns, each column);
|
||||
|
||||
--disable_query_log
|
||||
--let $count = 0
|
||||
|
||||
@ -15,7 +15,7 @@ set @@recyclebin = off;
|
||||
drop table if exists ct1;
|
||||
--enable_warnings
|
||||
set session ob_trx_timeout=100000000000;
|
||||
create table ct1(c1 int primary key, c2 int, c3 number, c4 varchar(60000), c5 varchar(60000)) ROW_FORMAT = redundant COMPRESSION = 'none' with column group for all columns, each column;
|
||||
create table ct1(c1 int primary key, c2 int, c3 number, c4 varchar(60000), c5 varchar(60000)) ROW_FORMAT = redundant COMPRESSION = 'none' with column group (all columns, each column);
|
||||
|
||||
--disable_query_log
|
||||
--let $count = 0
|
||||
|
||||
@ -20,8 +20,7 @@ set @@recyclebin = off;
|
||||
drop table if exists ct1;
|
||||
--enable_warnings
|
||||
set session ob_trx_timeout=100000000000;
|
||||
# create table without all column group
|
||||
create table ct1(c1 int primary key, c2 int, c3 number, c4 varchar(60000), c5 varchar(60000)) ROW_FORMAT = redundant COMPRESSION = 'none' with column group for all columns, each column;
|
||||
create table ct1(c1 int primary key, c2 int, c3 number, c4 varchar(60000), c5 varchar(60000)) ROW_FORMAT = redundant COMPRESSION = 'none' with column group (all columns, each column);
|
||||
|
||||
--disable_query_log
|
||||
--let $count = 0
|
||||
@ -123,8 +122,7 @@ alter system enable_table_without_all_cg = false;
|
||||
alter system set _rowsets_enabled = true;
|
||||
alter system flush plan cache;
|
||||
|
||||
# create table with all column group
|
||||
create table ct1(c1 int primary key, c2 int, c3 number, c4 varchar(60000), c5 varchar(60000)) ROW_FORMAT = redundant COMPRESSION = 'none' with column group for all columns, each column;
|
||||
create table ct1(c1 int primary key, c2 int, c3 number, c4 varchar(60000), c5 varchar(60000)) ROW_FORMAT = redundant COMPRESSION = 'none' with column group (all columns, each column);
|
||||
|
||||
--disable_query_log
|
||||
--let $count = 0
|
||||
|
||||
@ -13,20 +13,18 @@ drop table if exists tt2;
|
||||
--enable_warnings
|
||||
--enable_query_log
|
||||
|
||||
create table tt1(a int, b int, c int, primary key(a)) with column group for all columns, each column;
|
||||
create table tt1(a int, b int, c int, primary key(a)) with column group (all columns, each column);
|
||||
create index idx_tt1 on tt1(b);
|
||||
create table tt2(d int, e int);
|
||||
--error 1235
|
||||
alter table tt1 drop column c;
|
||||
--error 1235
|
||||
alter table tt1 modify column c varchar(20);
|
||||
alter table tt1 drop column c;
|
||||
|
||||
let $tt1_table_id= query_get_value(select table_id from __all_virtual_table where table_name='tt1', table_id, 1);
|
||||
let $tt2_table_id= query_get_value(select table_id from __all_virtual_table where table_name='tt2', table_id, 1);
|
||||
|
||||
## In tt1 table schema, there exists 5 column_group: __co_default, __co_all, __cg_a, __cg_b, __cg_c
|
||||
## In tt1 table schema, there exists 4 column_group: __cg_default, __cg_all, __cg_a, __cg_b
|
||||
let $tt1_cg_cnt = query_get_value(select count(*) as cg_cnt from __all_column_group where table_id=$tt1_table_id, cg_cnt, 1);
|
||||
if ($tt1_cg_cnt != 5)
|
||||
if ($tt1_cg_cnt != 4)
|
||||
{
|
||||
--echo unexpected column_group count of table tt1, real value is $tt1_cg_cnt
|
||||
}
|
||||
|
||||
@ -12,9 +12,9 @@ drop table if exists t3;
|
||||
--enable_warnings
|
||||
--enable_query_log
|
||||
|
||||
create table t1(a int, b varchar(3048), primary key (a)) with column group for all columns, each column;
|
||||
create table t2(c0 int, c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, c8 int, c9 int, c10 int, c11 int, c12 int) with column group for all columns, each column;
|
||||
create table t3(a int, b varchar(3048), primary key (a)) with column group for all columns, each column;
|
||||
create table t1(a int, b varchar(3048), primary key (a)) with column group (all columns, each column);
|
||||
create table t2(c0 int, c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, c8 int, c9 int, c10 int, c11 int, c12 int) with column group (all columns, each column);
|
||||
create table t3(a int, b varchar(3048), primary key (a)) with column group (all columns, each column);
|
||||
sleep 10;
|
||||
insert into t1 values(1, 1);
|
||||
insert into t2 values(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
|
||||
|
||||
@ -12,9 +12,9 @@ drop table if exists t3;
|
||||
--enable_warnings
|
||||
--enable_query_log
|
||||
|
||||
create table t1(a int, b varchar(3048), primary key (a)) with column group for each column;
|
||||
create table t2(c0 int, c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, c8 int, c9 int, c10 int, c11 int, c12 int) with column group for each column;
|
||||
create table t3(a int, b varchar(3048), primary key (a)) with column group for each column;
|
||||
create table t1(a int, b varchar(3048), primary key (a)) with column group (each column);
|
||||
create table t2(c0 int, c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, c8 int, c9 int, c10 int, c11 int, c12 int) with column group (each column);
|
||||
create table t3(a int, b varchar(3048), primary key (a)) with column group (each column);
|
||||
sleep 10;
|
||||
insert into t1 values(1, 1);
|
||||
insert into t2 values(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
|
||||
|
||||
@ -12,9 +12,9 @@ drop table if exists ct1,ct2,ct3;
|
||||
--enable_warnings
|
||||
|
||||
--disable_query_log
|
||||
create table ct1 (c1 int, c2 int) with column group for all columns, each column;
|
||||
create table ct2(c1 int, c2 varchar(100), c3 varchar(1000)) block_size=2048 with column group for all columns, each column;
|
||||
create table ct3(c1 int primary key, c2 int, c3 int, c4 int) partition by hash(c1) partitions 2 with column group for all columns, each column;
|
||||
create table ct1 (c1 int, c2 int) with column group (all columns, each column);
|
||||
create table ct2(c1 int, c2 varchar(100), c3 varchar(1000)) block_size=2048 with column group (all columns, each column);
|
||||
create table ct3(c1 int primary key, c2 int, c3 int, c4 int) partition by hash(c1) partitions 2 with column group (all columns, each column);
|
||||
--let $count = 0
|
||||
while($count < 1000)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user