postgres icon indicating copy to clipboard operation
postgres copied to clipboard

Possible incorrect computation of scanCols in UPDATE

Open soumyadeep2007 opened this issue 5 years ago • 0 comments
trafficstars

This is a thread for collecting cases where scanCols is wrongly computed for UPDATE.

Case 1:

drop table if exists t1;
create table t1(a int, b int);
insert into t1 values(2,1);
analyze t1;
drop table if exists t2;
create table t2(a int, b int, c int);
insert into t2 select i, i%2, i from generate_series(1,5)i;
insert into t2 select i, i, i from generate_series(1,5)i;
analyze t2;
UPDATE t2 SET b = 2 WHERE a = (SELECT a FROM t1);

soumyadeep2007 avatar Jun 24 '20 00:06 soumyadeep2007