more optimize code
@@ -16099,21 +16099,6 @@ prebuild_temp_table(Relation rel, RangeVar *tmpname, DistributedBy *distro,
rel->rd_rel->relhasindex)
cs->buildAoBlkdir = true;
- if (RelationIsAoCols(rel))
- {
- ListCell *lc;
-
- foreach(lc, opts)
- {
- DefElem *de = lfirst(lc);
-
- cs->options = lappend(cs->options, de);
- }
- if (useExistingColumnAttributes)
- col_encs = RelationGetUntransformedAttributeOptions(rel);
- }
- else
- {
cs->options = opts;
if (RelationIsAoRows(rel))
@@ -16129,7 +16114,9 @@ prebuild_temp_table(Relation rel, RangeVar *tmpname, DistributedBy *distro,
*/
cs->options = build_ao_rel_storage_opts(cs->options, rel);
}
- }
+
+ if (RelationIsAoCols(rel) && useExistingColumnAttributes)
+ col_encs = RelationGetUntransformedAttributeOptions(rel);
for (attno = 0; attno < tupdesc->natts; attno++)
{
