如何压缩现有 table - Netezza Aginity
How to compress in an existing table - Netezza Aginity
我创建了以下 table SCH_DB.PREDICTION_HIS
CREATE TABLE SCH_DB.PREDICTION_HIS
(
PERIOD CHARACTER VARYING(6) NOT NULL,
MONTHS_FORECAST CHARACTER VARYING(13) NOT NULL,
SUBSCRIBER_ID CHARACTER VARYING(12) NOT NULL,
IDENTIFICATION CHARACTER VARYING(30),
ID_PLAN CHARACTER VARYING(11),
DESCRIPTION_PLAN CHARACTER VARYING(75),
RATE DOUBLE PRECISION,
SENIORITY_PLAN DOUBLE PRECISION,
PREQUALIFIED_QUOTA DOUBLE PRECISION,
CUSTOMER_SENIORITY DOUBLE PRECISION,
SEGMENT NATIONAL CHARACTER VARYING(12),
PROB_CHURN DOUBLE PRECISION,
SERIE INTEGER,
ORDER_PROB_GENERAL DOUBLE PRECISION,
TOP_N_GENERAL INTEGER,
ORDER_PROB_SEGMENT DOUBLE PRECISION,
TOP_N_SEGMENT INTEGER,
TYPE_BASE NATIONAL CHARACTER VARYING(7),
CUSTOMER_NAME CHARACTER VARYING(200),
STATUS CHARACTER VARYING(20),
DESCRIPTION_STATUS CHARACTER VARYING(50),
SOURCE CHARACTER VARYING(3)
)
DISTRIBUTE ON (PERIOD, SUBSCRIBER_ID);
拥有 25258910 条记录的同一个
压缩比为2.42
/nz/support-IBM_Netezza-11.2.1.1-210825-0050/bin/nz_compressedTableRatio_v2 SCH_DB.PREDICTION_HIS
/nz/support-IBM_Netezza-11.2.1.1-210825-0050/bin/sedTableRatio_v2 SCH_DB.PREDICTION_HIS
....................................................................................
. The values below show the estimated size ratio of a compressed table to its .
. uncompressed form. An uncompressed table is approximately <ratio> times larger .
. than its compressed version. .
. .
. The 'Compressed Size' is the actual amount of storage being used by the table. .
. The 'Uncompressed Size' is an estimate based on mathematical calculations. .
....................................................................................
Database: SCH_DB
Table/MView Name Ratio Compressed Size Uncompressed Size Size Difference
================================ ===== =================== =================== ===================
PREDICTION_HIS 2.42 2,567,045,120 6,211,530,330 3,644,485,210
================================ ===== =================== =================== ===================
Total For This Database 2.42 2,567,045,120 6,211,530,330 3,644,485,210
我使用了下面的命令来压缩但是returns错误
ALTER TABLE SCH_DB.PREDICTION_HIS COMPRESS YES
是否可以压缩这个table,要压缩的语句是什么?
现在 netezza 中的所有表都经过压缩,更改它的语法 on/off 仅用于向后兼容
我创建了以下 table SCH_DB.PREDICTION_HIS
CREATE TABLE SCH_DB.PREDICTION_HIS
(
PERIOD CHARACTER VARYING(6) NOT NULL,
MONTHS_FORECAST CHARACTER VARYING(13) NOT NULL,
SUBSCRIBER_ID CHARACTER VARYING(12) NOT NULL,
IDENTIFICATION CHARACTER VARYING(30),
ID_PLAN CHARACTER VARYING(11),
DESCRIPTION_PLAN CHARACTER VARYING(75),
RATE DOUBLE PRECISION,
SENIORITY_PLAN DOUBLE PRECISION,
PREQUALIFIED_QUOTA DOUBLE PRECISION,
CUSTOMER_SENIORITY DOUBLE PRECISION,
SEGMENT NATIONAL CHARACTER VARYING(12),
PROB_CHURN DOUBLE PRECISION,
SERIE INTEGER,
ORDER_PROB_GENERAL DOUBLE PRECISION,
TOP_N_GENERAL INTEGER,
ORDER_PROB_SEGMENT DOUBLE PRECISION,
TOP_N_SEGMENT INTEGER,
TYPE_BASE NATIONAL CHARACTER VARYING(7),
CUSTOMER_NAME CHARACTER VARYING(200),
STATUS CHARACTER VARYING(20),
DESCRIPTION_STATUS CHARACTER VARYING(50),
SOURCE CHARACTER VARYING(3)
)
DISTRIBUTE ON (PERIOD, SUBSCRIBER_ID);
拥有 25258910 条记录的同一个
压缩比为2.42
/nz/support-IBM_Netezza-11.2.1.1-210825-0050/bin/nz_compressedTableRatio_v2 SCH_DB.PREDICTION_HIS
/nz/support-IBM_Netezza-11.2.1.1-210825-0050/bin/sedTableRatio_v2 SCH_DB.PREDICTION_HIS
....................................................................................
. The values below show the estimated size ratio of a compressed table to its .
. uncompressed form. An uncompressed table is approximately <ratio> times larger .
. than its compressed version. .
. .
. The 'Compressed Size' is the actual amount of storage being used by the table. .
. The 'Uncompressed Size' is an estimate based on mathematical calculations. .
....................................................................................
Database: SCH_DB
Table/MView Name Ratio Compressed Size Uncompressed Size Size Difference
================================ ===== =================== =================== ===================
PREDICTION_HIS 2.42 2,567,045,120 6,211,530,330 3,644,485,210
================================ ===== =================== =================== ===================
Total For This Database 2.42 2,567,045,120 6,211,530,330 3,644,485,210
我使用了下面的命令来压缩但是returns错误
ALTER TABLE SCH_DB.PREDICTION_HIS COMPRESS YES
是否可以压缩这个table,要压缩的语句是什么?
现在 netezza 中的所有表都经过压缩,更改它的语法 on/off 仅用于向后兼容