DROP TABLE IF EXISTS product_info;
CREATE TABLE product_info
(
product_price integer not null,
product_id char(30) not null,
product_time date ,
product_level char(10) ,
product_name varchar(200) ,
product_type1 varchar(20) ,
product_type2 char(10) ,
product_monthly_sales_cnt integer ,
product_comment_time date ,
product_comment_num integer ,
product_comment_content varchar(200)
)
WITH (
orientation = column,
compression=middle
)
DISTRIBUTE BY hash (product_id);DROP INDEX product_idx;在数据导入完成后,重建索引。
CREATE INDEX product_idx ON product_info(product_id);说明:
在重建索引过程中,用户可以通过临时增加GUC参数“maintenance_work_mem”/“psort_work_mem”来加快索引的重建。
INSERT INTO product_info SELECT * FROM product_info_ext ;出现以下信息,说明数据导入成功。
INSERT 20执行SELECT命令查询目标表product_info,查看导入到GaussDB 200中的数据。
SELECT count(*) FROM product_info;查询结果显示结果如下,表示导入成功。
count
-------
20
(1 row)
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69959250/viewspace-3150868/ ,如需转载,请注明出处,否则将追究法律责任。