-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ADBDEV-6573: Fix duplicated settings for LIKE INCLUDING STORAGE with partitioned table #1093
Conversation
Allure report https://allure.adsw.io/launch/84058 |
Allure report https://allure.adsw.io/launch/84185 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should fillfactor
and orientaion
inherit by like include storage
:
postgres=# CREATE TABLE ctlt4 (a numeric, b timestamp)
WITH (appendoptimized=true, orientation=row, compresstype=zstd, fillfactor=90, autovacuum_enabled=true, user_catalog_table=true, oids=false, compresslevel=2);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
postgres=# CREATE TABLE ctlt4_like1 (LIKE ctlt4)
PARTITION BY RANGE(b) (
DEFAULT PARTITION extra
);
NOTICE: table doesn't have 'DISTRIBUTED BY' clause, defaulting to distribution columns from LIKE table
NOTICE: CREATE TABLE will create partition "ctlt4_like1_1_prt_extra" for table "ctlt4_like1"
CREATE TABLE
postgres=# CREATE TABLE ctlt4_like (LIKE ctlt4 INCLUDING STORAGE)
PARTITION BY RANGE(b) (
DEFAULT PARTITION extra
);
NOTICE: table doesn't have 'DISTRIBUTED BY' clause, defaulting to distribution columns from LIKE table
NOTICE: CREATE TABLE will create partition "ctlt4_like_1_prt_extra" for table "ctlt4_like"
CREATE TABLE
postgres=# \d+ ctlt4
Append-Only Table "public.ctlt4"
Column | Type | Modifiers | Storage | Stats target | Description
--------+-----------------------------+-----------+---------+--------------+-------------
a | numeric | | main | |
b | timestamp without time zone | | plain | |
Compression Type: zstd
Compression Level: 2
Block Size: 32768
Checksum: t
Distributed by: (a)
Options: appendonly=true, orientation=row, compresstype=zstd, fillfactor=90, compresslevel=2
postgres=# \d+ ctlt4_like
Append-Only Table "public.ctlt4_like"
Column | Type | Modifiers | Storage | Stats target | Description
--------+-----------------------------+-----------+---------+--------------+-------------
a | numeric | | main | |
b | timestamp without time zone | | plain | |
Compression Type: zstd
Compression Level: 2
Block Size: 32768
Checksum: t
Child tables: ctlt4_like_1_prt_extra
Distributed by: (a)
Partition by: (b)
Options: appendonly=true, checksum=true, compresslevel=2, compresstype=zstd
In general behavior of this option is kind of questionable, considering that GPDB 7 it only copies |
Allure report https://allure.adsw.io/launch/84241 |
Allure report https://allure.adsw.io/launch/84659 |
Fix duplicated settings for LIKE INCLUDING STORAGE with partitioned table
If a partitioned table was created with a LIKE INCLUDING STORAGE clause, the
storage settings for the child partition were applied twice: once from the
parent partition and second time from the LIKE. This caused an error when
trying to use INCLUDING STORAGE with partitioned tables.
To fix it, this patch disables the INCLUDING STORAGE for the child partitions,
removing the duplicate settings.