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

From Greg Nancarrow
Subject Re: Parallel INSERT (INTO ... SELECT ...)
Date
Msg-id CAJcOf-ejV8iU+YpuV4qbYEY-2vCG1QF2g3Gxn=Z+PyUH_5f84A@mail.gmail.com
Whole thread Raw
In response to RE: Parallel INSERT (INTO ... SELECT ...)  ("tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>)
Responses RE: Parallel INSERT (INTO ... SELECT ...)  ("Tang, Haiying" <tanghy.fnst@cn.fujitsu.com>)
RE: Parallel INSERT (INTO ... SELECT ...)  ("Hou, Zhijie" <houzj.fnst@cn.fujitsu.com>)
List pgsql-hackers
Thanks for the feedback.
Posting an updated set of patches. Changes are based on feedback, as
detailed below:

[Hou]
- Deallocate list returned from RelationGetIndexList() using
list_free() after finished using list
- Regard foreign and temporary tables as parallel-restricted (instead
of parallel unsafe) for Insert
- pfree() conbin returned from TextDatumGetCString() after finished using it
- Make parallel-safety checks of index expressions more efficient,
remove some redundant function calls
- Add a few more test cases to cover certain untested parallel-safety
check cases
- Remove repeated table_close() on return, by moving table_open() &
table_close() to a higher level
- Reduce Insert parallel-safety checks required for some SQL, by
noting that the subquery must operate on a relation (check for
RTE_RELATION in subquery range-table)

[Zhihong Yu]
- Minor change to patch comment
- Wrap long line
- Remove intermediate local variable

[Tsunakawa-san]
- Update RELATION_IS_LOCAL macro to reinstate previously-removed check
on the relation being newly created in the current transaction (and so
assumed accessible only to the current backend), but for
non-parallel-mode only (since now it may be accessible to parallel
workers)
- Remove braces for one-line else
- Fix code comment
- Rename PrepareParallelMode() for plan execution, so that it's not
misinterpreted as a general function for preparation of parallel-mode

[Misc]
- Fix bug in query re-writer - hasModifyingCTE is not set in
re-written non-SELECT queries having a CTE


Regards,
Greg Nancarrow
Fujitsu Australia

Attachment

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Perform COPY FROM encoding conversions in larger chunks
Next
From: Simon Riggs
Date:
Subject: Re: VACUUM (DISABLE_PAGE_SKIPPING on)