This is an automated email from the ASF dual-hosted git repository.

yjhjstz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 874ec50997d1119a6a6831117d59af3aa2766c01
Author: Ashwin Agrawal <[email protected]>
AuthorDate: Tue Feb 21 12:46:09 2023 -0800

    Remove merge fixme from transformGpPartitionDefinition()
    
    Currently, partition definition element can have mix of partition
    definitions and also COLUMN ENCODING clauses within it.
    
    For example:
    CREATE TABLE foo (a1 int, a2 char(5)) using ao_row
    partition by range (a1) (
    start(1) end(5) every(1),  --> partition definition
    COLUMN a1 ENCODING (compresstype=zstd) --> column encoding
    );
    
    Due to this when GpPartitionDefinition has single list of partDefElems
    which contains partition definitions and also column encodings. Fixme
    was to evaluate if current grammer can be optimized to generate
    separate lists and eliminate the need for separating these later in
    transformGpPartitionDefinition(). So, not essentially anything to fix,
    just optimize.
    
    After looking into the details - seems not straightforward without
    modifing the grammer which will be breaking change. Also, don't see
    much performance benefit either from the change as current code is
    looping over partDefElems to transform, so not much extra cost added
    from having them together. Also, we don't expect to have huge number
    of elements in this list to overpower the cost from actually creating
    these many partition tables.
    
    Reviewed-by: Alexandra Wang <[email protected]>
    Reviewed-by: Huansong Fu <[email protected]>
---
 src/backend/parser/parse_partition_gp.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/backend/parser/parse_partition_gp.c 
b/src/backend/parser/parse_partition_gp.c
index 6d21d79fa8..c030a3cc85 100644
--- a/src/backend/parser/parse_partition_gp.c
+++ b/src/backend/parser/parse_partition_gp.c
@@ -1463,10 +1463,6 @@ generatePartitions(Oid parentrelid, 
GpPartitionDefinition *gpPartSpec,
                        parent_tblenc = lappend(parent_tblenc, lfirst(lc));
        }
 
-       /*
-        * GPDB_12_MERGE_FIXME: can we optimize grammar to create separate lists
-        * for elems and encoding in encClauses.
-        */
        foreach(lc, gpPartSpec->partDefElems)
        {
                Node       *n = lfirst(lc);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to