Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Update fails with enabled optimizer. #6053
Greenplum version or build
PostgreSQL 8.3.23 (Greenplum Database 5.11.0 build commit:6f447c24554134df0c1d473e63e0124e7ee6de6b) on x86_64-pc-linux-gnu, compiled by GCC gcc (GCC) 6.2.0, 64-bit compiled on Sep 12 2018 20:18:01
OS version and uname -a
Linux kzgreenplum5 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Update with enabled optimizer runs successfully.
Update fails with error:
If optimizer is disabled statement runs without error.
Step to reproduce the behavior
CREATE TABLE "autotest"."test_2"
insert into "autotest"."test_2"
UPDATE "autotest"."test_2" SET v_varchar1_old = s_varchar_old;
Thank you for reporting @tkhannan.
A smaller repro is:
CREATE TABLE test ( "v_date_old" TIMESTAMP, "v_varchar1_old" CHARACTER VARYING(10), "s_varchar_old" CHARACTER VARYING(10) ) DISTRIBUTED BY ("s_varchar_old"); insert into test values ('2012-03-16 00:00:00', NULL, 'IR$6D'); UPDATE test SET v_varchar1_old = s_varchar_old;
The explain plan looks fine:
Not sure how this bug is related to PR #6245. This is a real bug in ORCA, however, and we'll try to get to it as soon as possible. But, I feel that the issue fixed in #6245 is a critical one, so if you need to push this in sooner than next week, I'd say disable orca for that test. I say this because the two issues look unrelated. If you think they are, then we should wait for a proper fix.
And two bugs together will lead to more tuples in the result:
But for this PR #6245 , I think the root problem is the ORCA's plan is not right.