RE: Parallel INSERT (INTO ... SELECT ...) - Mailing list pgsql-hackers

From Hou, Zhijie
Subject RE: Parallel INSERT (INTO ... SELECT ...)
Date
Msg-id 10974694357f4d4aa1739f58961d485d@G08CNEXMBPEKD05.g08.fujitsu.local
Whole thread Raw
In response to Re: Parallel INSERT (INTO ... SELECT ...)  (Greg Nancarrow <gregn4422@gmail.com>)
Responses Re: Parallel INSERT (INTO ... SELECT ...)  (Greg Nancarrow <gregn4422@gmail.com>)
List pgsql-hackers
Hi,

When reading the code of rel_max_parallel_hazard_for_modify in 0001.

I thought there are so many places call table_close().
Personally, It's a little confused to me.

Do you think it's better to do the table_open/close outside of rel_max_parallel_hazard_for_modify ?

Like:

static bool rel_max_parallel_hazard_for_modify(Relation rel,
                                               CmdType command_type,
                                               max_parallel_hazard_context *context);
...
        Relation relation = table_open(rte->relid, NoLock);
        (void) rel_max_parallel_hazard_for_modify(relation, parse->commandType, &context);
        table_close(relation, NoLock);


And we seems do not need the lockmode param with the above define.


Best regards,
houzj



pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: FETCH FIRST clause PERCENT option
Next
From: Peter Smith
Date:
Subject: Re: Single transaction in the tablesync worker?