Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit26ed609

Browse files
committed
more tests for rebuilt updates
1 parentf6610e6 commit26ed609

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

‎expected/pathman_rebuild_updates.out

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ SELECT append_range_partition('test_updates.test');
2424
(1 row)
2525

2626
INSERT INTO test_updates.test_11 (val, b) VALUES (101, 10);
27+
VACUUM ANALYZE;
2728
/* tuple descs are the same */
2829
EXPLAIN (COSTS OFF) UPDATE test_updates.test SET b = 0 WHERE val = 1;
2930
QUERY PLAN
@@ -54,6 +55,35 @@ UPDATE test_updates.test SET b = 0 WHERE val = 101 RETURNING *, tableoid::REGCLA
5455
101 | 0 | test_updates.test_11
5556
(1 row)
5657

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;
5787
DROP SCHEMA test_updates CASCADE;
5888
NOTICE: drop cascades to 13 other objects
5989
DROP EXTENSION pg_pathman;

‎sql/pathman_rebuild_updates.sql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ SELECT append_range_partition('test_updates.test');
2222
INSERT INTOtest_updates.test_11 (val, b)VALUES (101,10);
2323

2424

25+
VACUUM ANALYZE;
26+
27+
2528
/* tuple descs are the same*/
2629
EXPLAIN (COSTS OFF)UPDATEtest_updates.testSET b=0WHERE val=1;
2730
UPDATEtest_updates.testSET b=0WHERE val=1 RETURNING*, tableoid::REGCLASS;
@@ -31,6 +34,19 @@ UPDATE test_updates.test SET b = 0 WHERE val = 1 RETURNING *, tableoid::REGCLASS
3134
EXPLAIN (COSTS OFF)UPDATEtest_updates.testSET b=0WHERE val=101;
3235
UPDATEtest_updates.testSET b=0WHERE val=101 RETURNING*, tableoid::REGCLASS;
3336

37+
CREATETABLEtest_updates.test_dummy (val INT4);
38+
39+
EXPLAIN (COSTS OFF)UPDATEtest_updates.testSET val= val+1
40+
WHERE val=101AND val= ANY (TABLEtest_updates.test_dummy)
41+
RETURNING*, tableoid::REGCLASS;
42+
43+
EXPLAIN (COSTS OFF)UPDATEtest_updates.test t1SET b=0
44+
FROMtest_updates.test_dummy t2
45+
WHEREt1.val=101ANDt1.val=t2.val
46+
RETURNING t1.*,t1.tableoid::REGCLASS;
47+
48+
DROPTABLEtest_updates.test_dummy;
49+
3450

3551

3652
DROPSCHEMA test_updates CASCADE;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp