@@ -24,6 +24,7 @@ SELECT append_range_partition('test_updates.test');
24
24
(1 row)
25
25
26
26
INSERT INTO test_updates.test_11 (val, b) VALUES (101, 10);
27
+ VACUUM ANALYZE;
27
28
/* tuple descs are the same */
28
29
EXPLAIN (COSTS OFF) UPDATE test_updates.test SET b = 0 WHERE val = 1;
29
30
QUERY PLAN
@@ -54,6 +55,35 @@ UPDATE test_updates.test SET b = 0 WHERE val = 101 RETURNING *, tableoid::REGCLA
54
55
101 | 0 | test_updates.test_11
55
56
(1 row)
56
57
58
+ CREATE TABLE test_updates.test_dummy (val INT4);
59
+ EXPLAIN (COSTS OFF) UPDATE test_updates.test SET val = val + 1
60
+ WHERE val = 101 AND val = ANY (TABLE test_updates.test_dummy)
61
+ RETURNING *, tableoid::REGCLASS;
62
+ QUERY PLAN
63
+ ------------------------------------
64
+ Update on test_11
65
+ -> Nested Loop Semi Join
66
+ -> Seq Scan on test_11
67
+ Filter: (val = 101)
68
+ -> Seq Scan on test_dummy
69
+ Filter: (val = 101)
70
+ (6 rows)
71
+
72
+ EXPLAIN (COSTS OFF) UPDATE test_updates.test t1 SET b = 0
73
+ FROM test_updates.test_dummy t2
74
+ WHERE t1.val = 101 AND t1.val = t2.val
75
+ RETURNING t1.*, t1.tableoid::REGCLASS;
76
+ QUERY PLAN
77
+ ---------------------------------------
78
+ Update on test_11 t1
79
+ -> Nested Loop
80
+ -> Seq Scan on test_11 t1
81
+ Filter: (val = 101)
82
+ -> Seq Scan on test_dummy t2
83
+ Filter: (val = 101)
84
+ (6 rows)
85
+
86
+ DROP TABLE test_updates.test_dummy;
57
87
DROP SCHEMA test_updates CASCADE;
58
88
NOTICE: drop cascades to 13 other objects
59
89
DROP EXTENSION pg_pathman;
0 commit comments