> Seems like v22 patch was failing in cfbot for one of the unstable test cases.
> Attaching v23 patch set with modification in 0003 and 0004 patches. No
> changes to 0001 and 0002 patches. Hopefully cfbot will be happy with v23.
> 
> Please consider v23 for further review.
Hi,

I was looking into the latest patch, here are some comments:

1)
         * (Note that we do allow CREATE TABLE AS, SELECT INTO, and CREATE
         * MATERIALIZED VIEW to use parallel plans, but as of now, only the 
leader
         * backend writes into a completely new table.  In the future, we can

Since we will support parallel insert with CTAS, this existing comments need to 
be changed.

2)
In parallel.sgml

        The query writes any data or locks any database rows. If a query
        contains a data-modifying operation either at the top level or within
        a CTE, no parallel plans for that query will be generated.  As an
        exception, the commands <literal>CREATE TABLE ... AS</literal>,

The same as 1), we'd better comment we have support parallel insert with CTAS.

3)
ExecInitParallelPlan(PlanState *planstate, EState *estate,
                                         Bitmapset *sendParams, int nworkers,
-                                        int64 tuples_needed)
+                                        int64 tuples_needed,
+                                        ParallelInsertCmdKind parallel_ins_cmd,
+                                        void *parallel_ins_info)

Is it better to place ParallelInsertCmdKind in struct ParallelInsertCTASInfo?
We can pass less parameter in some places.
Like:
typedef struct ParallelInsertCTASInfo
{
+       ParallelInsertCmdKind parallel_ins_cmd;
        IntoClause *intoclause;
        Oid objectid;

} ParallelInsertCTASInfo;

Best regards,
houzj

Reply via email to