forked from greenplum-db/gpdb-archive
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented InPlaceUpdate to be used for updates made on non-distribu…
…tion columns. Currently, ORCA uses Split-Update for updates on both distribution and non-distribution columns. With this commit, ORCA uses an InPlaceUpdate whenever updates are made to non-distribution columns or non-partition keys, and Split Update if any of modified columns are either distribution or partition keys. Consider below setup where we are updating non-distibution column, b in the table foo. ` create table foo(a int, b int); explain update foo set b=4; ` ORCA produces plan with Split and Update nodes ``` Update on public.foo -> Result Output: foo_1.a, foo_1.b, (DMLAction), foo_1.ctid, foo_1.gp_segment_id -> Split Output: foo_1.a, foo_1.b, foo_1.ctid, foo_1.gp_segment_id, DMLAction -> Seq Scan on public.foo foo_1 Output: foo_1.a, foo_1.b, 4, foo_1.ctid, foo_1.gp_segment_id ``` There is no point in using a Split and Update for this as we are updating a non-distribution column which do not require any redistribution. This commit uses an InPlace Update to perform updates on non-distribution columns like Planner. Below is the new plan produced with this commit. New Plan ``` Update on public.foo -> Seq Scan on public.foo foo_1 Output: foo_1.a, 4, foo_1.ctid, foo_1.gp_segment_id Optimizer: Pivotal Optimizer (GPORCA) ``` greenplum 6 specific changes: 1. Some constructors have been changed because the list of arguments in 6X and 7X are different. 2. fixed a bug in CParseHandlerPhysicalDML::startElement where preserve_oids_xml was used instead of fSplit, which could lead to SIGSEGV during DML node parsing. 3. Changed create_index_hot test. Removed disabling the optimizer before updating since ORCA no longer uses split update in this case. (cherry picked from commit 3ced85b)
- Loading branch information
1 parent
107c9f4
commit 0031781
Showing
52 changed files
with
1,409 additions
and
1,695 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.