Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
Summary:
Customers like creating tables similar to innodb counter parts easily.
However running the following doesnt use cpimport and just inserts 1 row at a time taking forever
create table sales_data_cs engine=Columnstore as select * from sales_data;
|
This is a bad user experience and very inefficient
Work around:
create table t2 engine=columnstore as select * from t1 limit 1; |
truncate table t2;
|
insert into t2 select * from t1; --- will use cpimport
|
Expected:
Running create table as should run almost as fast as when doing the work around approach that splits the query into three queries
Reproduction:
CREATE TABLE test_table (
|
group_name CHAR(2), |
number1 DECIMAL(12, 2), |
number2 DECIMAL(12, 2), |
var varchar(1) |
);
|
|
INSERT INTO test_table
|
SELECT CAST(ROUND(RAND() * 10, 0) AS CHAR), |
ROUND(RAND() * 1000000, 2), |
ROUND(RAND() * 1000, 2), |
substring(MD5(RAND()),1,1) |
FROM seq_1_to_2000000;
|
|
create table test_columnstore engine=Columnstore as select * from test_table;
|
--- forever
|
|
|
-- hack
|
create table test_columnstore engine=Columnstore as select * from test_table limit 1; |
truncate table test_columnstore;
|
insert into test_columnstore select * from test_table;
|
# 5.273 |