Re: Parallel Inserts in CREATE TABLE AS

Поиск
Список
Период
Сортировка
От Bharath Rupireddy
Тема Re: Parallel Inserts in CREATE TABLE AS
Дата
Msg-id CALj2ACVtLVmNnUP=NKLO71KXBVvJR8zcW80+EtXoQS6qYmHbMw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Parallel Inserts in CREATE TABLE AS  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Ответы Re: Parallel Inserts in CREATE TABLE AS  (Luc Vlaming <luc@swarm64.com>)
Re: Parallel Inserts in CREATE TABLE AS  (Zhihong Yu <zyu@yugabyte.com>)
Re: Parallel Inserts in CREATE TABLE AS  (Zhihong Yu <zyu@yugabyte.com>)
Список pgsql-hackers
On Mon, Jan 4, 2021 at 7:02 PM Bharath Rupireddy
<bharath.rupireddyforpostgres@gmail.com> wrote:
>
> > +                                       if (IS_PARALLEL_CTAS_DEST(gstate->dest) &&
> > +                                               ((DR_intorel *) gstate->dest)->into->rel &&
> > +                                               ((DR_intorel *) gstate->dest)->into->rel->relname)
> > why would rel and relname not be there? if no rows have been inserted?
> > because it seems from the intorel_startup function that that would be
> > set as soon as startup was done, which i assume (wrongly?) is always done?
>
> Actually, that into clause rel variable is always being set in the gram.y for CTAS, Create Materialized View and
SELECTINTO (because qualified_name non-terminal is not optional). My bad. I just added it as a sanity check. Actually,
it'snot required.
 
>
> create_as_target:
>             qualified_name opt_column_list table_access_method_clause
>             OptWith OnCommitOption OptTableSpace
>                 {
>                     $$ = makeNode(IntoClause);
>                     $$->rel = $1;
> create_mv_target:
>             qualified_name opt_column_list table_access_method_clause opt_reloptions OptTableSpace
>             {
>                 $$ = makeNode(IntoClause);
>                 $$->rel = $1;
> into_clause:
>             INTO OptTempTableName
>             {
>                 $$ = makeNode(IntoClause);
>                $$->rel = $2;
>
> I will change the below code:
> +                    if (GetParallelInsertCmdType(gstate->dest) ==
> +                        PARALLEL_INSERT_CMD_CREATE_TABLE_AS &&
> +                        ((DR_intorel *) gstate->dest)->into &&
> +                        ((DR_intorel *) gstate->dest)->into->rel &&
> +                        ((DR_intorel *) gstate->dest)->into->rel->relname)
> +                    {
>
> to:
> +                    if (GetParallelInsertCmdType(gstate->dest) ==
> +                        PARALLEL_INSERT_CMD_CREATE_TABLE_AS)
> +                    {
>
> I will update this in the next version of the patch set.

Attaching v20 patch set that has above change in 0001 patch, note that
0002 to 0004 patches have no changes from v19. Please consider the v20
patch set for further review.


With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Cirrus CI (Windows help wanted)
Следующее
От: Mark Dilger
Дата:
Сообщение: Re: macOS SIP, next try