• R/O
  • HTTP
  • SSH
  • HTTPS

pg_hint_plan: コミット

firtst release


コミットメタ情報

リビジョンc7888a113ac952c39af91c2d448f864d06e73837 (tree)
日時2017-07-27 19:13:30
作者Kyotaro Horiguchi <horiguchi.kyotaro@lab....>
コミッターKyotaro Horiguchi

ログメッセージ

Modify expected files.

At 10 beta2, planner seems to get some changes to affect plans used in
regression test. Tentatively modify it just to pass the regression.
Probably it is no problem but should be checked later.

変更サマリ

差分

--- a/expected/pg_hint_plan.out
+++ b/expected/pg_hint_plan.out
@@ -1283,16 +1283,15 @@ error hint:
12831283 (3 rows)
12841284
12851285 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1286- QUERY PLAN
1287------------------------------------------------
1286+ QUERY PLAN
1287+-----------------------------------------
12881288 Nested Loop
12891289 Join Filter: (t1.id = t2.id)
12901290 -> Tid Scan on t1
12911291 TID Cond: (ctid = '(1,1)'::tid)
1292- -> Materialize
1293- -> Tid Scan on t2
1294- TID Cond: (ctid = '(1,1)'::tid)
1295-(7 rows)
1292+ -> Tid Scan on t2
1293+ TID Cond: (ctid = '(1,1)'::tid)
1294+(6 rows)
12961295
12971296 /*+SeqScan(t1)*/
12981297 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
@@ -1307,10 +1306,10 @@ error hint:
13071306 -----------------------------------------
13081307 Nested Loop
13091308 Join Filter: (t1.id = t2.id)
1310- -> Tid Scan on t2
1311- TID Cond: (ctid = '(1,1)'::tid)
13121309 -> Seq Scan on t1
13131310 Filter: (ctid = '(1,1)'::tid)
1311+ -> Tid Scan on t2
1312+ TID Cond: (ctid = '(1,1)'::tid)
13141313 (6 rows)
13151314
13161315 /*+SeqScan(t2)*/
@@ -1428,10 +1427,10 @@ error hint:
14281427 -----------------------------------------
14291428 Nested Loop
14301429 Join Filter: (t1.id = t2.id)
1431- -> Tid Scan on t2
1432- TID Cond: (ctid = '(1,1)'::tid)
14331430 -> Seq Scan on t1
14341431 Filter: (ctid = '(1,1)'::tid)
1432+ -> Tid Scan on t2
1433+ TID Cond: (ctid = '(1,1)'::tid)
14351434 (6 rows)
14361435
14371436 /*+SeqScan(t1) NoIndexScan(t2)*/
@@ -1448,10 +1447,10 @@ error hint:
14481447 -----------------------------------------
14491448 Nested Loop
14501449 Join Filter: (t1.id = t2.id)
1451- -> Tid Scan on t2
1452- TID Cond: (ctid = '(1,1)'::tid)
14531450 -> Seq Scan on t1
14541451 Filter: (ctid = '(1,1)'::tid)
1452+ -> Tid Scan on t2
1453+ TID Cond: (ctid = '(1,1)'::tid)
14551454 (6 rows)
14561455
14571456 /*+SeqScan(t1) NoBitmapScan(t2)*/
@@ -1468,10 +1467,10 @@ error hint:
14681467 -----------------------------------------
14691468 Nested Loop
14701469 Join Filter: (t1.id = t2.id)
1471- -> Tid Scan on t2
1472- TID Cond: (ctid = '(1,1)'::tid)
14731470 -> Seq Scan on t1
14741471 Filter: (ctid = '(1,1)'::tid)
1472+ -> Tid Scan on t2
1473+ TID Cond: (ctid = '(1,1)'::tid)
14751474 (6 rows)
14761475
14771476 /*+SeqScan(t1) NoTidScan(t2)*/
@@ -1488,10 +1487,10 @@ error hint:
14881487 ---------------------------------------
14891488 Nested Loop
14901489 Join Filter: (t1.id = t2.id)
1491- -> Seq Scan on t2
1492- Filter: (ctid = '(1,1)'::tid)
14931490 -> Seq Scan on t1
14941491 Filter: (ctid = '(1,1)'::tid)
1492+ -> Seq Scan on t2
1493+ Filter: (ctid = '(1,1)'::tid)
14951494 (6 rows)
14961495
14971496 /*+IndexScan(t1)*/
@@ -1946,10 +1945,10 @@ error hint:
19461945 -----------------------------------------
19471946 Nested Loop
19481947 Join Filter: (t1.id = t2.id)
1949- -> Tid Scan on t2
1950- TID Cond: (ctid = '(1,1)'::tid)
19511948 -> Tid Scan on t1
19521949 TID Cond: (ctid = '(1,1)'::tid)
1950+ -> Tid Scan on t2
1951+ TID Cond: (ctid = '(1,1)'::tid)
19531952 (6 rows)
19541953
19551954 /*+TidScan(t2)*/
@@ -2067,10 +2066,10 @@ error hint:
20672066 -----------------------------------------
20682067 Nested Loop
20692068 Join Filter: (t1.id = t2.id)
2070- -> Tid Scan on t2
2071- TID Cond: (ctid = '(1,1)'::tid)
20722069 -> Tid Scan on t1
20732070 TID Cond: (ctid = '(1,1)'::tid)
2071+ -> Tid Scan on t2
2072+ TID Cond: (ctid = '(1,1)'::tid)
20742073 (6 rows)
20752074
20762075 /*+TidScan(t1) NoIndexScan(t2)*/
@@ -2087,10 +2086,10 @@ error hint:
20872086 -----------------------------------------
20882087 Nested Loop
20892088 Join Filter: (t1.id = t2.id)
2090- -> Tid Scan on t2
2091- TID Cond: (ctid = '(1,1)'::tid)
20922089 -> Tid Scan on t1
20932090 TID Cond: (ctid = '(1,1)'::tid)
2091+ -> Tid Scan on t2
2092+ TID Cond: (ctid = '(1,1)'::tid)
20942093 (6 rows)
20952094
20962095 /*+TidScan(t1) NoBitmapScan(t2)*/
@@ -2107,10 +2106,10 @@ error hint:
21072106 -----------------------------------------
21082107 Nested Loop
21092108 Join Filter: (t1.id = t2.id)
2110- -> Tid Scan on t2
2111- TID Cond: (ctid = '(1,1)'::tid)
21122109 -> Tid Scan on t1
21132110 TID Cond: (ctid = '(1,1)'::tid)
2111+ -> Tid Scan on t2
2112+ TID Cond: (ctid = '(1,1)'::tid)
21142113 (6 rows)
21152114
21162115 /*+TidScan(t1) NoTidScan(t2)*/
@@ -2142,16 +2141,15 @@ not used hint:
21422141 duplication hint:
21432142 error hint:
21442143
2145- QUERY PLAN
2146------------------------------------------------
2144+ QUERY PLAN
2145+-----------------------------------------
21472146 Nested Loop
21482147 Join Filter: (t1.id = t2.id)
21492148 -> Tid Scan on t1
21502149 TID Cond: (ctid = '(1,1)'::tid)
2151- -> Materialize
2152- -> Tid Scan on t2
2153- TID Cond: (ctid = '(1,1)'::tid)
2154-(7 rows)
2150+ -> Tid Scan on t2
2151+ TID Cond: (ctid = '(1,1)'::tid)
2152+(6 rows)
21552153
21562154 /*+NoSeqScan(t2)*/
21572155 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
@@ -2162,16 +2160,15 @@ not used hint:
21622160 duplication hint:
21632161 error hint:
21642162
2165- QUERY PLAN
2166------------------------------------------------
2163+ QUERY PLAN
2164+-----------------------------------------
21672165 Nested Loop
21682166 Join Filter: (t1.id = t2.id)
21692167 -> Tid Scan on t1
21702168 TID Cond: (ctid = '(1,1)'::tid)
2171- -> Materialize
2172- -> Tid Scan on t2
2173- TID Cond: (ctid = '(1,1)'::tid)
2174-(7 rows)
2169+ -> Tid Scan on t2
2170+ TID Cond: (ctid = '(1,1)'::tid)
2171+(6 rows)
21752172
21762173 /*+NoSeqScan(t1) SeqScan(t2)*/
21772174 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
@@ -2265,16 +2262,15 @@ not used hint:
22652262 duplication hint:
22662263 error hint:
22672264
2268- QUERY PLAN
2269------------------------------------------------
2265+ QUERY PLAN
2266+-----------------------------------------
22702267 Nested Loop
22712268 Join Filter: (t1.id = t2.id)
22722269 -> Tid Scan on t1
22732270 TID Cond: (ctid = '(1,1)'::tid)
2274- -> Materialize
2275- -> Tid Scan on t2
2276- TID Cond: (ctid = '(1,1)'::tid)
2277-(7 rows)
2271+ -> Tid Scan on t2
2272+ TID Cond: (ctid = '(1,1)'::tid)
2273+(6 rows)
22782274
22792275 /*+NoSeqScan(t1) NoIndexScan(t2)*/
22802276 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
@@ -2286,16 +2282,15 @@ not used hint:
22862282 duplication hint:
22872283 error hint:
22882284
2289- QUERY PLAN
2290------------------------------------------------
2285+ QUERY PLAN
2286+-----------------------------------------
22912287 Nested Loop
22922288 Join Filter: (t1.id = t2.id)
22932289 -> Tid Scan on t1
22942290 TID Cond: (ctid = '(1,1)'::tid)
2295- -> Materialize
2296- -> Tid Scan on t2
2297- TID Cond: (ctid = '(1,1)'::tid)
2298-(7 rows)
2291+ -> Tid Scan on t2
2292+ TID Cond: (ctid = '(1,1)'::tid)
2293+(6 rows)
22992294
23002295 /*+NoSeqScan(t1) NoBitmapScan(t2)*/
23012296 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
@@ -2307,16 +2302,15 @@ not used hint:
23072302 duplication hint:
23082303 error hint:
23092304
2310- QUERY PLAN
2311------------------------------------------------
2305+ QUERY PLAN
2306+-----------------------------------------
23122307 Nested Loop
23132308 Join Filter: (t1.id = t2.id)
23142309 -> Tid Scan on t1
23152310 TID Cond: (ctid = '(1,1)'::tid)
2316- -> Materialize
2317- -> Tid Scan on t2
2318- TID Cond: (ctid = '(1,1)'::tid)
2319-(7 rows)
2311+ -> Tid Scan on t2
2312+ TID Cond: (ctid = '(1,1)'::tid)
2313+(6 rows)
23202314
23212315 /*+NoSeqScan(t1) NoTidScan(t2)*/
23222316 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
@@ -2347,16 +2341,15 @@ not used hint:
23472341 duplication hint:
23482342 error hint:
23492343
2350- QUERY PLAN
2351------------------------------------------------
2344+ QUERY PLAN
2345+-----------------------------------------
23522346 Nested Loop
23532347 Join Filter: (t1.id = t2.id)
23542348 -> Tid Scan on t1
23552349 TID Cond: (ctid = '(1,1)'::tid)
2356- -> Materialize
2357- -> Tid Scan on t2
2358- TID Cond: (ctid = '(1,1)'::tid)
2359-(7 rows)
2350+ -> Tid Scan on t2
2351+ TID Cond: (ctid = '(1,1)'::tid)
2352+(6 rows)
23602353
23612354 /*+NoIndexScan(t2)*/
23622355 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
@@ -2367,16 +2360,15 @@ not used hint:
23672360 duplication hint:
23682361 error hint:
23692362
2370- QUERY PLAN
2371------------------------------------------------
2363+ QUERY PLAN
2364+-----------------------------------------
23722365 Nested Loop
23732366 Join Filter: (t1.id = t2.id)
23742367 -> Tid Scan on t1
23752368 TID Cond: (ctid = '(1,1)'::tid)
2376- -> Materialize
2377- -> Tid Scan on t2
2378- TID Cond: (ctid = '(1,1)'::tid)
2379-(7 rows)
2369+ -> Tid Scan on t2
2370+ TID Cond: (ctid = '(1,1)'::tid)
2371+(6 rows)
23802372
23812373 /*+NoIndexScan(t1) SeqScan(t2)*/
23822374 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
@@ -2470,16 +2462,15 @@ not used hint:
24702462 duplication hint:
24712463 error hint:
24722464
2473- QUERY PLAN
2474------------------------------------------------
2465+ QUERY PLAN
2466+-----------------------------------------
24752467 Nested Loop
24762468 Join Filter: (t1.id = t2.id)
24772469 -> Tid Scan on t1
24782470 TID Cond: (ctid = '(1,1)'::tid)
2479- -> Materialize
2480- -> Tid Scan on t2
2481- TID Cond: (ctid = '(1,1)'::tid)
2482-(7 rows)
2471+ -> Tid Scan on t2
2472+ TID Cond: (ctid = '(1,1)'::tid)
2473+(6 rows)
24832474
24842475 /*+NoIndexScan(t1) NoIndexScan(t2)*/
24852476 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
@@ -2491,16 +2482,15 @@ not used hint:
24912482 duplication hint:
24922483 error hint:
24932484
2494- QUERY PLAN
2495------------------------------------------------
2485+ QUERY PLAN
2486+-----------------------------------------
24962487 Nested Loop
24972488 Join Filter: (t1.id = t2.id)
24982489 -> Tid Scan on t1
24992490 TID Cond: (ctid = '(1,1)'::tid)
2500- -> Materialize
2501- -> Tid Scan on t2
2502- TID Cond: (ctid = '(1,1)'::tid)
2503-(7 rows)
2491+ -> Tid Scan on t2
2492+ TID Cond: (ctid = '(1,1)'::tid)
2493+(6 rows)
25042494
25052495 /*+NoIndexScan(t1) NoBitmapScan(t2)*/
25062496 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
@@ -2512,16 +2502,15 @@ not used hint:
25122502 duplication hint:
25132503 error hint:
25142504
2515- QUERY PLAN
2516------------------------------------------------
2505+ QUERY PLAN
2506+-----------------------------------------
25172507 Nested Loop
25182508 Join Filter: (t1.id = t2.id)
25192509 -> Tid Scan on t1
25202510 TID Cond: (ctid = '(1,1)'::tid)
2521- -> Materialize
2522- -> Tid Scan on t2
2523- TID Cond: (ctid = '(1,1)'::tid)
2524-(7 rows)
2511+ -> Tid Scan on t2
2512+ TID Cond: (ctid = '(1,1)'::tid)
2513+(6 rows)
25252514
25262515 /*+NoIndexScan(t1) NoTidScan(t2)*/
25272516 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
@@ -2552,16 +2541,15 @@ not used hint:
25522541 duplication hint:
25532542 error hint:
25542543
2555- QUERY PLAN
2556------------------------------------------------
2544+ QUERY PLAN
2545+-----------------------------------------
25572546 Nested Loop
25582547 Join Filter: (t1.id = t2.id)
25592548 -> Tid Scan on t1
25602549 TID Cond: (ctid = '(1,1)'::tid)
2561- -> Materialize
2562- -> Tid Scan on t2
2563- TID Cond: (ctid = '(1,1)'::tid)
2564-(7 rows)
2550+ -> Tid Scan on t2
2551+ TID Cond: (ctid = '(1,1)'::tid)
2552+(6 rows)
25652553
25662554 /*+NoBitmapScan(t2)*/
25672555 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
@@ -2572,16 +2560,15 @@ not used hint:
25722560 duplication hint:
25732561 error hint:
25742562
2575- QUERY PLAN
2576------------------------------------------------
2563+ QUERY PLAN
2564+-----------------------------------------
25772565 Nested Loop
25782566 Join Filter: (t1.id = t2.id)
25792567 -> Tid Scan on t1
25802568 TID Cond: (ctid = '(1,1)'::tid)
2581- -> Materialize
2582- -> Tid Scan on t2
2583- TID Cond: (ctid = '(1,1)'::tid)
2584-(7 rows)
2569+ -> Tid Scan on t2
2570+ TID Cond: (ctid = '(1,1)'::tid)
2571+(6 rows)
25852572
25862573 /*+NoBitmapScan(t1) SeqScan(t2)*/
25872574 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
@@ -2675,16 +2662,15 @@ not used hint:
26752662 duplication hint:
26762663 error hint:
26772664
2678- QUERY PLAN
2679------------------------------------------------
2665+ QUERY PLAN
2666+-----------------------------------------
26802667 Nested Loop
26812668 Join Filter: (t1.id = t2.id)
26822669 -> Tid Scan on t1
26832670 TID Cond: (ctid = '(1,1)'::tid)
2684- -> Materialize
2685- -> Tid Scan on t2
2686- TID Cond: (ctid = '(1,1)'::tid)
2687-(7 rows)
2671+ -> Tid Scan on t2
2672+ TID Cond: (ctid = '(1,1)'::tid)
2673+(6 rows)
26882674
26892675 /*+NoBitmapScan(t1) NoIndexScan(t2)*/
26902676 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
@@ -2696,16 +2682,15 @@ not used hint:
26962682 duplication hint:
26972683 error hint:
26982684
2699- QUERY PLAN
2700------------------------------------------------
2685+ QUERY PLAN
2686+-----------------------------------------
27012687 Nested Loop
27022688 Join Filter: (t1.id = t2.id)
27032689 -> Tid Scan on t1
27042690 TID Cond: (ctid = '(1,1)'::tid)
2705- -> Materialize
2706- -> Tid Scan on t2
2707- TID Cond: (ctid = '(1,1)'::tid)
2708-(7 rows)
2691+ -> Tid Scan on t2
2692+ TID Cond: (ctid = '(1,1)'::tid)
2693+(6 rows)
27092694
27102695 /*+NoBitmapScan(t1) NoBitmapScan(t2)*/
27112696 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
@@ -2717,16 +2702,15 @@ not used hint:
27172702 duplication hint:
27182703 error hint:
27192704
2720- QUERY PLAN
2721------------------------------------------------
2705+ QUERY PLAN
2706+-----------------------------------------
27222707 Nested Loop
27232708 Join Filter: (t1.id = t2.id)
27242709 -> Tid Scan on t1
27252710 TID Cond: (ctid = '(1,1)'::tid)
2726- -> Materialize
2727- -> Tid Scan on t2
2728- TID Cond: (ctid = '(1,1)'::tid)
2729-(7 rows)
2711+ -> Tid Scan on t2
2712+ TID Cond: (ctid = '(1,1)'::tid)
2713+(6 rows)
27302714
27312715 /*+NoBitmapScan(t1) NoTidScan(t2)*/
27322716 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
@@ -2950,18 +2934,17 @@ error hint:
29502934
29512935 -- additional test
29522936 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)' AND t1.id < 10 AND t2.id < 10;
2953- QUERY PLAN
2954------------------------------------------------
2937+ QUERY PLAN
2938+-----------------------------------------
29552939 Nested Loop
29562940 Join Filter: (t1.id = t2.id)
29572941 -> Tid Scan on t1
29582942 TID Cond: (ctid = '(1,1)'::tid)
29592943 Filter: (id < 10)
2960- -> Materialize
2961- -> Tid Scan on t2
2962- TID Cond: (ctid = '(1,1)'::tid)
2963- Filter: (id < 10)
2964-(9 rows)
2944+ -> Tid Scan on t2
2945+ TID Cond: (ctid = '(1,1)'::tid)
2946+ Filter: (id < 10)
2947+(8 rows)
29652948
29662949 /*+BitmapScan(t1) BitmapScan(t2)*/
29672950 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)' AND t1.id < 10 AND t2.id < 10;
@@ -3616,32 +3599,32 @@ not used hint:
36163599 duplication hint:
36173600 error hint:
36183601
3619- QUERY PLAN
3620------------------------------------------------------------------------------------
3602+ QUERY PLAN
3603+-----------------------------------------------------------------------------
36213604 Nested Loop
36223605 Join Filter: (p1.id = t1.id)
3623- -> Index Scan using t1_pkey on t1
3624- Index Cond: (id < 10)
3606+ -> Append
3607+ -> Seq Scan on p1
3608+ Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3609+ -> Seq Scan on p1_c1
3610+ Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3611+ -> Seq Scan on p1_c2
3612+ Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3613+ -> Seq Scan on p1_c3
3614+ Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3615+ -> Seq Scan on p1_c4
3616+ Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3617+ -> Seq Scan on p1_c1_c1
3618+ Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3619+ -> Seq Scan on p1_c1_c2
3620+ Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3621+ -> Seq Scan on p1_c3_c1
3622+ Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3623+ -> Seq Scan on p1_c3_c2
3624+ Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
36253625 -> Materialize
3626- -> Append
3627- -> Seq Scan on p1
3628- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3629- -> Seq Scan on p1_c1
3630- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3631- -> Seq Scan on p1_c2
3632- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3633- -> Seq Scan on p1_c3
3634- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3635- -> Seq Scan on p1_c4
3636- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3637- -> Seq Scan on p1_c1_c1
3638- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3639- -> Seq Scan on p1_c1_c2
3640- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3641- -> Seq Scan on p1_c3_c1
3642- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3643- -> Seq Scan on p1_c3_c2
3644- Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3626+ -> Index Scan using t1_pkey on t1
3627+ Index Cond: (id < 10)
36453628 (24 rows)
36463629
36473630 /*+MergeJoin(p1 t1)*/
@@ -4028,10 +4011,10 @@ error hint:
40284011 -----------------------------------------------------------------------
40294012 Nested Loop
40304013 Join Filter: (p1.id = t1.id)
4031- -> Index Scan using t1_pkey on t1
4032- Index Cond: (id < 10)
40334014 -> Seq Scan on p1
40344015 Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4016+ -> Index Scan using t1_pkey on t1
4017+ Index Cond: (id < 10)
40354018 (6 rows)
40364019
40374020 /*+MergeJoin(p1 t1)*/
@@ -4154,10 +4137,10 @@ error hint:
41544137 -----------------------------------------------------------------------
41554138 Nested Loop
41564139 Join Filter: (p1.id = t1.id)
4157- -> Index Scan using t1_pkey on t1
4158- Index Cond: (id < 10)
41594140 -> Seq Scan on p1
41604141 Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4142+ -> Index Scan using t1_pkey on t1
4143+ Index Cond: (id < 10)
41614144 (6 rows)
41624145
41634146 /*+MergeJoin(p1 t1)*/
@@ -4207,10 +4190,10 @@ EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 5
42074190 -----------------------------------------------------------------------
42084191 Nested Loop
42094192 Join Filter: (p1.id = t1.id)
4210- -> Index Scan using t1_pkey on t1
4211- Index Cond: (id < 10)
42124193 -> Seq Scan on p1
42134194 Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4195+ -> Index Scan using t1_pkey on t1
4196+ Index Cond: (id < 10)
42144197 (6 rows)
42154198
42164199 SET constraint_exclusion TO on;
@@ -4219,10 +4202,10 @@ EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 5
42194202 -----------------------------------------------------------------------
42204203 Nested Loop
42214204 Join Filter: (p1.id = t1.id)
4222- -> Index Scan using t1_pkey on t1
4223- Index Cond: (id < 10)
42244205 -> Seq Scan on p1
42254206 Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4207+ -> Index Scan using t1_pkey on t1
4208+ Index Cond: (id < 10)
42264209 (6 rows)
42274210
42284211 SET constraint_exclusion TO off;
@@ -4239,10 +4222,10 @@ error hint:
42394222 -----------------------------------------------------------------------
42404223 Nested Loop
42414224 Join Filter: (p1.id = t1.id)
4242- -> Index Scan using t1_pkey on t1
4243- Index Cond: (id < 10)
42444225 -> Seq Scan on p1
42454226 Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4227+ -> Index Scan using t1_pkey on t1
4228+ Index Cond: (id < 10)
42464229 (6 rows)
42474230
42484231 /*+IndexScan(p1)*/
@@ -4274,19 +4257,18 @@ not used hint:
42744257 duplication hint:
42754258 error hint:
42764259
4277- QUERY PLAN
4278--------------------------------------------------------------
4260+ QUERY PLAN
4261+-------------------------------------------------------
42794262 Nested Loop
42804263 Join Filter: (p1.id = t1.id)
4264+ -> Bitmap Heap Scan on p1
4265+ Recheck Cond: ((id >= 50) AND (id <= 51))
4266+ Filter: (ctid = '(1,1)'::tid)
4267+ -> Bitmap Index Scan on p1_pkey
4268+ Index Cond: ((id >= 50) AND (id <= 51))
42814269 -> Index Scan using t1_pkey on t1
42824270 Index Cond: (id < 10)
4283- -> Materialize
4284- -> Bitmap Heap Scan on p1
4285- Recheck Cond: ((id >= 50) AND (id <= 51))
4286- Filter: (ctid = '(1,1)'::tid)
4287- -> Bitmap Index Scan on p1_pkey
4288- Index Cond: ((id >= 50) AND (id <= 51))
4289-(10 rows)
4271+(9 rows)
42904272
42914273 /*+TidScan(p1)*/
42924274 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
@@ -4297,17 +4279,16 @@ not used hint:
42974279 duplication hint:
42984280 error hint:
42994281
4300- QUERY PLAN
4301----------------------------------------------------
4282+ QUERY PLAN
4283+---------------------------------------------
43024284 Nested Loop
43034285 Join Filter: (p1.id = t1.id)
4286+ -> Tid Scan on p1
4287+ TID Cond: (ctid = '(1,1)'::tid)
4288+ Filter: ((id >= 50) AND (id <= 51))
43044289 -> Index Scan using t1_pkey on t1
43054290 Index Cond: (id < 10)
4306- -> Materialize
4307- -> Tid Scan on p1
4308- TID Cond: (ctid = '(1,1)'::tid)
4309- Filter: ((id >= 50) AND (id <= 51))
4310-(8 rows)
4291+(7 rows)
43114292
43124293 SET constraint_exclusion TO on;
43134294 /*+SeqScan(p1)*/
@@ -4323,10 +4304,10 @@ error hint:
43234304 -----------------------------------------------------------------------
43244305 Nested Loop
43254306 Join Filter: (p1.id = t1.id)
4326- -> Index Scan using t1_pkey on t1
4327- Index Cond: (id < 10)
43284307 -> Seq Scan on p1
43294308 Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4309+ -> Index Scan using t1_pkey on t1
4310+ Index Cond: (id < 10)
43304311 (6 rows)
43314312
43324313 /*+IndexScan(p1)*/
@@ -4358,19 +4339,18 @@ not used hint:
43584339 duplication hint:
43594340 error hint:
43604341
4361- QUERY PLAN
4362--------------------------------------------------------------
4342+ QUERY PLAN
4343+-------------------------------------------------------
43634344 Nested Loop
43644345 Join Filter: (p1.id = t1.id)
4346+ -> Bitmap Heap Scan on p1
4347+ Recheck Cond: ((id >= 50) AND (id <= 51))
4348+ Filter: (ctid = '(1,1)'::tid)
4349+ -> Bitmap Index Scan on p1_pkey
4350+ Index Cond: ((id >= 50) AND (id <= 51))
43654351 -> Index Scan using t1_pkey on t1
43664352 Index Cond: (id < 10)
4367- -> Materialize
4368- -> Bitmap Heap Scan on p1
4369- Recheck Cond: ((id >= 50) AND (id <= 51))
4370- Filter: (ctid = '(1,1)'::tid)
4371- -> Bitmap Index Scan on p1_pkey
4372- Index Cond: ((id >= 50) AND (id <= 51))
4373-(10 rows)
4353+(9 rows)
43744354
43754355 /*+TidScan(p1)*/
43764356 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
@@ -4381,17 +4361,16 @@ not used hint:
43814361 duplication hint:
43824362 error hint:
43834363
4384- QUERY PLAN
4385----------------------------------------------------
4364+ QUERY PLAN
4365+---------------------------------------------
43864366 Nested Loop
43874367 Join Filter: (p1.id = t1.id)
4368+ -> Tid Scan on p1
4369+ TID Cond: (ctid = '(1,1)'::tid)
4370+ Filter: ((id >= 50) AND (id <= 51))
43884371 -> Index Scan using t1_pkey on t1
43894372 Index Cond: (id < 10)
4390- -> Materialize
4391- -> Tid Scan on p1
4392- TID Cond: (ctid = '(1,1)'::tid)
4393- Filter: ((id >= 50) AND (id <= 51))
4394-(8 rows)
4373+(7 rows)
43954374
43964375 -- quote test
43974376 /*+SeqScan("""t1 ) ")IndexScan("t 2 """)HashJoin("""t1 ) "T3"t 2 """)Leading("""t1 ) "T3"t 2 """)Set(application_name"a a a"" a A")*/
@@ -6086,6 +6065,7 @@ error hint:
60866065 QUERY PLAN
60876066 --------------------------------------------------
60886067 Nested Loop
6068+ Join Filter: (t3.id = t4.id)
60896069 -> Nested Loop
60906070 Join Filter: (t1.val = t3.val)
60916071 -> Hash Join
@@ -6095,8 +6075,7 @@ error hint:
60956075 -> Hash
60966076 -> Seq Scan on t2
60976077 -> Seq Scan on t3
6098- -> Index Scan using t4_pkey on t4
6099- Index Cond: (id = t3.id)
6078+ -> Seq Scan on t4
61006079 (12 rows)
61016080
61026081 /*+Leading(((t1 t2) t3)) MergeJoin(t1 t2 t3 t4)*/
--- a/expected/ut-G.out
+++ b/expected/ut-G.out
@@ -13,22 +13,22 @@ EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
1313 Aggregate
1414 -> Nested Loop
1515 Join Filter: (t1.c1 = t4.c1)
16- -> Tid Scan on t4
17- TID Cond: (ctid = '(1,1)'::tid)
1816 -> Nested Loop
1917 Join Filter: (t1.c1 = t3.c1)
20- -> Tid Scan on t3
21- TID Cond: (ctid = '(1,1)'::tid)
2218 -> Nested Loop
2319 Join Filter: (t1.c1 = t2.c1)
24- -> Seq Scan on t2
25- Filter: (ctid = '(1,1)'::tid)
2620 -> Nested Loop
2721 -> Tid Scan on r1
2822 TID Cond: (ctid = '(1,1)'::tid)
2923 Filter: (c1 = 1)
3024 -> Tid Scan on t1
3125 TID Cond: (ctid = '(1,1)'::tid)
26+ -> Seq Scan on t2
27+ Filter: (ctid = '(1,1)'::tid)
28+ -> Tid Scan on t3
29+ TID Cond: (ctid = '(1,1)'::tid)
30+ -> Tid Scan on t4
31+ TID Cond: (ctid = '(1,1)'::tid)
3232 (19 rows)
3333
3434 /*+
@@ -74,22 +74,22 @@ EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
7474 Aggregate
7575 -> Nested Loop
7676 Join Filter: (b1t1.c1 = b1t4.c1)
77- -> Tid Scan on t4 b1t4
78- TID Cond: (ctid = '(1,1)'::tid)
7977 -> Nested Loop
8078 Join Filter: (b1t1.c1 = b1t3.c1)
81- -> Tid Scan on t3 b1t3
82- TID Cond: (ctid = '(1,1)'::tid)
8379 -> Nested Loop
8480 Join Filter: (b1t1.c1 = b1t2.c1)
85- -> Seq Scan on t2 b1t2
86- Filter: (ctid = '(1,1)'::tid)
8781 -> Nested Loop
8882 -> Tid Scan on r1_
8983 TID Cond: (ctid = '(1,1)'::tid)
9084 Filter: (c1 = 1)
9185 -> Tid Scan on t1 b1t1
9286 TID Cond: (ctid = '(1,1)'::tid)
87+ -> Seq Scan on t2 b1t2
88+ Filter: (ctid = '(1,1)'::tid)
89+ -> Tid Scan on t3 b1t3
90+ TID Cond: (ctid = '(1,1)'::tid)
91+ -> Tid Scan on t4 b1t4
92+ TID Cond: (ctid = '(1,1)'::tid)
9393 (19 rows)
9494
9595 /*+
@@ -136,42 +136,42 @@ EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
136136 Aggregate
137137 -> Nested Loop
138138 Join Filter: (t1.c1 = t4.c1)
139- -> Tid Scan on t4
140- TID Cond: (ctid = '(1,1)'::tid)
141139 -> Nested Loop
142140 Join Filter: (t1.c1 = t3.c1)
143- -> Tid Scan on t3
144- TID Cond: (ctid = '(1,1)'::tid)
145141 -> Nested Loop
146142 Join Filter: (t1.c1 = t2.c1)
147- -> Seq Scan on t2
148- Filter: (ctid = '(1,1)'::tid)
149143 -> Nested Loop
150144 -> Tid Scan on r2
151145 TID Cond: (ctid = '(1,1)'::tid)
152146 Filter: (c1 = 1)
153147 -> Tid Scan on t1
154148 TID Cond: (ctid = '(1,1)'::tid)
149+ -> Seq Scan on t2
150+ Filter: (ctid = '(1,1)'::tid)
151+ -> Tid Scan on t3
152+ TID Cond: (ctid = '(1,1)'::tid)
153+ -> Tid Scan on t4
154+ TID Cond: (ctid = '(1,1)'::tid)
155155
156156 Aggregate
157157 -> Nested Loop
158158 Join Filter: (t1.c1 = t4.c1)
159- -> Tid Scan on t4
160- TID Cond: (ctid = '(1,1)'::tid)
161159 -> Nested Loop
162160 Join Filter: (t1.c1 = t3.c1)
163- -> Tid Scan on t3
164- TID Cond: (ctid = '(1,1)'::tid)
165161 -> Nested Loop
166162 Join Filter: (t1.c1 = t2.c1)
167- -> Seq Scan on t2
168- Filter: (ctid = '(1,1)'::tid)
169163 -> Nested Loop
170164 -> Tid Scan on r2
171165 TID Cond: (ctid = '(1,1)'::tid)
172166 Filter: (c1 = 1)
173167 -> Tid Scan on t1
174168 TID Cond: (ctid = '(1,1)'::tid)
169+ -> Seq Scan on t2
170+ Filter: (ctid = '(1,1)'::tid)
171+ -> Tid Scan on t3
172+ TID Cond: (ctid = '(1,1)'::tid)
173+ -> Tid Scan on t4
174+ TID Cond: (ctid = '(1,1)'::tid)
175175 (39 rows)
176176
177177 /*+
@@ -247,42 +247,42 @@ EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
247247 Aggregate
248248 -> Nested Loop
249249 Join Filter: (b1t1.c1 = b1t4.c1)
250- -> Tid Scan on t4 b1t4
251- TID Cond: (ctid = '(1,1)'::tid)
252250 -> Nested Loop
253251 Join Filter: (b1t1.c1 = b1t3.c1)
254- -> Tid Scan on t3 b1t3
255- TID Cond: (ctid = '(1,1)'::tid)
256252 -> Nested Loop
257253 Join Filter: (b1t1.c1 = b1t2.c1)
258- -> Seq Scan on t2 b1t2
259- Filter: (ctid = '(1,1)'::tid)
260254 -> Nested Loop
261255 -> Tid Scan on r2_
262256 TID Cond: (ctid = '(1,1)'::tid)
263257 Filter: (c1 = 1)
264258 -> Tid Scan on t1 b1t1
265259 TID Cond: (ctid = '(1,1)'::tid)
260+ -> Seq Scan on t2 b1t2
261+ Filter: (ctid = '(1,1)'::tid)
262+ -> Tid Scan on t3 b1t3
263+ TID Cond: (ctid = '(1,1)'::tid)
264+ -> Tid Scan on t4 b1t4
265+ TID Cond: (ctid = '(1,1)'::tid)
266266
267267 Aggregate
268268 -> Nested Loop
269269 Join Filter: (b2t1.c1 = b2t4.c1)
270- -> Tid Scan on t4 b2t4
271- TID Cond: (ctid = '(1,1)'::tid)
272270 -> Nested Loop
273271 Join Filter: (b2t1.c1 = b2t3.c1)
274- -> Tid Scan on t3 b2t3
275- TID Cond: (ctid = '(1,1)'::tid)
276272 -> Nested Loop
277273 Join Filter: (b2t1.c1 = b2t2.c1)
278- -> Seq Scan on t2 b2t2
279- Filter: (ctid = '(1,1)'::tid)
280274 -> Nested Loop
281275 -> Tid Scan on r2_
282276 TID Cond: (ctid = '(1,1)'::tid)
283277 Filter: (c1 = 1)
284278 -> Tid Scan on t1 b2t1
285279 TID Cond: (ctid = '(1,1)'::tid)
280+ -> Seq Scan on t2 b2t2
281+ Filter: (ctid = '(1,1)'::tid)
282+ -> Tid Scan on t3 b2t3
283+ TID Cond: (ctid = '(1,1)'::tid)
284+ -> Tid Scan on t4 b2t4
285+ TID Cond: (ctid = '(1,1)'::tid)
286286 (39 rows)
287287
288288 /*+
@@ -359,62 +359,62 @@ EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
359359 Aggregate
360360 -> Nested Loop
361361 Join Filter: (t1.c1 = t4.c1)
362- -> Tid Scan on t4
363- TID Cond: (ctid = '(1,1)'::tid)
364362 -> Nested Loop
365363 Join Filter: (t1.c1 = t3.c1)
366- -> Tid Scan on t3
367- TID Cond: (ctid = '(1,1)'::tid)
368364 -> Nested Loop
369365 Join Filter: (t1.c1 = t2.c1)
370- -> Seq Scan on t2
371- Filter: (ctid = '(1,1)'::tid)
372366 -> Nested Loop
373367 -> Tid Scan on r3
374368 TID Cond: (ctid = '(1,1)'::tid)
375369 Filter: (c1 = 1)
376370 -> Tid Scan on t1
377371 TID Cond: (ctid = '(1,1)'::tid)
372+ -> Seq Scan on t2
373+ Filter: (ctid = '(1,1)'::tid)
374+ -> Tid Scan on t3
375+ TID Cond: (ctid = '(1,1)'::tid)
376+ -> Tid Scan on t4
377+ TID Cond: (ctid = '(1,1)'::tid)
378378
379379 Aggregate
380380 -> Nested Loop
381381 Join Filter: (t1.c1 = t4.c1)
382- -> Tid Scan on t4
383- TID Cond: (ctid = '(1,1)'::tid)
384382 -> Nested Loop
385383 Join Filter: (t1.c1 = t3.c1)
386- -> Tid Scan on t3
387- TID Cond: (ctid = '(1,1)'::tid)
388384 -> Nested Loop
389385 Join Filter: (t1.c1 = t2.c1)
390- -> Seq Scan on t2
391- Filter: (ctid = '(1,1)'::tid)
392386 -> Nested Loop
393387 -> Tid Scan on r3
394388 TID Cond: (ctid = '(1,1)'::tid)
395389 Filter: (c1 = 1)
396390 -> Tid Scan on t1
397391 TID Cond: (ctid = '(1,1)'::tid)
392+ -> Seq Scan on t2
393+ Filter: (ctid = '(1,1)'::tid)
394+ -> Tid Scan on t3
395+ TID Cond: (ctid = '(1,1)'::tid)
396+ -> Tid Scan on t4
397+ TID Cond: (ctid = '(1,1)'::tid)
398398
399399 Aggregate
400400 -> Nested Loop
401401 Join Filter: (t1.c1 = t4.c1)
402- -> Tid Scan on t4
403- TID Cond: (ctid = '(1,1)'::tid)
404402 -> Nested Loop
405403 Join Filter: (t1.c1 = t3.c1)
406- -> Tid Scan on t3
407- TID Cond: (ctid = '(1,1)'::tid)
408404 -> Nested Loop
409405 Join Filter: (t1.c1 = t2.c1)
410- -> Seq Scan on t2
411- Filter: (ctid = '(1,1)'::tid)
412406 -> Nested Loop
413407 -> Tid Scan on r3
414408 TID Cond: (ctid = '(1,1)'::tid)
415409 Filter: (c1 = 1)
416410 -> Tid Scan on t1
417411 TID Cond: (ctid = '(1,1)'::tid)
412+ -> Seq Scan on t2
413+ Filter: (ctid = '(1,1)'::tid)
414+ -> Tid Scan on t3
415+ TID Cond: (ctid = '(1,1)'::tid)
416+ -> Tid Scan on t4
417+ TID Cond: (ctid = '(1,1)'::tid)
418418 (59 rows)
419419
420420 /*+
@@ -520,62 +520,62 @@ EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
520520 Aggregate
521521 -> Nested Loop
522522 Join Filter: (b1t1.c1 = b1t4.c1)
523- -> Tid Scan on t4 b1t4
524- TID Cond: (ctid = '(1,1)'::tid)
525523 -> Nested Loop
526524 Join Filter: (b1t1.c1 = b1t3.c1)
527- -> Tid Scan on t3 b1t3
528- TID Cond: (ctid = '(1,1)'::tid)
529525 -> Nested Loop
530526 Join Filter: (b1t1.c1 = b1t2.c1)
531- -> Seq Scan on t2 b1t2
532- Filter: (ctid = '(1,1)'::tid)
533527 -> Nested Loop
534528 -> Tid Scan on r3_
535529 TID Cond: (ctid = '(1,1)'::tid)
536530 Filter: (c1 = 1)
537531 -> Tid Scan on t1 b1t1
538532 TID Cond: (ctid = '(1,1)'::tid)
533+ -> Seq Scan on t2 b1t2
534+ Filter: (ctid = '(1,1)'::tid)
535+ -> Tid Scan on t3 b1t3
536+ TID Cond: (ctid = '(1,1)'::tid)
537+ -> Tid Scan on t4 b1t4
538+ TID Cond: (ctid = '(1,1)'::tid)
539539
540540 Aggregate
541541 -> Nested Loop
542542 Join Filter: (b2t1.c1 = b2t4.c1)
543- -> Tid Scan on t4 b2t4
544- TID Cond: (ctid = '(1,1)'::tid)
545543 -> Nested Loop
546544 Join Filter: (b2t1.c1 = b2t3.c1)
547- -> Tid Scan on t3 b2t3
548- TID Cond: (ctid = '(1,1)'::tid)
549545 -> Nested Loop
550546 Join Filter: (b2t1.c1 = b2t2.c1)
551- -> Seq Scan on t2 b2t2
552- Filter: (ctid = '(1,1)'::tid)
553547 -> Nested Loop
554548 -> Tid Scan on r3_
555549 TID Cond: (ctid = '(1,1)'::tid)
556550 Filter: (c1 = 1)
557551 -> Tid Scan on t1 b2t1
558552 TID Cond: (ctid = '(1,1)'::tid)
553+ -> Seq Scan on t2 b2t2
554+ Filter: (ctid = '(1,1)'::tid)
555+ -> Tid Scan on t3 b2t3
556+ TID Cond: (ctid = '(1,1)'::tid)
557+ -> Tid Scan on t4 b2t4
558+ TID Cond: (ctid = '(1,1)'::tid)
559559
560560 Aggregate
561561 -> Nested Loop
562562 Join Filter: (b3t1.c1 = b3t4.c1)
563- -> Tid Scan on t4 b3t4
564- TID Cond: (ctid = '(1,1)'::tid)
565563 -> Nested Loop
566564 Join Filter: (b3t1.c1 = b3t3.c1)
567- -> Tid Scan on t3 b3t3
568- TID Cond: (ctid = '(1,1)'::tid)
569565 -> Nested Loop
570566 Join Filter: (b3t1.c1 = b3t2.c1)
571- -> Seq Scan on t2 b3t2
572- Filter: (ctid = '(1,1)'::tid)
573567 -> Nested Loop
574568 -> Tid Scan on r3_
575569 TID Cond: (ctid = '(1,1)'::tid)
576570 Filter: (c1 = 1)
577571 -> Tid Scan on t1 b3t1
578572 TID Cond: (ctid = '(1,1)'::tid)
573+ -> Seq Scan on t2 b3t2
574+ Filter: (ctid = '(1,1)'::tid)
575+ -> Tid Scan on t3 b3t3
576+ TID Cond: (ctid = '(1,1)'::tid)
577+ -> Tid Scan on t4 b3t4
578+ TID Cond: (ctid = '(1,1)'::tid)
579579 (59 rows)
580580
581581 /*+
--- a/expected/ut-J.out
+++ b/expected/ut-J.out
@@ -874,59 +874,56 @@ SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2
874874 )
875875 FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
876876 ;
877- QUERY PLAN
878------------------------------------------------------------------------
877+ QUERY PLAN
878+-------------------------------------------------------------------
879879 Aggregate
880880 InitPlan 1 (returns $0)
881881 -> Aggregate
882882 -> Nested Loop
883883 Join Filter: (b1t1.c1 = b1t4.c1)
884- -> Tid Scan on t4 b1t4
885- TID Cond: (ctid = '(1,1)'::tid)
886884 -> Nested Loop
887885 Join Filter: (b1t1.c1 = b1t3.c1)
888- -> Tid Scan on t3 b1t3
889- TID Cond: (ctid = '(1,1)'::tid)
890886 -> Nested Loop
891887 Join Filter: (b1t1.c1 = b1t2.c1)
892888 -> Tid Scan on t1 b1t1
893889 TID Cond: (ctid = '(1,1)'::tid)
894- -> Materialize
895- -> Seq Scan on t2 b1t2
896- Filter: (ctid = '(1,1)'::tid)
890+ -> Seq Scan on t2 b1t2
891+ Filter: (ctid = '(1,1)'::tid)
892+ -> Tid Scan on t3 b1t3
893+ TID Cond: (ctid = '(1,1)'::tid)
894+ -> Tid Scan on t4 b1t4
895+ TID Cond: (ctid = '(1,1)'::tid)
897896 InitPlan 2 (returns $1)
898897 -> Aggregate
899898 -> Nested Loop
900899 Join Filter: (b2t1.c1 = b2t4.c1)
901- -> Tid Scan on t4 b2t4
902- TID Cond: (ctid = '(1,1)'::tid)
903900 -> Nested Loop
904901 Join Filter: (b2t1.c1 = b2t3.c1)
905- -> Tid Scan on t3 b2t3
906- TID Cond: (ctid = '(1,1)'::tid)
907902 -> Nested Loop
908903 Join Filter: (b2t1.c1 = b2t2.c1)
909904 -> Tid Scan on t1 b2t1
910905 TID Cond: (ctid = '(1,1)'::tid)
911- -> Materialize
912- -> Seq Scan on t2 b2t2
913- Filter: (ctid = '(1,1)'::tid)
906+ -> Seq Scan on t2 b2t2
907+ Filter: (ctid = '(1,1)'::tid)
908+ -> Tid Scan on t3 b2t3
909+ TID Cond: (ctid = '(1,1)'::tid)
910+ -> Tid Scan on t4 b2t4
911+ TID Cond: (ctid = '(1,1)'::tid)
914912 -> Nested Loop
915913 Join Filter: (bmt1.c1 = bmt4.c1)
916- -> Tid Scan on t4 bmt4
917- TID Cond: (ctid = '(1,1)'::tid)
918914 -> Nested Loop
919915 Join Filter: (bmt1.c1 = bmt3.c1)
920- -> Tid Scan on t3 bmt3
921- TID Cond: (ctid = '(1,1)'::tid)
922916 -> Nested Loop
923917 Join Filter: (bmt1.c1 = bmt2.c1)
924918 -> Tid Scan on t1 bmt1
925919 TID Cond: (ctid = '(1,1)'::tid)
926- -> Materialize
927- -> Seq Scan on t2 bmt2
928- Filter: (ctid = '(1,1)'::tid)
929-(50 rows)
920+ -> Seq Scan on t2 bmt2
921+ Filter: (ctid = '(1,1)'::tid)
922+ -> Tid Scan on t3 bmt3
923+ TID Cond: (ctid = '(1,1)'::tid)
924+ -> Tid Scan on t4 bmt4
925+ TID Cond: (ctid = '(1,1)'::tid)
926+(47 rows)
930927
931928 /*+
932929 Leading(bmt1 bmt2 bmt3 bmt4)
@@ -969,8 +966,6 @@ error hint:
969966 -> Aggregate
970967 -> Nested Loop
971968 Join Filter: (b1t2.c1 = b1t1.c1)
972- -> Tid Scan on t1 b1t1
973- TID Cond: (ctid = '(1,1)'::tid)
974969 -> Hash Join
975970 Hash Cond: (b1t4.c1 = b1t2.c1)
976971 -> Tid Scan on t4 b1t4
@@ -986,12 +981,12 @@ error hint:
986981 Sort Key: b1t3.c1
987982 -> Tid Scan on t3 b1t3
988983 TID Cond: (ctid = '(1,1)'::tid)
984+ -> Tid Scan on t1 b1t1
985+ TID Cond: (ctid = '(1,1)'::tid)
989986 InitPlan 2 (returns $1)
990987 -> Aggregate
991988 -> Nested Loop
992989 Join Filter: (b2t1.c1 = b2t2.c1)
993- -> Seq Scan on t2 b2t2
994- Filter: (ctid = '(1,1)'::tid)
995990 -> Hash Join
996991 Hash Cond: (b2t1.c1 = b2t3.c1)
997992 -> Tid Scan on t1 b2t1
@@ -1007,10 +1002,10 @@ error hint:
10071002 Sort Key: b2t4.c1
10081003 -> Tid Scan on t4 b2t4
10091004 TID Cond: (ctid = '(1,1)'::tid)
1005+ -> Seq Scan on t2 b2t2
1006+ Filter: (ctid = '(1,1)'::tid)
10101007 -> Nested Loop
10111008 Join Filter: (bmt1.c1 = bmt4.c1)
1012- -> Tid Scan on t4 bmt4
1013- TID Cond: (ctid = '(1,1)'::tid)
10141009 -> Hash Join
10151010 Hash Cond: (bmt3.c1 = bmt1.c1)
10161011 -> Tid Scan on t3 bmt3
@@ -1026,6 +1021,8 @@ error hint:
10261021 Sort Key: bmt2.c1
10271022 -> Seq Scan on t2 bmt2
10281023 Filter: (ctid = '(1,1)'::tid)
1024+ -> Tid Scan on t4 bmt4
1025+ TID Cond: (ctid = '(1,1)'::tid)
10291026 (62 rows)
10301027
10311028 -- No. J-2-1-2
@@ -1039,76 +1036,72 @@ SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3
10391036 )
10401037 FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
10411038 ;
1042- QUERY PLAN
1043------------------------------------------------------------------------
1039+ QUERY PLAN
1040+-------------------------------------------------------------------
10441041 Aggregate
10451042 InitPlan 1 (returns $0)
10461043 -> Aggregate
10471044 -> Nested Loop
10481045 Join Filter: (b1t1.c1 = b1t4.c1)
1049- -> Tid Scan on t4 b1t4
1050- TID Cond: (ctid = '(1,1)'::tid)
10511046 -> Nested Loop
10521047 Join Filter: (b1t1.c1 = b1t3.c1)
1053- -> Tid Scan on t3 b1t3
1054- TID Cond: (ctid = '(1,1)'::tid)
10551048 -> Nested Loop
10561049 Join Filter: (b1t1.c1 = b1t2.c1)
10571050 -> Tid Scan on t1 b1t1
10581051 TID Cond: (ctid = '(1,1)'::tid)
1059- -> Materialize
1060- -> Seq Scan on t2 b1t2
1061- Filter: (ctid = '(1,1)'::tid)
1052+ -> Seq Scan on t2 b1t2
1053+ Filter: (ctid = '(1,1)'::tid)
1054+ -> Tid Scan on t3 b1t3
1055+ TID Cond: (ctid = '(1,1)'::tid)
1056+ -> Tid Scan on t4 b1t4
1057+ TID Cond: (ctid = '(1,1)'::tid)
10621058 InitPlan 2 (returns $1)
10631059 -> Aggregate
10641060 -> Nested Loop
10651061 Join Filter: (b2t1.c1 = b2t4.c1)
1066- -> Tid Scan on t4 b2t4
1067- TID Cond: (ctid = '(1,1)'::tid)
10681062 -> Nested Loop
10691063 Join Filter: (b2t1.c1 = b2t3.c1)
1070- -> Tid Scan on t3 b2t3
1071- TID Cond: (ctid = '(1,1)'::tid)
10721064 -> Nested Loop
10731065 Join Filter: (b2t1.c1 = b2t2.c1)
10741066 -> Tid Scan on t1 b2t1
10751067 TID Cond: (ctid = '(1,1)'::tid)
1076- -> Materialize
1077- -> Seq Scan on t2 b2t2
1078- Filter: (ctid = '(1,1)'::tid)
1068+ -> Seq Scan on t2 b2t2
1069+ Filter: (ctid = '(1,1)'::tid)
1070+ -> Tid Scan on t3 b2t3
1071+ TID Cond: (ctid = '(1,1)'::tid)
1072+ -> Tid Scan on t4 b2t4
1073+ TID Cond: (ctid = '(1,1)'::tid)
10791074 InitPlan 3 (returns $2)
10801075 -> Aggregate
10811076 -> Nested Loop
10821077 Join Filter: (b3t1.c1 = b3t4.c1)
1083- -> Tid Scan on t4 b3t4
1084- TID Cond: (ctid = '(1,1)'::tid)
10851078 -> Nested Loop
10861079 Join Filter: (b3t1.c1 = b3t3.c1)
1087- -> Tid Scan on t3 b3t3
1088- TID Cond: (ctid = '(1,1)'::tid)
10891080 -> Nested Loop
10901081 Join Filter: (b3t1.c1 = b3t2.c1)
10911082 -> Tid Scan on t1 b3t1
10921083 TID Cond: (ctid = '(1,1)'::tid)
1093- -> Materialize
1094- -> Seq Scan on t2 b3t2
1095- Filter: (ctid = '(1,1)'::tid)
1084+ -> Seq Scan on t2 b3t2
1085+ Filter: (ctid = '(1,1)'::tid)
1086+ -> Tid Scan on t3 b3t3
1087+ TID Cond: (ctid = '(1,1)'::tid)
1088+ -> Tid Scan on t4 b3t4
1089+ TID Cond: (ctid = '(1,1)'::tid)
10961090 -> Nested Loop
10971091 Join Filter: (bmt1.c1 = bmt4.c1)
1098- -> Tid Scan on t4 bmt4
1099- TID Cond: (ctid = '(1,1)'::tid)
11001092 -> Nested Loop
11011093 Join Filter: (bmt1.c1 = bmt3.c1)
1102- -> Tid Scan on t3 bmt3
1103- TID Cond: (ctid = '(1,1)'::tid)
11041094 -> Nested Loop
11051095 Join Filter: (bmt1.c1 = bmt2.c1)
11061096 -> Tid Scan on t1 bmt1
11071097 TID Cond: (ctid = '(1,1)'::tid)
1108- -> Materialize
1109- -> Seq Scan on t2 bmt2
1110- Filter: (ctid = '(1,1)'::tid)
1111-(67 rows)
1098+ -> Seq Scan on t2 bmt2
1099+ Filter: (ctid = '(1,1)'::tid)
1100+ -> Tid Scan on t3 bmt3
1101+ TID Cond: (ctid = '(1,1)'::tid)
1102+ -> Tid Scan on t4 bmt4
1103+ TID Cond: (ctid = '(1,1)'::tid)
1104+(63 rows)
11121105
11131106 /*+
11141107 Leading(bmt1 bmt2 bmt3 bmt4)
@@ -1159,8 +1152,6 @@ error hint:
11591152 -> Aggregate
11601153 -> Nested Loop
11611154 Join Filter: (b1t2.c1 = b1t1.c1)
1162- -> Tid Scan on t1 b1t1
1163- TID Cond: (ctid = '(1,1)'::tid)
11641155 -> Hash Join
11651156 Hash Cond: (b1t4.c1 = b1t2.c1)
11661157 -> Tid Scan on t4 b1t4
@@ -1176,12 +1167,12 @@ error hint:
11761167 Sort Key: b1t3.c1
11771168 -> Tid Scan on t3 b1t3
11781169 TID Cond: (ctid = '(1,1)'::tid)
1170+ -> Tid Scan on t1 b1t1
1171+ TID Cond: (ctid = '(1,1)'::tid)
11791172 InitPlan 2 (returns $1)
11801173 -> Aggregate
11811174 -> Nested Loop
11821175 Join Filter: (b2t1.c1 = b2t2.c1)
1183- -> Seq Scan on t2 b2t2
1184- Filter: (ctid = '(1,1)'::tid)
11851176 -> Hash Join
11861177 Hash Cond: (b2t1.c1 = b2t3.c1)
11871178 -> Tid Scan on t1 b2t1
@@ -1197,12 +1188,12 @@ error hint:
11971188 Sort Key: b2t4.c1
11981189 -> Tid Scan on t4 b2t4
11991190 TID Cond: (ctid = '(1,1)'::tid)
1191+ -> Seq Scan on t2 b2t2
1192+ Filter: (ctid = '(1,1)'::tid)
12001193 InitPlan 3 (returns $2)
12011194 -> Aggregate
12021195 -> Nested Loop
12031196 Join Filter: (b3t1.c1 = b3t3.c1)
1204- -> Tid Scan on t3 b3t3
1205- TID Cond: (ctid = '(1,1)'::tid)
12061197 -> Hash Join
12071198 Hash Cond: (b3t2.c1 = b3t1.c1)
12081199 -> Seq Scan on t2 b3t2
@@ -1218,10 +1209,10 @@ error hint:
12181209 Sort Key: b3t4.c1
12191210 -> Tid Scan on t4 b3t4
12201211 TID Cond: (ctid = '(1,1)'::tid)
1212+ -> Tid Scan on t3 b3t3
1213+ TID Cond: (ctid = '(1,1)'::tid)
12211214 -> Nested Loop
12221215 Join Filter: (bmt1.c1 = bmt4.c1)
1223- -> Tid Scan on t4 bmt4
1224- TID Cond: (ctid = '(1,1)'::tid)
12251216 -> Hash Join
12261217 Hash Cond: (bmt3.c1 = bmt1.c1)
12271218 -> Tid Scan on t3 bmt3
@@ -1237,29 +1228,30 @@ error hint:
12371228 Sort Key: bmt2.c1
12381229 -> Seq Scan on t2 bmt2
12391230 Filter: (ctid = '(1,1)'::tid)
1231+ -> Tid Scan on t4 bmt4
1232+ TID Cond: (ctid = '(1,1)'::tid)
12401233 (83 rows)
12411234
12421235 -- No. J-2-1-3
12431236 EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = sbmt3.c1 AND sbmt3.ctid = '(1,1)' AND bmt1.c1 = sbmt4.c1 AND sbmt4.ctid = '(1,1)';
1244- QUERY PLAN
1245----------------------------------------------------------------
1237+ QUERY PLAN
1238+-----------------------------------------------------------
12461239 Aggregate
12471240 -> Nested Loop
12481241 Join Filter: (bmt1.c1 = bmt4.c1)
1249- -> Tid Scan on t4 bmt4
1250- TID Cond: (ctid = '(1,1)'::tid)
12511242 -> Nested Loop
12521243 Join Filter: (bmt1.c1 = bmt3.c1)
1253- -> Tid Scan on t3 bmt3
1254- TID Cond: (ctid = '(1,1)'::tid)
12551244 -> Nested Loop
12561245 Join Filter: (bmt1.c1 = bmt2.c1)
12571246 -> Tid Scan on t1 bmt1
12581247 TID Cond: (ctid = '(1,1)'::tid)
1259- -> Materialize
1260- -> Seq Scan on t2 bmt2
1261- Filter: (ctid = '(1,1)'::tid)
1262-(16 rows)
1248+ -> Seq Scan on t2 bmt2
1249+ Filter: (ctid = '(1,1)'::tid)
1250+ -> Tid Scan on t3 bmt3
1251+ TID Cond: (ctid = '(1,1)'::tid)
1252+ -> Tid Scan on t4 bmt4
1253+ TID Cond: (ctid = '(1,1)'::tid)
1254+(15 rows)
12631255
12641256 /*+
12651257 Leading(bmt4 bmt3 bmt2 bmt1)
@@ -1281,8 +1273,6 @@ error hint:
12811273 Aggregate
12821274 -> Nested Loop
12831275 Join Filter: (bmt2.c1 = bmt1.c1)
1284- -> Tid Scan on t1 bmt1
1285- TID Cond: (ctid = '(1,1)'::tid)
12861276 -> Hash Join
12871277 Hash Cond: (bmt2.c1 = bmt3.c1)
12881278 -> Seq Scan on t2 bmt2
@@ -1298,29 +1288,30 @@ error hint:
12981288 Sort Key: bmt4.c1
12991289 -> Tid Scan on t4 bmt4
13001290 TID Cond: (ctid = '(1,1)'::tid)
1291+ -> Tid Scan on t1 bmt1
1292+ TID Cond: (ctid = '(1,1)'::tid)
13011293 (20 rows)
13021294
13031295 -- No. J-2-1-4
13041296 EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = sbmt2.c1 AND sbmt2.ctid = '(1,1)' AND bmt1.c1 = sbmt3.c1 AND sbmt3.ctid = '(1,1)' AND bmt1.c1 = sbmt4.c1 AND sbmt4.ctid = '(1,1)';
1305- QUERY PLAN
1306----------------------------------------------------------------
1297+ QUERY PLAN
1298+-----------------------------------------------------------
13071299 Aggregate
13081300 -> Nested Loop
13091301 Join Filter: (bmt1.c1 = bmt4.c1)
1310- -> Tid Scan on t4 bmt4
1311- TID Cond: (ctid = '(1,1)'::tid)
13121302 -> Nested Loop
13131303 Join Filter: (bmt1.c1 = bmt3.c1)
1314- -> Tid Scan on t3 bmt3
1315- TID Cond: (ctid = '(1,1)'::tid)
13161304 -> Nested Loop
13171305 Join Filter: (bmt1.c1 = bmt2.c1)
13181306 -> Tid Scan on t1 bmt1
13191307 TID Cond: (ctid = '(1,1)'::tid)
1320- -> Materialize
1321- -> Seq Scan on t2 bmt2
1322- Filter: (ctid = '(1,1)'::tid)
1323-(16 rows)
1308+ -> Seq Scan on t2 bmt2
1309+ Filter: (ctid = '(1,1)'::tid)
1310+ -> Tid Scan on t3 bmt3
1311+ TID Cond: (ctid = '(1,1)'::tid)
1312+ -> Tid Scan on t4 bmt4
1313+ TID Cond: (ctid = '(1,1)'::tid)
1314+(15 rows)
13241315
13251316 /*+
13261317 Leading(bmt4 bmt3 bmt2 bmt1)
@@ -1342,8 +1333,6 @@ error hint:
13421333 Aggregate
13431334 -> Nested Loop
13441335 Join Filter: (bmt2.c1 = bmt1.c1)
1345- -> Tid Scan on t1 bmt1
1346- TID Cond: (ctid = '(1,1)'::tid)
13471336 -> Hash Join
13481337 Hash Cond: (bmt2.c1 = bmt3.c1)
13491338 -> Seq Scan on t2 bmt2
@@ -1359,6 +1348,8 @@ error hint:
13591348 Sort Key: bmt4.c1
13601349 -> Tid Scan on t4 bmt4
13611350 TID Cond: (ctid = '(1,1)'::tid)
1351+ -> Tid Scan on t1 bmt1
1352+ TID Cond: (ctid = '(1,1)'::tid)
13621353 (20 rows)
13631354
13641355 -- No. J-2-1-5
@@ -1370,60 +1361,57 @@ SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1
13701361 SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
13711362 )
13721363 ;
1373- QUERY PLAN
1374------------------------------------------------------------------------
1364+ QUERY PLAN
1365+-------------------------------------------------------------------
13751366 Aggregate
13761367 InitPlan 1 (returns $0)
13771368 -> Aggregate
13781369 -> Nested Loop
13791370 Join Filter: (b1t1.c1 = b1t4.c1)
1380- -> Tid Scan on t4 b1t4
1381- TID Cond: (ctid = '(1,1)'::tid)
13821371 -> Nested Loop
13831372 Join Filter: (b1t1.c1 = b1t3.c1)
1384- -> Tid Scan on t3 b1t3
1385- TID Cond: (ctid = '(1,1)'::tid)
13861373 -> Nested Loop
13871374 Join Filter: (b1t1.c1 = b1t2.c1)
13881375 -> Tid Scan on t1 b1t1
13891376 TID Cond: (ctid = '(1,1)'::tid)
1390- -> Materialize
1391- -> Seq Scan on t2 b1t2
1392- Filter: (ctid = '(1,1)'::tid)
1377+ -> Seq Scan on t2 b1t2
1378+ Filter: (ctid = '(1,1)'::tid)
1379+ -> Tid Scan on t3 b1t3
1380+ TID Cond: (ctid = '(1,1)'::tid)
1381+ -> Tid Scan on t4 b1t4
1382+ TID Cond: (ctid = '(1,1)'::tid)
13931383 InitPlan 2 (returns $1)
13941384 -> Aggregate
13951385 -> Nested Loop
13961386 Join Filter: (b2t1.c1 = b2t4.c1)
1397- -> Tid Scan on t4 b2t4
1398- TID Cond: (ctid = '(1,1)'::tid)
13991387 -> Nested Loop
14001388 Join Filter: (b2t1.c1 = b2t3.c1)
1401- -> Tid Scan on t3 b2t3
1402- TID Cond: (ctid = '(1,1)'::tid)
14031389 -> Nested Loop
14041390 Join Filter: (b2t1.c1 = b2t2.c1)
14051391 -> Tid Scan on t1 b2t1
14061392 TID Cond: (ctid = '(1,1)'::tid)
1407- -> Materialize
1408- -> Seq Scan on t2 b2t2
1409- Filter: (ctid = '(1,1)'::tid)
1393+ -> Seq Scan on t2 b2t2
1394+ Filter: (ctid = '(1,1)'::tid)
1395+ -> Tid Scan on t3 b2t3
1396+ TID Cond: (ctid = '(1,1)'::tid)
1397+ -> Tid Scan on t4 b2t4
1398+ TID Cond: (ctid = '(1,1)'::tid)
14101399 -> Nested Loop
14111400 Join Filter: (bmt1.c1 = bmt4.c1)
1412- -> Tid Scan on t4 bmt4
1413- TID Cond: (ctid = '(1,1)'::tid)
14141401 -> Nested Loop
14151402 Join Filter: (bmt1.c1 = bmt3.c1)
1416- -> Tid Scan on t3 bmt3
1417- TID Cond: (ctid = '(1,1)'::tid)
14181403 -> Nested Loop
14191404 Join Filter: (bmt1.c1 = bmt2.c1)
14201405 -> Tid Scan on t1 bmt1
14211406 TID Cond: (ctid = '(1,1)'::tid)
14221407 Filter: ((c1 <> $0) AND (c1 <> $1))
1423- -> Materialize
1424- -> Seq Scan on t2 bmt2
1425- Filter: (ctid = '(1,1)'::tid)
1426-(51 rows)
1408+ -> Seq Scan on t2 bmt2
1409+ Filter: (ctid = '(1,1)'::tid)
1410+ -> Tid Scan on t3 bmt3
1411+ TID Cond: (ctid = '(1,1)'::tid)
1412+ -> Tid Scan on t4 bmt4
1413+ TID Cond: (ctid = '(1,1)'::tid)
1414+(48 rows)
14271415
14281416 /*+
14291417 Leading(bmt1 bmt2 bmt3 bmt4)
@@ -1466,8 +1454,6 @@ error hint:
14661454 -> Aggregate
14671455 -> Nested Loop
14681456 Join Filter: (b1t2.c1 = b1t1.c1)
1469- -> Tid Scan on t1 b1t1
1470- TID Cond: (ctid = '(1,1)'::tid)
14711457 -> Hash Join
14721458 Hash Cond: (b1t4.c1 = b1t2.c1)
14731459 -> Tid Scan on t4 b1t4
@@ -1483,12 +1469,12 @@ error hint:
14831469 Sort Key: b1t3.c1
14841470 -> Tid Scan on t3 b1t3
14851471 TID Cond: (ctid = '(1,1)'::tid)
1472+ -> Tid Scan on t1 b1t1
1473+ TID Cond: (ctid = '(1,1)'::tid)
14861474 InitPlan 2 (returns $1)
14871475 -> Aggregate
14881476 -> Nested Loop
14891477 Join Filter: (b2t1.c1 = b2t2.c1)
1490- -> Seq Scan on t2 b2t2
1491- Filter: (ctid = '(1,1)'::tid)
14921478 -> Hash Join
14931479 Hash Cond: (b2t1.c1 = b2t3.c1)
14941480 -> Tid Scan on t1 b2t1
@@ -1504,10 +1490,10 @@ error hint:
15041490 Sort Key: b2t4.c1
15051491 -> Tid Scan on t4 b2t4
15061492 TID Cond: (ctid = '(1,1)'::tid)
1493+ -> Seq Scan on t2 b2t2
1494+ Filter: (ctid = '(1,1)'::tid)
15071495 -> Nested Loop
15081496 Join Filter: (bmt1.c1 = bmt4.c1)
1509- -> Tid Scan on t4 bmt4
1510- TID Cond: (ctid = '(1,1)'::tid)
15111497 -> Hash Join
15121498 Hash Cond: (bmt3.c1 = bmt1.c1)
15131499 -> Tid Scan on t3 bmt3
@@ -1524,6 +1510,8 @@ error hint:
15241510 Sort Key: bmt2.c1
15251511 -> Seq Scan on t2 bmt2
15261512 Filter: (ctid = '(1,1)'::tid)
1513+ -> Tid Scan on t4 bmt4
1514+ TID Cond: (ctid = '(1,1)'::tid)
15271515 (63 rows)
15281516
15291517 -- No. J-2-1-6
@@ -1544,70 +1532,66 @@ SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3
15441532 -> Aggregate
15451533 -> Nested Loop
15461534 Join Filter: (b1t1.c1 = b1t4.c1)
1547- -> Tid Scan on t4 b1t4
1548- TID Cond: (ctid = '(1,1)'::tid)
15491535 -> Nested Loop
15501536 Join Filter: (b1t1.c1 = b1t3.c1)
1551- -> Tid Scan on t3 b1t3
1552- TID Cond: (ctid = '(1,1)'::tid)
15531537 -> Nested Loop
15541538 Join Filter: (b1t1.c1 = b1t2.c1)
15551539 -> Tid Scan on t1 b1t1
15561540 TID Cond: (ctid = '(1,1)'::tid)
1557- -> Materialize
1558- -> Seq Scan on t2 b1t2
1559- Filter: (ctid = '(1,1)'::tid)
1541+ -> Seq Scan on t2 b1t2
1542+ Filter: (ctid = '(1,1)'::tid)
1543+ -> Tid Scan on t3 b1t3
1544+ TID Cond: (ctid = '(1,1)'::tid)
1545+ -> Tid Scan on t4 b1t4
1546+ TID Cond: (ctid = '(1,1)'::tid)
15601547 InitPlan 2 (returns $1)
15611548 -> Aggregate
15621549 -> Nested Loop
15631550 Join Filter: (b2t1.c1 = b2t4.c1)
1564- -> Tid Scan on t4 b2t4
1565- TID Cond: (ctid = '(1,1)'::tid)
15661551 -> Nested Loop
15671552 Join Filter: (b2t1.c1 = b2t3.c1)
1568- -> Tid Scan on t3 b2t3
1569- TID Cond: (ctid = '(1,1)'::tid)
15701553 -> Nested Loop
15711554 Join Filter: (b2t1.c1 = b2t2.c1)
15721555 -> Tid Scan on t1 b2t1
15731556 TID Cond: (ctid = '(1,1)'::tid)
1574- -> Materialize
1575- -> Seq Scan on t2 b2t2
1576- Filter: (ctid = '(1,1)'::tid)
1557+ -> Seq Scan on t2 b2t2
1558+ Filter: (ctid = '(1,1)'::tid)
1559+ -> Tid Scan on t3 b2t3
1560+ TID Cond: (ctid = '(1,1)'::tid)
1561+ -> Tid Scan on t4 b2t4
1562+ TID Cond: (ctid = '(1,1)'::tid)
15771563 InitPlan 3 (returns $2)
15781564 -> Aggregate
15791565 -> Nested Loop
15801566 Join Filter: (b3t1.c1 = b3t4.c1)
1581- -> Tid Scan on t4 b3t4
1582- TID Cond: (ctid = '(1,1)'::tid)
15831567 -> Nested Loop
15841568 Join Filter: (b3t1.c1 = b3t3.c1)
1585- -> Tid Scan on t3 b3t3
1586- TID Cond: (ctid = '(1,1)'::tid)
15871569 -> Nested Loop
15881570 Join Filter: (b3t1.c1 = b3t2.c1)
15891571 -> Tid Scan on t1 b3t1
15901572 TID Cond: (ctid = '(1,1)'::tid)
1591- -> Materialize
1592- -> Seq Scan on t2 b3t2
1593- Filter: (ctid = '(1,1)'::tid)
1573+ -> Seq Scan on t2 b3t2
1574+ Filter: (ctid = '(1,1)'::tid)
1575+ -> Tid Scan on t3 b3t3
1576+ TID Cond: (ctid = '(1,1)'::tid)
1577+ -> Tid Scan on t4 b3t4
1578+ TID Cond: (ctid = '(1,1)'::tid)
15941579 -> Nested Loop
15951580 Join Filter: (bmt1.c1 = bmt4.c1)
1596- -> Tid Scan on t4 bmt4
1597- TID Cond: (ctid = '(1,1)'::tid)
15981581 -> Nested Loop
15991582 Join Filter: (bmt1.c1 = bmt3.c1)
1600- -> Tid Scan on t3 bmt3
1601- TID Cond: (ctid = '(1,1)'::tid)
16021583 -> Nested Loop
16031584 Join Filter: (bmt1.c1 = bmt2.c1)
16041585 -> Tid Scan on t1 bmt1
16051586 TID Cond: (ctid = '(1,1)'::tid)
16061587 Filter: ((c1 <> $0) AND (c1 <> $1) AND (c1 <> $2))
1607- -> Materialize
1608- -> Seq Scan on t2 bmt2
1609- Filter: (ctid = '(1,1)'::tid)
1610-(68 rows)
1588+ -> Seq Scan on t2 bmt2
1589+ Filter: (ctid = '(1,1)'::tid)
1590+ -> Tid Scan on t3 bmt3
1591+ TID Cond: (ctid = '(1,1)'::tid)
1592+ -> Tid Scan on t4 bmt4
1593+ TID Cond: (ctid = '(1,1)'::tid)
1594+(64 rows)
16111595
16121596 /*+
16131597 Leading(bmt1 bmt2 bmt3 bmt4)
@@ -1658,8 +1642,6 @@ error hint:
16581642 -> Aggregate
16591643 -> Nested Loop
16601644 Join Filter: (b1t2.c1 = b1t1.c1)
1661- -> Tid Scan on t1 b1t1
1662- TID Cond: (ctid = '(1,1)'::tid)
16631645 -> Hash Join
16641646 Hash Cond: (b1t4.c1 = b1t2.c1)
16651647 -> Tid Scan on t4 b1t4
@@ -1675,12 +1657,12 @@ error hint:
16751657 Sort Key: b1t3.c1
16761658 -> Tid Scan on t3 b1t3
16771659 TID Cond: (ctid = '(1,1)'::tid)
1660+ -> Tid Scan on t1 b1t1
1661+ TID Cond: (ctid = '(1,1)'::tid)
16781662 InitPlan 2 (returns $1)
16791663 -> Aggregate
16801664 -> Nested Loop
16811665 Join Filter: (b2t1.c1 = b2t2.c1)
1682- -> Seq Scan on t2 b2t2
1683- Filter: (ctid = '(1,1)'::tid)
16841666 -> Hash Join
16851667 Hash Cond: (b2t1.c1 = b2t3.c1)
16861668 -> Tid Scan on t1 b2t1
@@ -1696,12 +1678,12 @@ error hint:
16961678 Sort Key: b2t4.c1
16971679 -> Tid Scan on t4 b2t4
16981680 TID Cond: (ctid = '(1,1)'::tid)
1681+ -> Seq Scan on t2 b2t2
1682+ Filter: (ctid = '(1,1)'::tid)
16991683 InitPlan 3 (returns $2)
17001684 -> Aggregate
17011685 -> Nested Loop
17021686 Join Filter: (b3t1.c1 = b3t3.c1)
1703- -> Tid Scan on t3 b3t3
1704- TID Cond: (ctid = '(1,1)'::tid)
17051687 -> Hash Join
17061688 Hash Cond: (b3t2.c1 = b3t1.c1)
17071689 -> Seq Scan on t2 b3t2
@@ -1717,10 +1699,10 @@ error hint:
17171699 Sort Key: b3t4.c1
17181700 -> Tid Scan on t4 b3t4
17191701 TID Cond: (ctid = '(1,1)'::tid)
1702+ -> Tid Scan on t3 b3t3
1703+ TID Cond: (ctid = '(1,1)'::tid)
17201704 -> Nested Loop
17211705 Join Filter: (bmt1.c1 = bmt4.c1)
1722- -> Tid Scan on t4 bmt4
1723- TID Cond: (ctid = '(1,1)'::tid)
17241706 -> Hash Join
17251707 Hash Cond: (bmt3.c1 = bmt1.c1)
17261708 -> Tid Scan on t3 bmt3
@@ -1737,6 +1719,8 @@ error hint:
17371719 Sort Key: bmt2.c1
17381720 -> Seq Scan on t2 bmt2
17391721 Filter: (ctid = '(1,1)'::tid)
1722+ -> Tid Scan on t4 bmt4
1723+ TID Cond: (ctid = '(1,1)'::tid)
17401724 (84 rows)
17411725
17421726 -- No. J-2-1-7
@@ -1760,57 +1744,55 @@ AND bmt1.c1 = c2.c1
17601744 -> Aggregate
17611745 -> Nested Loop
17621746 Join Filter: (b1t1.c1 = b1t4.c1)
1763- -> Tid Scan on t4 b1t4
1764- TID Cond: (ctid = '(1,1)'::tid)
17651747 -> Nested Loop
17661748 Join Filter: (b1t1.c1 = b1t3.c1)
1767- -> Tid Scan on t3 b1t3
1768- TID Cond: (ctid = '(1,1)'::tid)
17691749 -> Nested Loop
17701750 Join Filter: (b1t1.c1 = b1t2.c1)
17711751 -> Tid Scan on t1 b1t1
17721752 TID Cond: (ctid = '(1,1)'::tid)
1773- -> Materialize
1774- -> Seq Scan on t2 b1t2
1775- Filter: (ctid = '(1,1)'::tid)
1753+ -> Seq Scan on t2 b1t2
1754+ Filter: (ctid = '(1,1)'::tid)
1755+ -> Tid Scan on t3 b1t3
1756+ TID Cond: (ctid = '(1,1)'::tid)
1757+ -> Tid Scan on t4 b1t4
1758+ TID Cond: (ctid = '(1,1)'::tid)
17761759 CTE c2
17771760 -> Aggregate
17781761 -> Nested Loop
17791762 Join Filter: (b2t1.c1 = b2t4.c1)
1780- -> Tid Scan on t4 b2t4
1781- TID Cond: (ctid = '(1,1)'::tid)
17821763 -> Nested Loop
17831764 Join Filter: (b2t1.c1 = b2t3.c1)
1784- -> Tid Scan on t3 b2t3
1785- TID Cond: (ctid = '(1,1)'::tid)
17861765 -> Nested Loop
17871766 Join Filter: (b2t1.c1 = b2t2.c1)
17881767 -> Tid Scan on t1 b2t1
17891768 TID Cond: (ctid = '(1,1)'::tid)
1790- -> Materialize
1791- -> Seq Scan on t2 b2t2
1792- Filter: (ctid = '(1,1)'::tid)
1769+ -> Seq Scan on t2 b2t2
1770+ Filter: (ctid = '(1,1)'::tid)
1771+ -> Tid Scan on t3 b2t3
1772+ TID Cond: (ctid = '(1,1)'::tid)
1773+ -> Tid Scan on t4 b2t4
1774+ TID Cond: (ctid = '(1,1)'::tid)
17931775 -> Nested Loop
17941776 Join Filter: (bmt1.c1 = c2.c1)
17951777 -> Nested Loop
1796- Join Filter: (bmt1.c1 = bmt4.c1)
1797- -> Tid Scan on t4 bmt4
1798- TID Cond: (ctid = '(1,1)'::tid)
1778+ Join Filter: (bmt1.c1 = c1.c1)
17991779 -> Nested Loop
1800- Join Filter: (bmt1.c1 = bmt3.c1)
1801- -> Tid Scan on t3 bmt3
1802- TID Cond: (ctid = '(1,1)'::tid)
1780+ Join Filter: (bmt1.c1 = bmt4.c1)
18031781 -> Nested Loop
1804- Join Filter: (bmt1.c1 = bmt2.c1)
1805- -> Seq Scan on t2 bmt2
1806- Filter: (ctid = '(1,1)'::tid)
1782+ Join Filter: (bmt1.c1 = bmt3.c1)
18071783 -> Nested Loop
1808- Join Filter: (bmt1.c1 = c1.c1)
1784+ Join Filter: (bmt1.c1 = bmt2.c1)
18091785 -> Tid Scan on t1 bmt1
18101786 TID Cond: (ctid = '(1,1)'::tid)
1811- -> CTE Scan on c1
1787+ -> Seq Scan on t2 bmt2
1788+ Filter: (ctid = '(1,1)'::tid)
1789+ -> Tid Scan on t3 bmt3
1790+ TID Cond: (ctid = '(1,1)'::tid)
1791+ -> Tid Scan on t4 bmt4
1792+ TID Cond: (ctid = '(1,1)'::tid)
1793+ -> CTE Scan on c1
18121794 -> CTE Scan on c2
1813-(55 rows)
1795+(53 rows)
18141796
18151797 /*+
18161798 Leading(c2 c1 bmt1 bmt2 bmt3 bmt4)
@@ -1860,8 +1842,6 @@ error hint:
18601842 -> Aggregate
18611843 -> Nested Loop
18621844 Join Filter: (b1t2.c1 = b1t1.c1)
1863- -> Tid Scan on t1 b1t1
1864- TID Cond: (ctid = '(1,1)'::tid)
18651845 -> Hash Join
18661846 Hash Cond: (b1t4.c1 = b1t2.c1)
18671847 -> Tid Scan on t4 b1t4
@@ -1877,12 +1857,12 @@ error hint:
18771857 Sort Key: b1t3.c1
18781858 -> Tid Scan on t3 b1t3
18791859 TID Cond: (ctid = '(1,1)'::tid)
1860+ -> Tid Scan on t1 b1t1
1861+ TID Cond: (ctid = '(1,1)'::tid)
18801862 CTE c2
18811863 -> Aggregate
18821864 -> Nested Loop
18831865 Join Filter: (b2t1.c1 = b2t2.c1)
1884- -> Seq Scan on t2 b2t2
1885- Filter: (ctid = '(1,1)'::tid)
18861866 -> Hash Join
18871867 Hash Cond: (b2t1.c1 = b2t3.c1)
18881868 -> Tid Scan on t1 b2t1
@@ -1898,6 +1878,8 @@ error hint:
18981878 Sort Key: b2t4.c1
18991879 -> Tid Scan on t4 b2t4
19001880 TID Cond: (ctid = '(1,1)'::tid)
1881+ -> Seq Scan on t2 b2t2
1882+ Filter: (ctid = '(1,1)'::tid)
19011883 -> Hash Join
19021884 Hash Cond: (bmt4.c1 = bmt1.c1)
19031885 -> Tid Scan on t4 bmt4
@@ -1909,8 +1891,6 @@ error hint:
19091891 Sort Key: bmt1.c1
19101892 -> Nested Loop
19111893 Join Filter: (bmt1.c1 = bmt2.c1)
1912- -> Seq Scan on t2 bmt2
1913- Filter: (ctid = '(1,1)'::tid)
19141894 -> Hash Join
19151895 Hash Cond: (bmt1.c1 = c1.c1)
19161896 -> Tid Scan on t1 bmt1
@@ -1924,6 +1904,8 @@ error hint:
19241904 -> Sort
19251905 Sort Key: c2.c1
19261906 -> CTE Scan on c2
1907+ -> Seq Scan on t2 bmt2
1908+ Filter: (ctid = '(1,1)'::tid)
19271909 -> Sort
19281910 Sort Key: bmt3.c1
19291911 -> Tid Scan on t3 bmt3
@@ -1955,77 +1937,74 @@ AND bmt1.c1 = c3.c1
19551937 -> Aggregate
19561938 -> Nested Loop
19571939 Join Filter: (b1t1.c1 = b1t4.c1)
1958- -> Tid Scan on t4 b1t4
1959- TID Cond: (ctid = '(1,1)'::tid)
19601940 -> Nested Loop
19611941 Join Filter: (b1t1.c1 = b1t3.c1)
1962- -> Tid Scan on t3 b1t3
1963- TID Cond: (ctid = '(1,1)'::tid)
19641942 -> Nested Loop
19651943 Join Filter: (b1t1.c1 = b1t2.c1)
19661944 -> Tid Scan on t1 b1t1
19671945 TID Cond: (ctid = '(1,1)'::tid)
1968- -> Materialize
1969- -> Seq Scan on t2 b1t2
1970- Filter: (ctid = '(1,1)'::tid)
1946+ -> Seq Scan on t2 b1t2
1947+ Filter: (ctid = '(1,1)'::tid)
1948+ -> Tid Scan on t3 b1t3
1949+ TID Cond: (ctid = '(1,1)'::tid)
1950+ -> Tid Scan on t4 b1t4
1951+ TID Cond: (ctid = '(1,1)'::tid)
19711952 CTE c2
19721953 -> Aggregate
19731954 -> Nested Loop
19741955 Join Filter: (b2t1.c1 = b2t4.c1)
1975- -> Tid Scan on t4 b2t4
1976- TID Cond: (ctid = '(1,1)'::tid)
19771956 -> Nested Loop
19781957 Join Filter: (b2t1.c1 = b2t3.c1)
1979- -> Tid Scan on t3 b2t3
1980- TID Cond: (ctid = '(1,1)'::tid)
19811958 -> Nested Loop
19821959 Join Filter: (b2t1.c1 = b2t2.c1)
19831960 -> Tid Scan on t1 b2t1
19841961 TID Cond: (ctid = '(1,1)'::tid)
1985- -> Materialize
1986- -> Seq Scan on t2 b2t2
1987- Filter: (ctid = '(1,1)'::tid)
1962+ -> Seq Scan on t2 b2t2
1963+ Filter: (ctid = '(1,1)'::tid)
1964+ -> Tid Scan on t3 b2t3
1965+ TID Cond: (ctid = '(1,1)'::tid)
1966+ -> Tid Scan on t4 b2t4
1967+ TID Cond: (ctid = '(1,1)'::tid)
19881968 CTE c3
19891969 -> Aggregate
19901970 -> Nested Loop
19911971 Join Filter: (b3t1.c1 = b3t4.c1)
1992- -> Tid Scan on t4 b3t4
1993- TID Cond: (ctid = '(1,1)'::tid)
19941972 -> Nested Loop
19951973 Join Filter: (b3t1.c1 = b3t3.c1)
1996- -> Tid Scan on t3 b3t3
1997- TID Cond: (ctid = '(1,1)'::tid)
19981974 -> Nested Loop
19991975 Join Filter: (b3t1.c1 = b3t2.c1)
20001976 -> Tid Scan on t1 b3t1
20011977 TID Cond: (ctid = '(1,1)'::tid)
2002- -> Materialize
2003- -> Seq Scan on t2 b3t2
2004- Filter: (ctid = '(1,1)'::tid)
1978+ -> Seq Scan on t2 b3t2
1979+ Filter: (ctid = '(1,1)'::tid)
1980+ -> Tid Scan on t3 b3t3
1981+ TID Cond: (ctid = '(1,1)'::tid)
1982+ -> Tid Scan on t4 b3t4
1983+ TID Cond: (ctid = '(1,1)'::tid)
20051984 -> Nested Loop
20061985 Join Filter: (bmt1.c1 = c3.c1)
20071986 -> Nested Loop
20081987 Join Filter: (bmt1.c1 = c2.c1)
20091988 -> Nested Loop
2010- Join Filter: (bmt1.c1 = bmt4.c1)
2011- -> Tid Scan on t4 bmt4
2012- TID Cond: (ctid = '(1,1)'::tid)
1989+ Join Filter: (bmt1.c1 = c1.c1)
20131990 -> Nested Loop
2014- Join Filter: (bmt1.c1 = bmt3.c1)
2015- -> Tid Scan on t3 bmt3
2016- TID Cond: (ctid = '(1,1)'::tid)
1991+ Join Filter: (bmt1.c1 = bmt4.c1)
20171992 -> Nested Loop
2018- Join Filter: (bmt1.c1 = bmt2.c1)
2019- -> Seq Scan on t2 bmt2
2020- Filter: (ctid = '(1,1)'::tid)
1993+ Join Filter: (bmt1.c1 = bmt3.c1)
20211994 -> Nested Loop
2022- Join Filter: (bmt1.c1 = c1.c1)
1995+ Join Filter: (bmt1.c1 = bmt2.c1)
20231996 -> Tid Scan on t1 bmt1
20241997 TID Cond: (ctid = '(1,1)'::tid)
2025- -> CTE Scan on c1
1998+ -> Seq Scan on t2 bmt2
1999+ Filter: (ctid = '(1,1)'::tid)
2000+ -> Tid Scan on t3 bmt3
2001+ TID Cond: (ctid = '(1,1)'::tid)
2002+ -> Tid Scan on t4 bmt4
2003+ TID Cond: (ctid = '(1,1)'::tid)
2004+ -> CTE Scan on c1
20262005 -> CTE Scan on c2
20272006 -> CTE Scan on c3
2028-(75 rows)
2007+(72 rows)
20292008
20302009 /*+
20312010 Leading(c3 c2 c1 bmt1 bmt2 bmt3 bmt4)
@@ -2086,8 +2065,6 @@ error hint:
20862065 -> Aggregate
20872066 -> Nested Loop
20882067 Join Filter: (b1t2.c1 = b1t1.c1)
2089- -> Tid Scan on t1 b1t1
2090- TID Cond: (ctid = '(1,1)'::tid)
20912068 -> Hash Join
20922069 Hash Cond: (b1t4.c1 = b1t2.c1)
20932070 -> Tid Scan on t4 b1t4
@@ -2103,12 +2080,12 @@ error hint:
21032080 Sort Key: b1t3.c1
21042081 -> Tid Scan on t3 b1t3
21052082 TID Cond: (ctid = '(1,1)'::tid)
2083+ -> Tid Scan on t1 b1t1
2084+ TID Cond: (ctid = '(1,1)'::tid)
21062085 CTE c2
21072086 -> Aggregate
21082087 -> Nested Loop
21092088 Join Filter: (b2t1.c1 = b2t2.c1)
2110- -> Seq Scan on t2 b2t2
2111- Filter: (ctid = '(1,1)'::tid)
21122089 -> Hash Join
21132090 Hash Cond: (b2t1.c1 = b2t3.c1)
21142091 -> Tid Scan on t1 b2t1
@@ -2124,12 +2101,12 @@ error hint:
21242101 Sort Key: b2t4.c1
21252102 -> Tid Scan on t4 b2t4
21262103 TID Cond: (ctid = '(1,1)'::tid)
2104+ -> Seq Scan on t2 b2t2
2105+ Filter: (ctid = '(1,1)'::tid)
21272106 CTE c3
21282107 -> Aggregate
21292108 -> Nested Loop
21302109 Join Filter: (b3t1.c1 = b3t3.c1)
2131- -> Tid Scan on t3 b3t3
2132- TID Cond: (ctid = '(1,1)'::tid)
21332110 -> Hash Join
21342111 Hash Cond: (b3t2.c1 = b3t1.c1)
21352112 -> Seq Scan on t2 b3t2
@@ -2145,10 +2122,10 @@ error hint:
21452122 Sort Key: b3t4.c1
21462123 -> Tid Scan on t4 b3t4
21472124 TID Cond: (ctid = '(1,1)'::tid)
2125+ -> Tid Scan on t3 b3t3
2126+ TID Cond: (ctid = '(1,1)'::tid)
21482127 -> Nested Loop
21492128 Join Filter: (bmt1.c1 = bmt4.c1)
2150- -> Tid Scan on t4 bmt4
2151- TID Cond: (ctid = '(1,1)'::tid)
21522129 -> Hash Join
21532130 Hash Cond: (bmt3.c1 = bmt1.c1)
21542131 -> Tid Scan on t3 bmt3
@@ -2160,8 +2137,6 @@ error hint:
21602137 Sort Key: bmt1.c1
21612138 -> Nested Loop
21622139 Join Filter: (c1.c1 = bmt1.c1)
2163- -> Tid Scan on t1 bmt1
2164- TID Cond: (ctid = '(1,1)'::tid)
21652140 -> Hash Join
21662141 Hash Cond: (c2.c1 = c1.c1)
21672142 -> Merge Join
@@ -2174,10 +2149,14 @@ error hint:
21742149 -> CTE Scan on c3
21752150 -> Hash
21762151 -> CTE Scan on c1
2152+ -> Tid Scan on t1 bmt1
2153+ TID Cond: (ctid = '(1,1)'::tid)
21772154 -> Sort
21782155 Sort Key: bmt2.c1
21792156 -> Seq Scan on t2 bmt2
21802157 Filter: (ctid = '(1,1)'::tid)
2158+ -> Tid Scan on t4 bmt4
2159+ TID Cond: (ctid = '(1,1)'::tid)
21812160 (97 rows)
21822161
21832162 ----
@@ -2306,8 +2285,8 @@ AND bmt1.c1 <> (
23062285 SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)'
23072286 )
23082287 ;
2309- QUERY PLAN
2310------------------------------------------------------------
2288+ QUERY PLAN
2289+-------------------------------------------------------
23112290 Aggregate
23122291 CTE c1
23132292 -> Aggregate
@@ -2315,38 +2294,35 @@ SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2 WHERE b3t1.ctid = '(1,1)' AND b3
23152294 Join Filter: (b1t1.c1 = b1t2.c1)
23162295 -> Tid Scan on t1 b1t1
23172296 TID Cond: (ctid = '(1,1)'::tid)
2318- -> Materialize
2319- -> Seq Scan on t2 b1t2
2320- Filter: (ctid = '(1,1)'::tid)
2297+ -> Seq Scan on t2 b1t2
2298+ Filter: (ctid = '(1,1)'::tid)
23212299 InitPlan 2 (returns $1)
23222300 -> Aggregate
23232301 -> Nested Loop
23242302 Join Filter: (b2t1.c1 = b2t2.c1)
23252303 -> Tid Scan on t1 b2t1
23262304 TID Cond: (ctid = '(1,1)'::tid)
2327- -> Materialize
2328- -> Seq Scan on t2 b2t2
2329- Filter: (ctid = '(1,1)'::tid)
2305+ -> Seq Scan on t2 b2t2
2306+ Filter: (ctid = '(1,1)'::tid)
23302307 InitPlan 3 (returns $2)
23312308 -> Aggregate
23322309 -> Nested Loop
23332310 Join Filter: (b3t1.c1 = b3t2.c1)
23342311 -> Tid Scan on t1 b3t1
23352312 TID Cond: (ctid = '(1,1)'::tid)
2336- -> Materialize
2337- -> Seq Scan on t2 b3t2
2338- Filter: (ctid = '(1,1)'::tid)
2313+ -> Seq Scan on t2 b3t2
2314+ Filter: (ctid = '(1,1)'::tid)
23392315 -> Nested Loop
2340- Join Filter: (bmt1.c1 = bmt2.c1)
2341- -> Seq Scan on t2 bmt2
2342- Filter: (ctid = '(1,1)'::tid)
2316+ Join Filter: (bmt1.c1 = c1.c1)
23432317 -> Nested Loop
2344- Join Filter: (bmt1.c1 = c1.c1)
2318+ Join Filter: (bmt1.c1 = bmt2.c1)
23452319 -> Tid Scan on t1 bmt1
23462320 TID Cond: (ctid = '(1,1)'::tid)
23472321 Filter: (c1 <> $2)
2348- -> CTE Scan on c1
2349-(38 rows)
2322+ -> Seq Scan on t2 bmt2
2323+ Filter: (ctid = '(1,1)'::tid)
2324+ -> CTE Scan on c1
2325+(35 rows)
23502326
23512327 /*+
23522328 Leading(c1 bmt2 bmt1)
@@ -2456,79 +2432,76 @@ AND bmt1.c1 <> (
24562432 SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
24572433 )
24582434 ;
2459- QUERY PLAN
2460------------------------------------------------------------------------
2435+ QUERY PLAN
2436+-------------------------------------------------------------------
24612437 Aggregate
24622438 CTE c1
24632439 -> Aggregate
24642440 -> Nested Loop
24652441 Join Filter: (b1t1.c1 = b1t4.c1)
2466- -> Tid Scan on t4 b1t4
2467- TID Cond: (ctid = '(1,1)'::tid)
24682442 -> Nested Loop
24692443 Join Filter: (b1t1.c1 = b1t3.c1)
2470- -> Tid Scan on t3 b1t3
2471- TID Cond: (ctid = '(1,1)'::tid)
24722444 -> Nested Loop
24732445 Join Filter: (b1t1.c1 = b1t2.c1)
24742446 -> Tid Scan on t1 b1t1
24752447 TID Cond: (ctid = '(1,1)'::tid)
2476- -> Materialize
2477- -> Seq Scan on t2 b1t2
2478- Filter: (ctid = '(1,1)'::tid)
2448+ -> Seq Scan on t2 b1t2
2449+ Filter: (ctid = '(1,1)'::tid)
2450+ -> Tid Scan on t3 b1t3
2451+ TID Cond: (ctid = '(1,1)'::tid)
2452+ -> Tid Scan on t4 b1t4
2453+ TID Cond: (ctid = '(1,1)'::tid)
24792454 InitPlan 2 (returns $1)
24802455 -> Aggregate
24812456 -> Nested Loop
24822457 Join Filter: (b2t1.c1 = b2t4.c1)
2483- -> Tid Scan on t4 b2t4
2484- TID Cond: (ctid = '(1,1)'::tid)
24852458 -> Nested Loop
24862459 Join Filter: (b2t1.c1 = b2t3.c1)
2487- -> Tid Scan on t3 b2t3
2488- TID Cond: (ctid = '(1,1)'::tid)
24892460 -> Nested Loop
24902461 Join Filter: (b2t1.c1 = b2t2.c1)
24912462 -> Tid Scan on t1 b2t1
24922463 TID Cond: (ctid = '(1,1)'::tid)
2493- -> Materialize
2494- -> Seq Scan on t2 b2t2
2495- Filter: (ctid = '(1,1)'::tid)
2464+ -> Seq Scan on t2 b2t2
2465+ Filter: (ctid = '(1,1)'::tid)
2466+ -> Tid Scan on t3 b2t3
2467+ TID Cond: (ctid = '(1,1)'::tid)
2468+ -> Tid Scan on t4 b2t4
2469+ TID Cond: (ctid = '(1,1)'::tid)
24962470 InitPlan 3 (returns $2)
24972471 -> Aggregate
24982472 -> Nested Loop
24992473 Join Filter: (b3t1.c1 = b3t4.c1)
2500- -> Tid Scan on t4 b3t4
2501- TID Cond: (ctid = '(1,1)'::tid)
25022474 -> Nested Loop
25032475 Join Filter: (b3t1.c1 = b3t3.c1)
2504- -> Tid Scan on t3 b3t3
2505- TID Cond: (ctid = '(1,1)'::tid)
25062476 -> Nested Loop
25072477 Join Filter: (b3t1.c1 = b3t2.c1)
25082478 -> Tid Scan on t1 b3t1
25092479 TID Cond: (ctid = '(1,1)'::tid)
2510- -> Materialize
2511- -> Seq Scan on t2 b3t2
2512- Filter: (ctid = '(1,1)'::tid)
2480+ -> Seq Scan on t2 b3t2
2481+ Filter: (ctid = '(1,1)'::tid)
2482+ -> Tid Scan on t3 b3t3
2483+ TID Cond: (ctid = '(1,1)'::tid)
2484+ -> Tid Scan on t4 b3t4
2485+ TID Cond: (ctid = '(1,1)'::tid)
25132486 -> Nested Loop
2514- Join Filter: (bmt1.c1 = bmt4.c1)
2515- -> Tid Scan on t4 bmt4
2516- TID Cond: (ctid = '(1,1)'::tid)
2487+ Join Filter: (bmt1.c1 = c1.c1)
25172488 -> Nested Loop
2518- Join Filter: (bmt1.c1 = bmt3.c1)
2519- -> Tid Scan on t3 bmt3
2520- TID Cond: (ctid = '(1,1)'::tid)
2489+ Join Filter: (bmt1.c1 = bmt4.c1)
25212490 -> Nested Loop
2522- Join Filter: (bmt1.c1 = bmt2.c1)
2523- -> Seq Scan on t2 bmt2
2524- Filter: (ctid = '(1,1)'::tid)
2491+ Join Filter: (bmt1.c1 = bmt3.c1)
25252492 -> Nested Loop
2526- Join Filter: (bmt1.c1 = c1.c1)
2493+ Join Filter: (bmt1.c1 = bmt2.c1)
25272494 -> Tid Scan on t1 bmt1
25282495 TID Cond: (ctid = '(1,1)'::tid)
25292496 Filter: (c1 <> $2)
2530- -> CTE Scan on c1
2531-(70 rows)
2497+ -> Seq Scan on t2 bmt2
2498+ Filter: (ctid = '(1,1)'::tid)
2499+ -> Tid Scan on t3 bmt3
2500+ TID Cond: (ctid = '(1,1)'::tid)
2501+ -> Tid Scan on t4 bmt4
2502+ TID Cond: (ctid = '(1,1)'::tid)
2503+ -> CTE Scan on c1
2504+(67 rows)
25322505
25332506 /*+
25342507 Leading(c1 bmt4 bmt3 bmt2 bmt1)
@@ -2595,8 +2568,6 @@ error hint:
25952568 Sort Key: b1t2.c1
25962569 -> Nested Loop
25972570 Join Filter: (b1t3.c1 = b1t2.c1)
2598- -> Seq Scan on t2 b1t2
2599- Filter: (ctid = '(1,1)'::tid)
26002571 -> Hash Join
26012572 Hash Cond: (b1t3.c1 = b1t4.c1)
26022573 -> Tid Scan on t3 b1t3
@@ -2604,6 +2575,8 @@ error hint:
26042575 -> Hash
26052576 -> Tid Scan on t4 b1t4
26062577 TID Cond: (ctid = '(1,1)'::tid)
2578+ -> Seq Scan on t2 b1t2
2579+ Filter: (ctid = '(1,1)'::tid)
26072580 -> Sort
26082581 Sort Key: b1t1.c1
26092582 -> Tid Scan on t1 b1t1
@@ -2616,8 +2589,6 @@ error hint:
26162589 Sort Key: b2t2.c1
26172590 -> Nested Loop
26182591 Join Filter: (b2t3.c1 = b2t2.c1)
2619- -> Seq Scan on t2 b2t2
2620- Filter: (ctid = '(1,1)'::tid)
26212592 -> Hash Join
26222593 Hash Cond: (b2t3.c1 = b2t4.c1)
26232594 -> Tid Scan on t3 b2t3
@@ -2625,6 +2596,8 @@ error hint:
26252596 -> Hash
26262597 -> Tid Scan on t4 b2t4
26272598 TID Cond: (ctid = '(1,1)'::tid)
2599+ -> Seq Scan on t2 b2t2
2600+ Filter: (ctid = '(1,1)'::tid)
26282601 -> Sort
26292602 Sort Key: b2t1.c1
26302603 -> Tid Scan on t1 b2t1
@@ -2637,8 +2610,6 @@ error hint:
26372610 Sort Key: b3t2.c1
26382611 -> Nested Loop
26392612 Join Filter: (b3t3.c1 = b3t2.c1)
2640- -> Seq Scan on t2 b3t2
2641- Filter: (ctid = '(1,1)'::tid)
26422613 -> Hash Join
26432614 Hash Cond: (b3t3.c1 = b3t4.c1)
26442615 -> Tid Scan on t3 b3t3
@@ -2646,6 +2617,8 @@ error hint:
26462617 -> Hash
26472618 -> Tid Scan on t4 b3t4
26482619 TID Cond: (ctid = '(1,1)'::tid)
2620+ -> Seq Scan on t2 b3t2
2621+ Filter: (ctid = '(1,1)'::tid)
26492622 -> Sort
26502623 Sort Key: b3t1.c1
26512624 -> Tid Scan on t1 b3t1
@@ -2656,8 +2629,6 @@ error hint:
26562629 Sort Key: bmt2.c1
26572630 -> Nested Loop
26582631 Join Filter: (bmt3.c1 = bmt2.c1)
2659- -> Seq Scan on t2 bmt2
2660- Filter: (ctid = '(1,1)'::tid)
26612632 -> Hash Join
26622633 Hash Cond: (bmt3.c1 = bmt4.c1)
26632634 -> Tid Scan on t3 bmt3
@@ -2672,6 +2643,8 @@ error hint:
26722643 -> Sort
26732644 Sort Key: c1.c1
26742645 -> CTE Scan on c1
2646+ -> Seq Scan on t2 bmt2
2647+ Filter: (ctid = '(1,1)'::tid)
26752648 -> Sort
26762649 Sort Key: bmt1.c1
26772650 -> Tid Scan on t1 bmt1
@@ -2692,26 +2665,25 @@ AND bmt1.c1 <> (
26922665 SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)'
26932666 )
26942667 ;
2695- QUERY PLAN
2696------------------------------------------------------------------------
2668+ QUERY PLAN
2669+-------------------------------------------------------------------
26972670 Aggregate
26982671 CTE c1
26992672 -> Aggregate
27002673 -> Nested Loop
27012674 Join Filter: (b1t1.c1 = b1t4.c1)
2702- -> Tid Scan on t4 b1t4
2703- TID Cond: (ctid = '(1,1)'::tid)
27042675 -> Nested Loop
27052676 Join Filter: (b1t1.c1 = b1t3.c1)
2706- -> Tid Scan on t3 b1t3
2707- TID Cond: (ctid = '(1,1)'::tid)
27082677 -> Nested Loop
27092678 Join Filter: (b1t1.c1 = b1t2.c1)
27102679 -> Tid Scan on t1 b1t1
27112680 TID Cond: (ctid = '(1,1)'::tid)
2712- -> Materialize
2713- -> Seq Scan on t2 b1t2
2714- Filter: (ctid = '(1,1)'::tid)
2681+ -> Seq Scan on t2 b1t2
2682+ Filter: (ctid = '(1,1)'::tid)
2683+ -> Tid Scan on t3 b1t3
2684+ TID Cond: (ctid = '(1,1)'::tid)
2685+ -> Tid Scan on t4 b1t4
2686+ TID Cond: (ctid = '(1,1)'::tid)
27152687 InitPlan 3 (returns $2)
27162688 -> Result
27172689 InitPlan 2 (returns $1)
@@ -2724,24 +2696,24 @@ SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)'
27242696 -> Tid Scan on t1 b3t1
27252697 TID Cond: (ctid = '(1,1)'::tid)
27262698 -> Nested Loop
2727- Join Filter: (bmt1.c1 = bmt4.c1)
2728- -> Tid Scan on t4 bmt4
2729- TID Cond: (ctid = '(1,1)'::tid)
2699+ Join Filter: (bmt1.c1 = c1.c1)
27302700 -> Nested Loop
2731- Join Filter: (bmt1.c1 = bmt3.c1)
2732- -> Tid Scan on t3 bmt3
2733- TID Cond: (ctid = '(1,1)'::tid)
2701+ Join Filter: (bmt1.c1 = bmt4.c1)
27342702 -> Nested Loop
2735- Join Filter: (bmt1.c1 = bmt2.c1)
2736- -> Seq Scan on t2 bmt2
2737- Filter: (ctid = '(1,1)'::tid)
2703+ Join Filter: (bmt1.c1 = bmt3.c1)
27382704 -> Nested Loop
2739- Join Filter: (bmt1.c1 = c1.c1)
2705+ Join Filter: (bmt1.c1 = bmt2.c1)
27402706 -> Tid Scan on t1 bmt1
27412707 TID Cond: (ctid = '(1,1)'::tid)
27422708 Filter: (c1 <> $4)
2743- -> CTE Scan on c1
2744-(47 rows)
2709+ -> Seq Scan on t2 bmt2
2710+ Filter: (ctid = '(1,1)'::tid)
2711+ -> Tid Scan on t3 bmt3
2712+ TID Cond: (ctid = '(1,1)'::tid)
2713+ -> Tid Scan on t4 bmt4
2714+ TID Cond: (ctid = '(1,1)'::tid)
2715+ -> CTE Scan on c1
2716+(46 rows)
27452717
27462718 /*+
27472719 Leading(c1 bmt4 bmt3 bmt2 bmt1)
@@ -2788,8 +2760,6 @@ error hint:
27882760 -> Aggregate
27892761 -> Nested Loop
27902762 Join Filter: (b1t2.c1 = b1t1.c1)
2791- -> Tid Scan on t1 b1t1
2792- TID Cond: (ctid = '(1,1)'::tid)
27932763 -> Hash Join
27942764 Hash Cond: (b1t2.c1 = b1t3.c1)
27952765 -> Seq Scan on t2 b1t2
@@ -2805,6 +2775,8 @@ error hint:
28052775 Sort Key: b1t4.c1
28062776 -> Tid Scan on t4 b1t4
28072777 TID Cond: (ctid = '(1,1)'::tid)
2778+ -> Tid Scan on t1 b1t1
2779+ TID Cond: (ctid = '(1,1)'::tid)
28082780 InitPlan 3 (returns $2)
28092781 -> Result
28102782 InitPlan 2 (returns $1)
@@ -2822,8 +2794,6 @@ error hint:
28222794 Sort Key: bmt2.c1
28232795 -> Nested Loop
28242796 Join Filter: (bmt3.c1 = bmt2.c1)
2825- -> Seq Scan on t2 bmt2
2826- Filter: (ctid = '(1,1)'::tid)
28272797 -> Hash Join
28282798 Hash Cond: (bmt3.c1 = bmt4.c1)
28292799 -> Tid Scan on t3 bmt3
@@ -2838,6 +2808,8 @@ error hint:
28382808 -> Sort
28392809 Sort Key: c1.c1
28402810 -> CTE Scan on c1
2811+ -> Seq Scan on t2 bmt2
2812+ Filter: (ctid = '(1,1)'::tid)
28412813 -> Sort
28422814 Sort Key: bmt1.c1
28432815 -> Tid Scan on t1 bmt1
@@ -2855,22 +2827,22 @@ EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
28552827 Aggregate
28562828 -> Nested Loop
28572829 Join Filter: (t1.c1 = t4.c1)
2858- -> Tid Scan on t4
2859- TID Cond: (ctid = '(1,1)'::tid)
28602830 -> Nested Loop
28612831 Join Filter: (t1.c1 = t3.c1)
2862- -> Tid Scan on t3
2863- TID Cond: (ctid = '(1,1)'::tid)
28642832 -> Nested Loop
28652833 Join Filter: (t1.c1 = t2.c1)
2866- -> Seq Scan on t2
2867- Filter: (ctid = '(1,1)'::tid)
28682834 -> Nested Loop
28692835 -> Tid Scan on r1
28702836 TID Cond: (ctid = '(1,1)'::tid)
28712837 Filter: (c1 = 1)
28722838 -> Tid Scan on t1
28732839 TID Cond: (ctid = '(1,1)'::tid)
2840+ -> Seq Scan on t2
2841+ Filter: (ctid = '(1,1)'::tid)
2842+ -> Tid Scan on t3
2843+ TID Cond: (ctid = '(1,1)'::tid)
2844+ -> Tid Scan on t4
2845+ TID Cond: (ctid = '(1,1)'::tid)
28742846 (19 rows)
28752847
28762848 /*+
@@ -2913,13 +2885,12 @@ error hint:
29132885 Sort Key: t4.c1
29142886 -> Tid Scan on t4
29152887 TID Cond: (ctid = '(1,1)'::tid)
2916- -> Materialize
2917- -> Seq Scan on t2
2918- Filter: (ctid = '(1,1)'::tid)
2888+ -> Seq Scan on t2
2889+ Filter: (ctid = '(1,1)'::tid)
29192890 -> Tid Scan on r1
29202891 TID Cond: (ctid = '(1,1)'::tid)
29212892 Filter: (c1 = 1)
2922-(25 rows)
2893+(24 rows)
29232894
29242895 EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
29252896 QUERY PLAN
@@ -2927,22 +2898,22 @@ EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
29272898 Aggregate
29282899 -> Nested Loop
29292900 Join Filter: (b1t1.c1 = b1t4.c1)
2930- -> Tid Scan on t4 b1t4
2931- TID Cond: (ctid = '(1,1)'::tid)
29322901 -> Nested Loop
29332902 Join Filter: (b1t1.c1 = b1t3.c1)
2934- -> Tid Scan on t3 b1t3
2935- TID Cond: (ctid = '(1,1)'::tid)
29362903 -> Nested Loop
29372904 Join Filter: (b1t1.c1 = b1t2.c1)
2938- -> Seq Scan on t2 b1t2
2939- Filter: (ctid = '(1,1)'::tid)
29402905 -> Nested Loop
29412906 -> Tid Scan on r1_
29422907 TID Cond: (ctid = '(1,1)'::tid)
29432908 Filter: (c1 = 1)
29442909 -> Tid Scan on t1 b1t1
29452910 TID Cond: (ctid = '(1,1)'::tid)
2911+ -> Seq Scan on t2 b1t2
2912+ Filter: (ctid = '(1,1)'::tid)
2913+ -> Tid Scan on t3 b1t3
2914+ TID Cond: (ctid = '(1,1)'::tid)
2915+ -> Tid Scan on t4 b1t4
2916+ TID Cond: (ctid = '(1,1)'::tid)
29462917 (19 rows)
29472918
29482919 /*+
@@ -2985,13 +2956,12 @@ error hint:
29852956 Sort Key: b1t4.c1
29862957 -> Tid Scan on t4 b1t4
29872958 TID Cond: (ctid = '(1,1)'::tid)
2988- -> Materialize
2989- -> Seq Scan on t2 b1t2
2990- Filter: (ctid = '(1,1)'::tid)
2959+ -> Seq Scan on t2 b1t2
2960+ Filter: (ctid = '(1,1)'::tid)
29912961 -> Tid Scan on r1_
29922962 TID Cond: (ctid = '(1,1)'::tid)
29932963 Filter: (c1 = 1)
2994-(25 rows)
2964+(24 rows)
29952965
29962966 -- No. J-2-3-2
29972967 EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
@@ -3000,42 +2970,42 @@ EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
30002970 Aggregate
30012971 -> Nested Loop
30022972 Join Filter: (t1.c1 = t4.c1)
3003- -> Tid Scan on t4
3004- TID Cond: (ctid = '(1,1)'::tid)
30052973 -> Nested Loop
30062974 Join Filter: (t1.c1 = t3.c1)
3007- -> Tid Scan on t3
3008- TID Cond: (ctid = '(1,1)'::tid)
30092975 -> Nested Loop
30102976 Join Filter: (t1.c1 = t2.c1)
3011- -> Seq Scan on t2
3012- Filter: (ctid = '(1,1)'::tid)
30132977 -> Nested Loop
30142978 -> Tid Scan on r2
30152979 TID Cond: (ctid = '(1,1)'::tid)
30162980 Filter: (c1 = 1)
30172981 -> Tid Scan on t1
30182982 TID Cond: (ctid = '(1,1)'::tid)
2983+ -> Seq Scan on t2
2984+ Filter: (ctid = '(1,1)'::tid)
2985+ -> Tid Scan on t3
2986+ TID Cond: (ctid = '(1,1)'::tid)
2987+ -> Tid Scan on t4
2988+ TID Cond: (ctid = '(1,1)'::tid)
30192989
30202990 Aggregate
30212991 -> Nested Loop
30222992 Join Filter: (t1.c1 = t4.c1)
3023- -> Tid Scan on t4
3024- TID Cond: (ctid = '(1,1)'::tid)
30252993 -> Nested Loop
30262994 Join Filter: (t1.c1 = t3.c1)
3027- -> Tid Scan on t3
3028- TID Cond: (ctid = '(1,1)'::tid)
30292995 -> Nested Loop
30302996 Join Filter: (t1.c1 = t2.c1)
3031- -> Seq Scan on t2
3032- Filter: (ctid = '(1,1)'::tid)
30332997 -> Nested Loop
30342998 -> Tid Scan on r2
30352999 TID Cond: (ctid = '(1,1)'::tid)
30363000 Filter: (c1 = 1)
30373001 -> Tid Scan on t1
30383002 TID Cond: (ctid = '(1,1)'::tid)
3003+ -> Seq Scan on t2
3004+ Filter: (ctid = '(1,1)'::tid)
3005+ -> Tid Scan on t3
3006+ TID Cond: (ctid = '(1,1)'::tid)
3007+ -> Tid Scan on t4
3008+ TID Cond: (ctid = '(1,1)'::tid)
30393009 (39 rows)
30403010
30413011 /*+
@@ -3089,9 +3059,8 @@ error hint:
30893059 Sort Key: t4.c1
30903060 -> Tid Scan on t4
30913061 TID Cond: (ctid = '(1,1)'::tid)
3092- -> Materialize
3093- -> Seq Scan on t2
3094- Filter: (ctid = '(1,1)'::tid)
3062+ -> Seq Scan on t2
3063+ Filter: (ctid = '(1,1)'::tid)
30953064 -> Tid Scan on r2
30963065 TID Cond: (ctid = '(1,1)'::tid)
30973066 Filter: (c1 = 1)
@@ -3115,13 +3084,12 @@ error hint:
31153084 Sort Key: t4.c1
31163085 -> Tid Scan on t4
31173086 TID Cond: (ctid = '(1,1)'::tid)
3118- -> Materialize
3119- -> Seq Scan on t2
3120- Filter: (ctid = '(1,1)'::tid)
3087+ -> Seq Scan on t2
3088+ Filter: (ctid = '(1,1)'::tid)
31213089 -> Tid Scan on r2
31223090 TID Cond: (ctid = '(1,1)'::tid)
31233091 Filter: (c1 = 1)
3124-(51 rows)
3092+(49 rows)
31253093
31263094 EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
31273095 QUERY PLAN
@@ -3129,42 +3097,42 @@ EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
31293097 Aggregate
31303098 -> Nested Loop
31313099 Join Filter: (b1t1.c1 = b1t4.c1)
3132- -> Tid Scan on t4 b1t4
3133- TID Cond: (ctid = '(1,1)'::tid)
31343100 -> Nested Loop
31353101 Join Filter: (b1t1.c1 = b1t3.c1)
3136- -> Tid Scan on t3 b1t3
3137- TID Cond: (ctid = '(1,1)'::tid)
31383102 -> Nested Loop
31393103 Join Filter: (b1t1.c1 = b1t2.c1)
3140- -> Seq Scan on t2 b1t2
3141- Filter: (ctid = '(1,1)'::tid)
31423104 -> Nested Loop
31433105 -> Tid Scan on r2_
31443106 TID Cond: (ctid = '(1,1)'::tid)
31453107 Filter: (c1 = 1)
31463108 -> Tid Scan on t1 b1t1
31473109 TID Cond: (ctid = '(1,1)'::tid)
3110+ -> Seq Scan on t2 b1t2
3111+ Filter: (ctid = '(1,1)'::tid)
3112+ -> Tid Scan on t3 b1t3
3113+ TID Cond: (ctid = '(1,1)'::tid)
3114+ -> Tid Scan on t4 b1t4
3115+ TID Cond: (ctid = '(1,1)'::tid)
31483116
31493117 Aggregate
31503118 -> Nested Loop
31513119 Join Filter: (b2t1.c1 = b2t4.c1)
3152- -> Tid Scan on t4 b2t4
3153- TID Cond: (ctid = '(1,1)'::tid)
31543120 -> Nested Loop
31553121 Join Filter: (b2t1.c1 = b2t3.c1)
3156- -> Tid Scan on t3 b2t3
3157- TID Cond: (ctid = '(1,1)'::tid)
31583122 -> Nested Loop
31593123 Join Filter: (b2t1.c1 = b2t2.c1)
3160- -> Seq Scan on t2 b2t2
3161- Filter: (ctid = '(1,1)'::tid)
31623124 -> Nested Loop
31633125 -> Tid Scan on r2_
31643126 TID Cond: (ctid = '(1,1)'::tid)
31653127 Filter: (c1 = 1)
31663128 -> Tid Scan on t1 b2t1
31673129 TID Cond: (ctid = '(1,1)'::tid)
3130+ -> Seq Scan on t2 b2t2
3131+ Filter: (ctid = '(1,1)'::tid)
3132+ -> Tid Scan on t3 b2t3
3133+ TID Cond: (ctid = '(1,1)'::tid)
3134+ -> Tid Scan on t4 b2t4
3135+ TID Cond: (ctid = '(1,1)'::tid)
31683136 (39 rows)
31693137
31703138 /*+
@@ -3218,8 +3186,6 @@ error hint:
32183186 -> Nested Loop
32193187 -> Nested Loop
32203188 Join Filter: (b1t1.c1 = b1t4.c1)
3221- -> Tid Scan on t4 b1t4
3222- TID Cond: (ctid = '(1,1)'::tid)
32233189 -> Hash Join
32243190 Hash Cond: (b1t3.c1 = b1t1.c1)
32253191 -> Tid Scan on t3 b1t3
@@ -3235,6 +3201,8 @@ error hint:
32353201 Sort Key: b1t2.c1
32363202 -> Seq Scan on t2 b1t2
32373203 Filter: (ctid = '(1,1)'::tid)
3204+ -> Tid Scan on t4 b1t4
3205+ TID Cond: (ctid = '(1,1)'::tid)
32383206 -> Tid Scan on r2_
32393207 TID Cond: (ctid = '(1,1)'::tid)
32403208 Filter: (c1 = 1)
@@ -3243,8 +3211,6 @@ error hint:
32433211 -> Nested Loop
32443212 -> Nested Loop
32453213 Join Filter: (b2t1.c1 = b2t4.c1)
3246- -> Tid Scan on t4 b2t4
3247- TID Cond: (ctid = '(1,1)'::tid)
32483214 -> Hash Join
32493215 Hash Cond: (b2t3.c1 = b2t1.c1)
32503216 -> Tid Scan on t3 b2t3
@@ -3260,6 +3226,8 @@ error hint:
32603226 Sort Key: b2t2.c1
32613227 -> Seq Scan on t2 b2t2
32623228 Filter: (ctid = '(1,1)'::tid)
3229+ -> Tid Scan on t4 b2t4
3230+ TID Cond: (ctid = '(1,1)'::tid)
32633231 -> Tid Scan on r2_
32643232 TID Cond: (ctid = '(1,1)'::tid)
32653233 Filter: (c1 = 1)
@@ -3272,62 +3240,62 @@ EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
32723240 Aggregate
32733241 -> Nested Loop
32743242 Join Filter: (t1.c1 = t4.c1)
3275- -> Tid Scan on t4
3276- TID Cond: (ctid = '(1,1)'::tid)
32773243 -> Nested Loop
32783244 Join Filter: (t1.c1 = t3.c1)
3279- -> Tid Scan on t3
3280- TID Cond: (ctid = '(1,1)'::tid)
32813245 -> Nested Loop
32823246 Join Filter: (t1.c1 = t2.c1)
3283- -> Seq Scan on t2
3284- Filter: (ctid = '(1,1)'::tid)
32853247 -> Nested Loop
32863248 -> Tid Scan on r3
32873249 TID Cond: (ctid = '(1,1)'::tid)
32883250 Filter: (c1 = 1)
32893251 -> Tid Scan on t1
32903252 TID Cond: (ctid = '(1,1)'::tid)
3253+ -> Seq Scan on t2
3254+ Filter: (ctid = '(1,1)'::tid)
3255+ -> Tid Scan on t3
3256+ TID Cond: (ctid = '(1,1)'::tid)
3257+ -> Tid Scan on t4
3258+ TID Cond: (ctid = '(1,1)'::tid)
32913259
32923260 Aggregate
32933261 -> Nested Loop
32943262 Join Filter: (t1.c1 = t4.c1)
3295- -> Tid Scan on t4
3296- TID Cond: (ctid = '(1,1)'::tid)
32973263 -> Nested Loop
32983264 Join Filter: (t1.c1 = t3.c1)
3299- -> Tid Scan on t3
3300- TID Cond: (ctid = '(1,1)'::tid)
33013265 -> Nested Loop
33023266 Join Filter: (t1.c1 = t2.c1)
3303- -> Seq Scan on t2
3304- Filter: (ctid = '(1,1)'::tid)
33053267 -> Nested Loop
33063268 -> Tid Scan on r3
33073269 TID Cond: (ctid = '(1,1)'::tid)
33083270 Filter: (c1 = 1)
33093271 -> Tid Scan on t1
33103272 TID Cond: (ctid = '(1,1)'::tid)
3273+ -> Seq Scan on t2
3274+ Filter: (ctid = '(1,1)'::tid)
3275+ -> Tid Scan on t3
3276+ TID Cond: (ctid = '(1,1)'::tid)
3277+ -> Tid Scan on t4
3278+ TID Cond: (ctid = '(1,1)'::tid)
33113279
33123280 Aggregate
33133281 -> Nested Loop
33143282 Join Filter: (t1.c1 = t4.c1)
3315- -> Tid Scan on t4
3316- TID Cond: (ctid = '(1,1)'::tid)
33173283 -> Nested Loop
33183284 Join Filter: (t1.c1 = t3.c1)
3319- -> Tid Scan on t3
3320- TID Cond: (ctid = '(1,1)'::tid)
33213285 -> Nested Loop
33223286 Join Filter: (t1.c1 = t2.c1)
3323- -> Seq Scan on t2
3324- Filter: (ctid = '(1,1)'::tid)
33253287 -> Nested Loop
33263288 -> Tid Scan on r3
33273289 TID Cond: (ctid = '(1,1)'::tid)
33283290 Filter: (c1 = 1)
33293291 -> Tid Scan on t1
33303292 TID Cond: (ctid = '(1,1)'::tid)
3293+ -> Seq Scan on t2
3294+ Filter: (ctid = '(1,1)'::tid)
3295+ -> Tid Scan on t3
3296+ TID Cond: (ctid = '(1,1)'::tid)
3297+ -> Tid Scan on t4
3298+ TID Cond: (ctid = '(1,1)'::tid)
33313299 (59 rows)
33323300
33333301 /*+
@@ -3392,9 +3360,8 @@ error hint:
33923360 Sort Key: t4.c1
33933361 -> Tid Scan on t4
33943362 TID Cond: (ctid = '(1,1)'::tid)
3395- -> Materialize
3396- -> Seq Scan on t2
3397- Filter: (ctid = '(1,1)'::tid)
3363+ -> Seq Scan on t2
3364+ Filter: (ctid = '(1,1)'::tid)
33983365 -> Tid Scan on r3
33993366 TID Cond: (ctid = '(1,1)'::tid)
34003367 Filter: (c1 = 1)
@@ -3418,9 +3385,8 @@ error hint:
34183385 Sort Key: t4.c1
34193386 -> Tid Scan on t4
34203387 TID Cond: (ctid = '(1,1)'::tid)
3421- -> Materialize
3422- -> Seq Scan on t2
3423- Filter: (ctid = '(1,1)'::tid)
3388+ -> Seq Scan on t2
3389+ Filter: (ctid = '(1,1)'::tid)
34243390 -> Tid Scan on r3
34253391 TID Cond: (ctid = '(1,1)'::tid)
34263392 Filter: (c1 = 1)
@@ -3444,13 +3410,12 @@ error hint:
34443410 Sort Key: t4.c1
34453411 -> Tid Scan on t4
34463412 TID Cond: (ctid = '(1,1)'::tid)
3447- -> Materialize
3448- -> Seq Scan on t2
3449- Filter: (ctid = '(1,1)'::tid)
3413+ -> Seq Scan on t2
3414+ Filter: (ctid = '(1,1)'::tid)
34503415 -> Tid Scan on r3
34513416 TID Cond: (ctid = '(1,1)'::tid)
34523417 Filter: (c1 = 1)
3453-(77 rows)
3418+(74 rows)
34543419
34553420 EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
34563421 QUERY PLAN
@@ -3458,62 +3423,62 @@ EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
34583423 Aggregate
34593424 -> Nested Loop
34603425 Join Filter: (b1t1.c1 = b1t4.c1)
3461- -> Tid Scan on t4 b1t4
3462- TID Cond: (ctid = '(1,1)'::tid)
34633426 -> Nested Loop
34643427 Join Filter: (b1t1.c1 = b1t3.c1)
3465- -> Tid Scan on t3 b1t3
3466- TID Cond: (ctid = '(1,1)'::tid)
34673428 -> Nested Loop
34683429 Join Filter: (b1t1.c1 = b1t2.c1)
3469- -> Seq Scan on t2 b1t2
3470- Filter: (ctid = '(1,1)'::tid)
34713430 -> Nested Loop
34723431 -> Tid Scan on r3_
34733432 TID Cond: (ctid = '(1,1)'::tid)
34743433 Filter: (c1 = 1)
34753434 -> Tid Scan on t1 b1t1
34763435 TID Cond: (ctid = '(1,1)'::tid)
3436+ -> Seq Scan on t2 b1t2
3437+ Filter: (ctid = '(1,1)'::tid)
3438+ -> Tid Scan on t3 b1t3
3439+ TID Cond: (ctid = '(1,1)'::tid)
3440+ -> Tid Scan on t4 b1t4
3441+ TID Cond: (ctid = '(1,1)'::tid)
34773442
34783443 Aggregate
34793444 -> Nested Loop
34803445 Join Filter: (b2t1.c1 = b2t4.c1)
3481- -> Tid Scan on t4 b2t4
3482- TID Cond: (ctid = '(1,1)'::tid)
34833446 -> Nested Loop
34843447 Join Filter: (b2t1.c1 = b2t3.c1)
3485- -> Tid Scan on t3 b2t3
3486- TID Cond: (ctid = '(1,1)'::tid)
34873448 -> Nested Loop
34883449 Join Filter: (b2t1.c1 = b2t2.c1)
3489- -> Seq Scan on t2 b2t2
3490- Filter: (ctid = '(1,1)'::tid)
34913450 -> Nested Loop
34923451 -> Tid Scan on r3_
34933452 TID Cond: (ctid = '(1,1)'::tid)
34943453 Filter: (c1 = 1)
34953454 -> Tid Scan on t1 b2t1
34963455 TID Cond: (ctid = '(1,1)'::tid)
3456+ -> Seq Scan on t2 b2t2
3457+ Filter: (ctid = '(1,1)'::tid)
3458+ -> Tid Scan on t3 b2t3
3459+ TID Cond: (ctid = '(1,1)'::tid)
3460+ -> Tid Scan on t4 b2t4
3461+ TID Cond: (ctid = '(1,1)'::tid)
34973462
34983463 Aggregate
34993464 -> Nested Loop
35003465 Join Filter: (b3t1.c1 = b3t4.c1)
3501- -> Tid Scan on t4 b3t4
3502- TID Cond: (ctid = '(1,1)'::tid)
35033466 -> Nested Loop
35043467 Join Filter: (b3t1.c1 = b3t3.c1)
3505- -> Tid Scan on t3 b3t3
3506- TID Cond: (ctid = '(1,1)'::tid)
35073468 -> Nested Loop
35083469 Join Filter: (b3t1.c1 = b3t2.c1)
3509- -> Seq Scan on t2 b3t2
3510- Filter: (ctid = '(1,1)'::tid)
35113470 -> Nested Loop
35123471 -> Tid Scan on r3_
35133472 TID Cond: (ctid = '(1,1)'::tid)
35143473 Filter: (c1 = 1)
35153474 -> Tid Scan on t1 b3t1
35163475 TID Cond: (ctid = '(1,1)'::tid)
3476+ -> Seq Scan on t2 b3t2
3477+ Filter: (ctid = '(1,1)'::tid)
3478+ -> Tid Scan on t3 b3t3
3479+ TID Cond: (ctid = '(1,1)'::tid)
3480+ -> Tid Scan on t4 b3t4
3481+ TID Cond: (ctid = '(1,1)'::tid)
35173482 (59 rows)
35183483
35193484 /*+
@@ -3603,8 +3568,6 @@ error hint:
36033568 -> Nested Loop
36043569 -> Nested Loop
36053570 Join Filter: (b1t1.c1 = b1t4.c1)
3606- -> Tid Scan on t4 b1t4
3607- TID Cond: (ctid = '(1,1)'::tid)
36083571 -> Hash Join
36093572 Hash Cond: (b1t3.c1 = b1t1.c1)
36103573 -> Tid Scan on t3 b1t3
@@ -3620,6 +3583,8 @@ error hint:
36203583 Sort Key: b1t2.c1
36213584 -> Seq Scan on t2 b1t2
36223585 Filter: (ctid = '(1,1)'::tid)
3586+ -> Tid Scan on t4 b1t4
3587+ TID Cond: (ctid = '(1,1)'::tid)
36233588 -> Tid Scan on r3_
36243589 TID Cond: (ctid = '(1,1)'::tid)
36253590 Filter: (c1 = 1)
@@ -3628,8 +3593,6 @@ error hint:
36283593 -> Nested Loop
36293594 -> Nested Loop
36303595 Join Filter: (b2t1.c1 = b2t4.c1)
3631- -> Tid Scan on t4 b2t4
3632- TID Cond: (ctid = '(1,1)'::tid)
36333596 -> Hash Join
36343597 Hash Cond: (b2t3.c1 = b2t1.c1)
36353598 -> Tid Scan on t3 b2t3
@@ -3645,6 +3608,8 @@ error hint:
36453608 Sort Key: b2t2.c1
36463609 -> Seq Scan on t2 b2t2
36473610 Filter: (ctid = '(1,1)'::tid)
3611+ -> Tid Scan on t4 b2t4
3612+ TID Cond: (ctid = '(1,1)'::tid)
36483613 -> Tid Scan on r3_
36493614 TID Cond: (ctid = '(1,1)'::tid)
36503615 Filter: (c1 = 1)
@@ -3653,8 +3618,6 @@ error hint:
36533618 -> Nested Loop
36543619 -> Nested Loop
36553620 Join Filter: (b3t1.c1 = b3t4.c1)
3656- -> Tid Scan on t4 b3t4
3657- TID Cond: (ctid = '(1,1)'::tid)
36583621 -> Hash Join
36593622 Hash Cond: (b3t3.c1 = b3t1.c1)
36603623 -> Tid Scan on t3 b3t3
@@ -3670,6 +3633,8 @@ error hint:
36703633 Sort Key: b3t2.c1
36713634 -> Seq Scan on t2 b3t2
36723635 Filter: (ctid = '(1,1)'::tid)
3636+ -> Tid Scan on t4 b3t4
3637+ TID Cond: (ctid = '(1,1)'::tid)
36733638 -> Tid Scan on r3_
36743639 TID Cond: (ctid = '(1,1)'::tid)
36753640 Filter: (c1 = 1)
@@ -4002,15 +3967,14 @@ error hint:
40023967
40033968 SET enable_mergejoin TO on;
40043969 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';;
4005- QUERY PLAN
4006------------------------------------------------
3970+ QUERY PLAN
3971+-----------------------------------------
40073972 Nested Loop
40083973 Join Filter: (t1.c1 = t2.c1)
3974+ -> Tid Scan on t1
3975+ TID Cond: (ctid = '(1,1)'::tid)
40093976 -> Seq Scan on t2
4010- -> Materialize
4011- -> Tid Scan on t1
4012- TID Cond: (ctid = '(1,1)'::tid)
4013-(6 rows)
3977+(5 rows)
40143978
40153979 /*+NoNestLoop(t1 t2)*/
40163980 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';;
--- a/expected/ut-L.out
+++ b/expected/ut-L.out
@@ -1219,59 +1219,56 @@ SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2
12191219 )
12201220 FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
12211221 ;
1222- QUERY PLAN
1223------------------------------------------------------------------------
1222+ QUERY PLAN
1223+-------------------------------------------------------------------
12241224 Aggregate
12251225 InitPlan 1 (returns $0)
12261226 -> Aggregate
12271227 -> Nested Loop
12281228 Join Filter: (b1t1.c1 = b1t4.c1)
1229- -> Tid Scan on t4 b1t4
1230- TID Cond: (ctid = '(1,1)'::tid)
12311229 -> Nested Loop
12321230 Join Filter: (b1t1.c1 = b1t3.c1)
1233- -> Tid Scan on t3 b1t3
1234- TID Cond: (ctid = '(1,1)'::tid)
12351231 -> Nested Loop
12361232 Join Filter: (b1t1.c1 = b1t2.c1)
12371233 -> Tid Scan on t1 b1t1
12381234 TID Cond: (ctid = '(1,1)'::tid)
1239- -> Materialize
1240- -> Seq Scan on t2 b1t2
1241- Filter: (ctid = '(1,1)'::tid)
1235+ -> Seq Scan on t2 b1t2
1236+ Filter: (ctid = '(1,1)'::tid)
1237+ -> Tid Scan on t3 b1t3
1238+ TID Cond: (ctid = '(1,1)'::tid)
1239+ -> Tid Scan on t4 b1t4
1240+ TID Cond: (ctid = '(1,1)'::tid)
12421241 InitPlan 2 (returns $1)
12431242 -> Aggregate
12441243 -> Nested Loop
12451244 Join Filter: (b2t1.c1 = b2t4.c1)
1246- -> Tid Scan on t4 b2t4
1247- TID Cond: (ctid = '(1,1)'::tid)
12481245 -> Nested Loop
12491246 Join Filter: (b2t1.c1 = b2t3.c1)
1250- -> Tid Scan on t3 b2t3
1251- TID Cond: (ctid = '(1,1)'::tid)
12521247 -> Nested Loop
12531248 Join Filter: (b2t1.c1 = b2t2.c1)
12541249 -> Tid Scan on t1 b2t1
12551250 TID Cond: (ctid = '(1,1)'::tid)
1256- -> Materialize
1257- -> Seq Scan on t2 b2t2
1258- Filter: (ctid = '(1,1)'::tid)
1251+ -> Seq Scan on t2 b2t2
1252+ Filter: (ctid = '(1,1)'::tid)
1253+ -> Tid Scan on t3 b2t3
1254+ TID Cond: (ctid = '(1,1)'::tid)
1255+ -> Tid Scan on t4 b2t4
1256+ TID Cond: (ctid = '(1,1)'::tid)
12591257 -> Nested Loop
12601258 Join Filter: (bmt1.c1 = bmt4.c1)
1261- -> Tid Scan on t4 bmt4
1262- TID Cond: (ctid = '(1,1)'::tid)
12631259 -> Nested Loop
12641260 Join Filter: (bmt1.c1 = bmt3.c1)
1265- -> Tid Scan on t3 bmt3
1266- TID Cond: (ctid = '(1,1)'::tid)
12671261 -> Nested Loop
12681262 Join Filter: (bmt1.c1 = bmt2.c1)
12691263 -> Tid Scan on t1 bmt1
12701264 TID Cond: (ctid = '(1,1)'::tid)
1271- -> Materialize
1272- -> Seq Scan on t2 bmt2
1273- Filter: (ctid = '(1,1)'::tid)
1274-(50 rows)
1265+ -> Seq Scan on t2 bmt2
1266+ Filter: (ctid = '(1,1)'::tid)
1267+ -> Tid Scan on t3 bmt3
1268+ TID Cond: (ctid = '(1,1)'::tid)
1269+ -> Tid Scan on t4 bmt4
1270+ TID Cond: (ctid = '(1,1)'::tid)
1271+(47 rows)
12751272
12761273 /*+
12771274 Leading(bmt1 bmt2 bmt3 bmt4)
@@ -1295,59 +1292,56 @@ not used hint:
12951292 duplication hint:
12961293 error hint:
12971294
1298- QUERY PLAN
1299--------------------------------------------------------------------------
1295+ QUERY PLAN
1296+-------------------------------------------------------------------
13001297 Aggregate
13011298 InitPlan 1 (returns $0)
13021299 -> Aggregate
13031300 -> Nested Loop
13041301 Join Filter: (b1t2.c1 = b1t1.c1)
1305- -> Tid Scan on t1 b1t1
1306- TID Cond: (ctid = '(1,1)'::tid)
13071302 -> Nested Loop
13081303 Join Filter: (b1t2.c1 = b1t4.c1)
1309- -> Tid Scan on t4 b1t4
1310- TID Cond: (ctid = '(1,1)'::tid)
13111304 -> Nested Loop
13121305 Join Filter: (b1t2.c1 = b1t3.c1)
13131306 -> Seq Scan on t2 b1t2
13141307 Filter: (ctid = '(1,1)'::tid)
1315- -> Materialize
1316- -> Tid Scan on t3 b1t3
1317- TID Cond: (ctid = '(1,1)'::tid)
1308+ -> Tid Scan on t3 b1t3
1309+ TID Cond: (ctid = '(1,1)'::tid)
1310+ -> Tid Scan on t4 b1t4
1311+ TID Cond: (ctid = '(1,1)'::tid)
1312+ -> Tid Scan on t1 b1t1
1313+ TID Cond: (ctid = '(1,1)'::tid)
13181314 InitPlan 2 (returns $1)
13191315 -> Aggregate
13201316 -> Nested Loop
13211317 Join Filter: (b2t1.c1 = b2t2.c1)
1322- -> Seq Scan on t2 b2t2
1323- Filter: (ctid = '(1,1)'::tid)
13241318 -> Nested Loop
13251319 Join Filter: (b2t3.c1 = b2t1.c1)
1326- -> Tid Scan on t1 b2t1
1327- TID Cond: (ctid = '(1,1)'::tid)
13281320 -> Nested Loop
13291321 Join Filter: (b2t3.c1 = b2t4.c1)
13301322 -> Tid Scan on t3 b2t3
13311323 TID Cond: (ctid = '(1,1)'::tid)
1332- -> Materialize
1333- -> Tid Scan on t4 b2t4
1334- TID Cond: (ctid = '(1,1)'::tid)
1324+ -> Tid Scan on t4 b2t4
1325+ TID Cond: (ctid = '(1,1)'::tid)
1326+ -> Tid Scan on t1 b2t1
1327+ TID Cond: (ctid = '(1,1)'::tid)
1328+ -> Seq Scan on t2 b2t2
1329+ Filter: (ctid = '(1,1)'::tid)
13351330 -> Nested Loop
13361331 Join Filter: (bmt1.c1 = bmt4.c1)
1337- -> Tid Scan on t4 bmt4
1338- TID Cond: (ctid = '(1,1)'::tid)
13391332 -> Nested Loop
13401333 Join Filter: (bmt1.c1 = bmt3.c1)
1341- -> Tid Scan on t3 bmt3
1342- TID Cond: (ctid = '(1,1)'::tid)
13431334 -> Nested Loop
13441335 Join Filter: (bmt1.c1 = bmt2.c1)
13451336 -> Tid Scan on t1 bmt1
13461337 TID Cond: (ctid = '(1,1)'::tid)
1347- -> Materialize
1348- -> Seq Scan on t2 bmt2
1349- Filter: (ctid = '(1,1)'::tid)
1350-(50 rows)
1338+ -> Seq Scan on t2 bmt2
1339+ Filter: (ctid = '(1,1)'::tid)
1340+ -> Tid Scan on t3 bmt3
1341+ TID Cond: (ctid = '(1,1)'::tid)
1342+ -> Tid Scan on t4 bmt4
1343+ TID Cond: (ctid = '(1,1)'::tid)
1344+(47 rows)
13511345
13521346 -- No. L-2-1-2
13531347 EXPLAIN (COSTS false)
@@ -1360,76 +1354,72 @@ SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3
13601354 )
13611355 FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
13621356 ;
1363- QUERY PLAN
1364------------------------------------------------------------------------
1357+ QUERY PLAN
1358+-------------------------------------------------------------------
13651359 Aggregate
13661360 InitPlan 1 (returns $0)
13671361 -> Aggregate
13681362 -> Nested Loop
13691363 Join Filter: (b1t1.c1 = b1t4.c1)
1370- -> Tid Scan on t4 b1t4
1371- TID Cond: (ctid = '(1,1)'::tid)
13721364 -> Nested Loop
13731365 Join Filter: (b1t1.c1 = b1t3.c1)
1374- -> Tid Scan on t3 b1t3
1375- TID Cond: (ctid = '(1,1)'::tid)
13761366 -> Nested Loop
13771367 Join Filter: (b1t1.c1 = b1t2.c1)
13781368 -> Tid Scan on t1 b1t1
13791369 TID Cond: (ctid = '(1,1)'::tid)
1380- -> Materialize
1381- -> Seq Scan on t2 b1t2
1382- Filter: (ctid = '(1,1)'::tid)
1370+ -> Seq Scan on t2 b1t2
1371+ Filter: (ctid = '(1,1)'::tid)
1372+ -> Tid Scan on t3 b1t3
1373+ TID Cond: (ctid = '(1,1)'::tid)
1374+ -> Tid Scan on t4 b1t4
1375+ TID Cond: (ctid = '(1,1)'::tid)
13831376 InitPlan 2 (returns $1)
13841377 -> Aggregate
13851378 -> Nested Loop
13861379 Join Filter: (b2t1.c1 = b2t4.c1)
1387- -> Tid Scan on t4 b2t4
1388- TID Cond: (ctid = '(1,1)'::tid)
13891380 -> Nested Loop
13901381 Join Filter: (b2t1.c1 = b2t3.c1)
1391- -> Tid Scan on t3 b2t3
1392- TID Cond: (ctid = '(1,1)'::tid)
13931382 -> Nested Loop
13941383 Join Filter: (b2t1.c1 = b2t2.c1)
13951384 -> Tid Scan on t1 b2t1
13961385 TID Cond: (ctid = '(1,1)'::tid)
1397- -> Materialize
1398- -> Seq Scan on t2 b2t2
1399- Filter: (ctid = '(1,1)'::tid)
1386+ -> Seq Scan on t2 b2t2
1387+ Filter: (ctid = '(1,1)'::tid)
1388+ -> Tid Scan on t3 b2t3
1389+ TID Cond: (ctid = '(1,1)'::tid)
1390+ -> Tid Scan on t4 b2t4
1391+ TID Cond: (ctid = '(1,1)'::tid)
14001392 InitPlan 3 (returns $2)
14011393 -> Aggregate
14021394 -> Nested Loop
14031395 Join Filter: (b3t1.c1 = b3t4.c1)
1404- -> Tid Scan on t4 b3t4
1405- TID Cond: (ctid = '(1,1)'::tid)
14061396 -> Nested Loop
14071397 Join Filter: (b3t1.c1 = b3t3.c1)
1408- -> Tid Scan on t3 b3t3
1409- TID Cond: (ctid = '(1,1)'::tid)
14101398 -> Nested Loop
14111399 Join Filter: (b3t1.c1 = b3t2.c1)
14121400 -> Tid Scan on t1 b3t1
14131401 TID Cond: (ctid = '(1,1)'::tid)
1414- -> Materialize
1415- -> Seq Scan on t2 b3t2
1416- Filter: (ctid = '(1,1)'::tid)
1402+ -> Seq Scan on t2 b3t2
1403+ Filter: (ctid = '(1,1)'::tid)
1404+ -> Tid Scan on t3 b3t3
1405+ TID Cond: (ctid = '(1,1)'::tid)
1406+ -> Tid Scan on t4 b3t4
1407+ TID Cond: (ctid = '(1,1)'::tid)
14171408 -> Nested Loop
14181409 Join Filter: (bmt1.c1 = bmt4.c1)
1419- -> Tid Scan on t4 bmt4
1420- TID Cond: (ctid = '(1,1)'::tid)
14211410 -> Nested Loop
14221411 Join Filter: (bmt1.c1 = bmt3.c1)
1423- -> Tid Scan on t3 bmt3
1424- TID Cond: (ctid = '(1,1)'::tid)
14251412 -> Nested Loop
14261413 Join Filter: (bmt1.c1 = bmt2.c1)
14271414 -> Tid Scan on t1 bmt1
14281415 TID Cond: (ctid = '(1,1)'::tid)
1429- -> Materialize
1430- -> Seq Scan on t2 bmt2
1431- Filter: (ctid = '(1,1)'::tid)
1432-(67 rows)
1416+ -> Seq Scan on t2 bmt2
1417+ Filter: (ctid = '(1,1)'::tid)
1418+ -> Tid Scan on t3 bmt3
1419+ TID Cond: (ctid = '(1,1)'::tid)
1420+ -> Tid Scan on t4 bmt4
1421+ TID Cond: (ctid = '(1,1)'::tid)
1422+(63 rows)
14331423
14341424 /*+
14351425 Leading(bmt1 bmt2 bmt3 bmt4)
@@ -1457,98 +1447,93 @@ not used hint:
14571447 duplication hint:
14581448 error hint:
14591449
1460- QUERY PLAN
1461--------------------------------------------------------------------------
1450+ QUERY PLAN
1451+-------------------------------------------------------------------
14621452 Aggregate
14631453 InitPlan 1 (returns $0)
14641454 -> Aggregate
14651455 -> Nested Loop
14661456 Join Filter: (b1t2.c1 = b1t1.c1)
1467- -> Tid Scan on t1 b1t1
1468- TID Cond: (ctid = '(1,1)'::tid)
14691457 -> Nested Loop
14701458 Join Filter: (b1t2.c1 = b1t4.c1)
1471- -> Tid Scan on t4 b1t4
1472- TID Cond: (ctid = '(1,1)'::tid)
14731459 -> Nested Loop
14741460 Join Filter: (b1t2.c1 = b1t3.c1)
14751461 -> Seq Scan on t2 b1t2
14761462 Filter: (ctid = '(1,1)'::tid)
1477- -> Materialize
1478- -> Tid Scan on t3 b1t3
1479- TID Cond: (ctid = '(1,1)'::tid)
1463+ -> Tid Scan on t3 b1t3
1464+ TID Cond: (ctid = '(1,1)'::tid)
1465+ -> Tid Scan on t4 b1t4
1466+ TID Cond: (ctid = '(1,1)'::tid)
1467+ -> Tid Scan on t1 b1t1
1468+ TID Cond: (ctid = '(1,1)'::tid)
14801469 InitPlan 2 (returns $1)
14811470 -> Aggregate
14821471 -> Nested Loop
14831472 Join Filter: (b2t1.c1 = b2t2.c1)
1484- -> Seq Scan on t2 b2t2
1485- Filter: (ctid = '(1,1)'::tid)
14861473 -> Nested Loop
14871474 Join Filter: (b2t3.c1 = b2t1.c1)
1488- -> Tid Scan on t1 b2t1
1489- TID Cond: (ctid = '(1,1)'::tid)
14901475 -> Nested Loop
14911476 Join Filter: (b2t3.c1 = b2t4.c1)
14921477 -> Tid Scan on t3 b2t3
14931478 TID Cond: (ctid = '(1,1)'::tid)
1494- -> Materialize
1495- -> Tid Scan on t4 b2t4
1496- TID Cond: (ctid = '(1,1)'::tid)
1479+ -> Tid Scan on t4 b2t4
1480+ TID Cond: (ctid = '(1,1)'::tid)
1481+ -> Tid Scan on t1 b2t1
1482+ TID Cond: (ctid = '(1,1)'::tid)
1483+ -> Seq Scan on t2 b2t2
1484+ Filter: (ctid = '(1,1)'::tid)
14971485 InitPlan 3 (returns $2)
14981486 -> Aggregate
14991487 -> Nested Loop
15001488 Join Filter: (b3t1.c1 = b3t3.c1)
1501- -> Tid Scan on t3 b3t3
1502- TID Cond: (ctid = '(1,1)'::tid)
15031489 -> Nested Loop
15041490 Join Filter: (b3t1.c1 = b3t2.c1)
1505- -> Seq Scan on t2 b3t2
1506- Filter: (ctid = '(1,1)'::tid)
15071491 -> Nested Loop
15081492 Join Filter: (b3t1.c1 = b3t4.c1)
15091493 -> Tid Scan on t1 b3t1
15101494 TID Cond: (ctid = '(1,1)'::tid)
1511- -> Materialize
1512- -> Tid Scan on t4 b3t4
1513- TID Cond: (ctid = '(1,1)'::tid)
1495+ -> Tid Scan on t4 b3t4
1496+ TID Cond: (ctid = '(1,1)'::tid)
1497+ -> Seq Scan on t2 b3t2
1498+ Filter: (ctid = '(1,1)'::tid)
1499+ -> Tid Scan on t3 b3t3
1500+ TID Cond: (ctid = '(1,1)'::tid)
15141501 -> Nested Loop
15151502 Join Filter: (bmt1.c1 = bmt4.c1)
1516- -> Tid Scan on t4 bmt4
1517- TID Cond: (ctid = '(1,1)'::tid)
15181503 -> Nested Loop
15191504 Join Filter: (bmt1.c1 = bmt3.c1)
1520- -> Tid Scan on t3 bmt3
1521- TID Cond: (ctid = '(1,1)'::tid)
15221505 -> Nested Loop
15231506 Join Filter: (bmt1.c1 = bmt2.c1)
15241507 -> Tid Scan on t1 bmt1
15251508 TID Cond: (ctid = '(1,1)'::tid)
1526- -> Materialize
1527- -> Seq Scan on t2 bmt2
1528- Filter: (ctid = '(1,1)'::tid)
1529-(67 rows)
1509+ -> Seq Scan on t2 bmt2
1510+ Filter: (ctid = '(1,1)'::tid)
1511+ -> Tid Scan on t3 bmt3
1512+ TID Cond: (ctid = '(1,1)'::tid)
1513+ -> Tid Scan on t4 bmt4
1514+ TID Cond: (ctid = '(1,1)'::tid)
1515+(63 rows)
15301516
15311517 -- No. L-2-1-3
15321518 EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = sbmt3.c1 AND sbmt3.ctid = '(1,1)' AND bmt1.c1 = sbmt4.c1 AND sbmt4.ctid = '(1,1)';
1533- QUERY PLAN
1534----------------------------------------------------------------
1519+ QUERY PLAN
1520+-----------------------------------------------------------
15351521 Aggregate
15361522 -> Nested Loop
15371523 Join Filter: (bmt1.c1 = bmt4.c1)
1538- -> Tid Scan on t4 bmt4
1539- TID Cond: (ctid = '(1,1)'::tid)
15401524 -> Nested Loop
15411525 Join Filter: (bmt1.c1 = bmt3.c1)
1542- -> Tid Scan on t3 bmt3
1543- TID Cond: (ctid = '(1,1)'::tid)
15441526 -> Nested Loop
15451527 Join Filter: (bmt1.c1 = bmt2.c1)
15461528 -> Tid Scan on t1 bmt1
15471529 TID Cond: (ctid = '(1,1)'::tid)
1548- -> Materialize
1549- -> Seq Scan on t2 bmt2
1550- Filter: (ctid = '(1,1)'::tid)
1551-(16 rows)
1530+ -> Seq Scan on t2 bmt2
1531+ Filter: (ctid = '(1,1)'::tid)
1532+ -> Tid Scan on t3 bmt3
1533+ TID Cond: (ctid = '(1,1)'::tid)
1534+ -> Tid Scan on t4 bmt4
1535+ TID Cond: (ctid = '(1,1)'::tid)
1536+(15 rows)
15521537
15531538 /*+
15541539 Leading(bmt4 bmt3 bmt2 bmt1)
@@ -1561,47 +1546,45 @@ not used hint:
15611546 duplication hint:
15621547 error hint:
15631548
1564- QUERY PLAN
1565------------------------------------------------------------------
1549+ QUERY PLAN
1550+-----------------------------------------------------------
15661551 Aggregate
15671552 -> Nested Loop
15681553 Join Filter: (bmt2.c1 = bmt1.c1)
1569- -> Tid Scan on t1 bmt1
1570- TID Cond: (ctid = '(1,1)'::tid)
15711554 -> Nested Loop
15721555 Join Filter: (bmt3.c1 = bmt2.c1)
1573- -> Seq Scan on t2 bmt2
1574- Filter: (ctid = '(1,1)'::tid)
15751556 -> Nested Loop
15761557 Join Filter: (bmt3.c1 = bmt4.c1)
15771558 -> Tid Scan on t3 bmt3
15781559 TID Cond: (ctid = '(1,1)'::tid)
1579- -> Materialize
1580- -> Tid Scan on t4 bmt4
1581- TID Cond: (ctid = '(1,1)'::tid)
1582-(16 rows)
1560+ -> Tid Scan on t4 bmt4
1561+ TID Cond: (ctid = '(1,1)'::tid)
1562+ -> Seq Scan on t2 bmt2
1563+ Filter: (ctid = '(1,1)'::tid)
1564+ -> Tid Scan on t1 bmt1
1565+ TID Cond: (ctid = '(1,1)'::tid)
1566+(15 rows)
15831567
15841568 -- No. L-2-1-4
15851569 EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = sbmt2.c1 AND sbmt2.ctid = '(1,1)' AND bmt1.c1 = sbmt3.c1 AND sbmt3.ctid = '(1,1)' AND bmt1.c1 = sbmt4.c1 AND sbmt4.ctid = '(1,1)';
1586- QUERY PLAN
1587----------------------------------------------------------------
1570+ QUERY PLAN
1571+-----------------------------------------------------------
15881572 Aggregate
15891573 -> Nested Loop
15901574 Join Filter: (bmt1.c1 = bmt4.c1)
1591- -> Tid Scan on t4 bmt4
1592- TID Cond: (ctid = '(1,1)'::tid)
15931575 -> Nested Loop
15941576 Join Filter: (bmt1.c1 = bmt3.c1)
1595- -> Tid Scan on t3 bmt3
1596- TID Cond: (ctid = '(1,1)'::tid)
15971577 -> Nested Loop
15981578 Join Filter: (bmt1.c1 = bmt2.c1)
15991579 -> Tid Scan on t1 bmt1
16001580 TID Cond: (ctid = '(1,1)'::tid)
1601- -> Materialize
1602- -> Seq Scan on t2 bmt2
1603- Filter: (ctid = '(1,1)'::tid)
1604-(16 rows)
1581+ -> Seq Scan on t2 bmt2
1582+ Filter: (ctid = '(1,1)'::tid)
1583+ -> Tid Scan on t3 bmt3
1584+ TID Cond: (ctid = '(1,1)'::tid)
1585+ -> Tid Scan on t4 bmt4
1586+ TID Cond: (ctid = '(1,1)'::tid)
1587+(15 rows)
16051588
16061589 /*+
16071590 Leading(bmt4 bmt3 bmt2 bmt1)
@@ -1614,25 +1597,24 @@ not used hint:
16141597 duplication hint:
16151598 error hint:
16161599
1617- QUERY PLAN
1618------------------------------------------------------------------
1600+ QUERY PLAN
1601+-----------------------------------------------------------
16191602 Aggregate
16201603 -> Nested Loop
16211604 Join Filter: (bmt2.c1 = bmt1.c1)
1622- -> Tid Scan on t1 bmt1
1623- TID Cond: (ctid = '(1,1)'::tid)
16241605 -> Nested Loop
16251606 Join Filter: (bmt3.c1 = bmt2.c1)
1626- -> Seq Scan on t2 bmt2
1627- Filter: (ctid = '(1,1)'::tid)
16281607 -> Nested Loop
16291608 Join Filter: (bmt3.c1 = bmt4.c1)
16301609 -> Tid Scan on t3 bmt3
16311610 TID Cond: (ctid = '(1,1)'::tid)
1632- -> Materialize
1633- -> Tid Scan on t4 bmt4
1634- TID Cond: (ctid = '(1,1)'::tid)
1635-(16 rows)
1611+ -> Tid Scan on t4 bmt4
1612+ TID Cond: (ctid = '(1,1)'::tid)
1613+ -> Seq Scan on t2 bmt2
1614+ Filter: (ctid = '(1,1)'::tid)
1615+ -> Tid Scan on t1 bmt1
1616+ TID Cond: (ctid = '(1,1)'::tid)
1617+(15 rows)
16361618
16371619 -- No. L-2-1-5
16381620 EXPLAIN (COSTS false)
@@ -1643,60 +1625,57 @@ SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1
16431625 SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
16441626 )
16451627 ;
1646- QUERY PLAN
1647------------------------------------------------------------------------
1628+ QUERY PLAN
1629+-------------------------------------------------------------------
16481630 Aggregate
16491631 InitPlan 1 (returns $0)
16501632 -> Aggregate
16511633 -> Nested Loop
16521634 Join Filter: (b1t1.c1 = b1t4.c1)
1653- -> Tid Scan on t4 b1t4
1654- TID Cond: (ctid = '(1,1)'::tid)
16551635 -> Nested Loop
16561636 Join Filter: (b1t1.c1 = b1t3.c1)
1657- -> Tid Scan on t3 b1t3
1658- TID Cond: (ctid = '(1,1)'::tid)
16591637 -> Nested Loop
16601638 Join Filter: (b1t1.c1 = b1t2.c1)
16611639 -> Tid Scan on t1 b1t1
16621640 TID Cond: (ctid = '(1,1)'::tid)
1663- -> Materialize
1664- -> Seq Scan on t2 b1t2
1665- Filter: (ctid = '(1,1)'::tid)
1641+ -> Seq Scan on t2 b1t2
1642+ Filter: (ctid = '(1,1)'::tid)
1643+ -> Tid Scan on t3 b1t3
1644+ TID Cond: (ctid = '(1,1)'::tid)
1645+ -> Tid Scan on t4 b1t4
1646+ TID Cond: (ctid = '(1,1)'::tid)
16661647 InitPlan 2 (returns $1)
16671648 -> Aggregate
16681649 -> Nested Loop
16691650 Join Filter: (b2t1.c1 = b2t4.c1)
1670- -> Tid Scan on t4 b2t4
1671- TID Cond: (ctid = '(1,1)'::tid)
16721651 -> Nested Loop
16731652 Join Filter: (b2t1.c1 = b2t3.c1)
1674- -> Tid Scan on t3 b2t3
1675- TID Cond: (ctid = '(1,1)'::tid)
16761653 -> Nested Loop
16771654 Join Filter: (b2t1.c1 = b2t2.c1)
16781655 -> Tid Scan on t1 b2t1
16791656 TID Cond: (ctid = '(1,1)'::tid)
1680- -> Materialize
1681- -> Seq Scan on t2 b2t2
1682- Filter: (ctid = '(1,1)'::tid)
1657+ -> Seq Scan on t2 b2t2
1658+ Filter: (ctid = '(1,1)'::tid)
1659+ -> Tid Scan on t3 b2t3
1660+ TID Cond: (ctid = '(1,1)'::tid)
1661+ -> Tid Scan on t4 b2t4
1662+ TID Cond: (ctid = '(1,1)'::tid)
16831663 -> Nested Loop
16841664 Join Filter: (bmt1.c1 = bmt4.c1)
1685- -> Tid Scan on t4 bmt4
1686- TID Cond: (ctid = '(1,1)'::tid)
16871665 -> Nested Loop
16881666 Join Filter: (bmt1.c1 = bmt3.c1)
1689- -> Tid Scan on t3 bmt3
1690- TID Cond: (ctid = '(1,1)'::tid)
16911667 -> Nested Loop
16921668 Join Filter: (bmt1.c1 = bmt2.c1)
16931669 -> Tid Scan on t1 bmt1
16941670 TID Cond: (ctid = '(1,1)'::tid)
16951671 Filter: ((c1 <> $0) AND (c1 <> $1))
1696- -> Materialize
1697- -> Seq Scan on t2 bmt2
1698- Filter: (ctid = '(1,1)'::tid)
1699-(51 rows)
1672+ -> Seq Scan on t2 bmt2
1673+ Filter: (ctid = '(1,1)'::tid)
1674+ -> Tid Scan on t3 bmt3
1675+ TID Cond: (ctid = '(1,1)'::tid)
1676+ -> Tid Scan on t4 bmt4
1677+ TID Cond: (ctid = '(1,1)'::tid)
1678+(48 rows)
17001679
17011680 /*+
17021681 Leading(bmt1 bmt2 bmt3 bmt4)
@@ -1720,60 +1699,57 @@ not used hint:
17201699 duplication hint:
17211700 error hint:
17221701
1723- QUERY PLAN
1724--------------------------------------------------------------------------
1702+ QUERY PLAN
1703+-------------------------------------------------------------------
17251704 Aggregate
17261705 InitPlan 1 (returns $0)
17271706 -> Aggregate
17281707 -> Nested Loop
17291708 Join Filter: (b1t2.c1 = b1t1.c1)
1730- -> Tid Scan on t1 b1t1
1731- TID Cond: (ctid = '(1,1)'::tid)
17321709 -> Nested Loop
17331710 Join Filter: (b1t2.c1 = b1t4.c1)
1734- -> Tid Scan on t4 b1t4
1735- TID Cond: (ctid = '(1,1)'::tid)
17361711 -> Nested Loop
17371712 Join Filter: (b1t2.c1 = b1t3.c1)
17381713 -> Seq Scan on t2 b1t2
17391714 Filter: (ctid = '(1,1)'::tid)
1740- -> Materialize
1741- -> Tid Scan on t3 b1t3
1742- TID Cond: (ctid = '(1,1)'::tid)
1715+ -> Tid Scan on t3 b1t3
1716+ TID Cond: (ctid = '(1,1)'::tid)
1717+ -> Tid Scan on t4 b1t4
1718+ TID Cond: (ctid = '(1,1)'::tid)
1719+ -> Tid Scan on t1 b1t1
1720+ TID Cond: (ctid = '(1,1)'::tid)
17431721 InitPlan 2 (returns $1)
17441722 -> Aggregate
17451723 -> Nested Loop
17461724 Join Filter: (b2t1.c1 = b2t2.c1)
1747- -> Seq Scan on t2 b2t2
1748- Filter: (ctid = '(1,1)'::tid)
17491725 -> Nested Loop
17501726 Join Filter: (b2t3.c1 = b2t1.c1)
1751- -> Tid Scan on t1 b2t1
1752- TID Cond: (ctid = '(1,1)'::tid)
17531727 -> Nested Loop
17541728 Join Filter: (b2t3.c1 = b2t4.c1)
17551729 -> Tid Scan on t3 b2t3
17561730 TID Cond: (ctid = '(1,1)'::tid)
1757- -> Materialize
1758- -> Tid Scan on t4 b2t4
1759- TID Cond: (ctid = '(1,1)'::tid)
1731+ -> Tid Scan on t4 b2t4
1732+ TID Cond: (ctid = '(1,1)'::tid)
1733+ -> Tid Scan on t1 b2t1
1734+ TID Cond: (ctid = '(1,1)'::tid)
1735+ -> Seq Scan on t2 b2t2
1736+ Filter: (ctid = '(1,1)'::tid)
17601737 -> Nested Loop
17611738 Join Filter: (bmt1.c1 = bmt4.c1)
1762- -> Tid Scan on t4 bmt4
1763- TID Cond: (ctid = '(1,1)'::tid)
17641739 -> Nested Loop
17651740 Join Filter: (bmt1.c1 = bmt3.c1)
1766- -> Tid Scan on t3 bmt3
1767- TID Cond: (ctid = '(1,1)'::tid)
17681741 -> Nested Loop
17691742 Join Filter: (bmt1.c1 = bmt2.c1)
17701743 -> Tid Scan on t1 bmt1
17711744 TID Cond: (ctid = '(1,1)'::tid)
17721745 Filter: ((c1 <> $0) AND (c1 <> $1))
1773- -> Materialize
1774- -> Seq Scan on t2 bmt2
1775- Filter: (ctid = '(1,1)'::tid)
1776-(51 rows)
1746+ -> Seq Scan on t2 bmt2
1747+ Filter: (ctid = '(1,1)'::tid)
1748+ -> Tid Scan on t3 bmt3
1749+ TID Cond: (ctid = '(1,1)'::tid)
1750+ -> Tid Scan on t4 bmt4
1751+ TID Cond: (ctid = '(1,1)'::tid)
1752+(48 rows)
17771753
17781754 -- No. L-2-1-6
17791755 EXPLAIN (COSTS false)
@@ -1793,70 +1769,66 @@ SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3
17931769 -> Aggregate
17941770 -> Nested Loop
17951771 Join Filter: (b1t1.c1 = b1t4.c1)
1796- -> Tid Scan on t4 b1t4
1797- TID Cond: (ctid = '(1,1)'::tid)
17981772 -> Nested Loop
17991773 Join Filter: (b1t1.c1 = b1t3.c1)
1800- -> Tid Scan on t3 b1t3
1801- TID Cond: (ctid = '(1,1)'::tid)
18021774 -> Nested Loop
18031775 Join Filter: (b1t1.c1 = b1t2.c1)
18041776 -> Tid Scan on t1 b1t1
18051777 TID Cond: (ctid = '(1,1)'::tid)
1806- -> Materialize
1807- -> Seq Scan on t2 b1t2
1808- Filter: (ctid = '(1,1)'::tid)
1778+ -> Seq Scan on t2 b1t2
1779+ Filter: (ctid = '(1,1)'::tid)
1780+ -> Tid Scan on t3 b1t3
1781+ TID Cond: (ctid = '(1,1)'::tid)
1782+ -> Tid Scan on t4 b1t4
1783+ TID Cond: (ctid = '(1,1)'::tid)
18091784 InitPlan 2 (returns $1)
18101785 -> Aggregate
18111786 -> Nested Loop
18121787 Join Filter: (b2t1.c1 = b2t4.c1)
1813- -> Tid Scan on t4 b2t4
1814- TID Cond: (ctid = '(1,1)'::tid)
18151788 -> Nested Loop
18161789 Join Filter: (b2t1.c1 = b2t3.c1)
1817- -> Tid Scan on t3 b2t3
1818- TID Cond: (ctid = '(1,1)'::tid)
18191790 -> Nested Loop
18201791 Join Filter: (b2t1.c1 = b2t2.c1)
18211792 -> Tid Scan on t1 b2t1
18221793 TID Cond: (ctid = '(1,1)'::tid)
1823- -> Materialize
1824- -> Seq Scan on t2 b2t2
1825- Filter: (ctid = '(1,1)'::tid)
1794+ -> Seq Scan on t2 b2t2
1795+ Filter: (ctid = '(1,1)'::tid)
1796+ -> Tid Scan on t3 b2t3
1797+ TID Cond: (ctid = '(1,1)'::tid)
1798+ -> Tid Scan on t4 b2t4
1799+ TID Cond: (ctid = '(1,1)'::tid)
18261800 InitPlan 3 (returns $2)
18271801 -> Aggregate
18281802 -> Nested Loop
18291803 Join Filter: (b3t1.c1 = b3t4.c1)
1830- -> Tid Scan on t4 b3t4
1831- TID Cond: (ctid = '(1,1)'::tid)
18321804 -> Nested Loop
18331805 Join Filter: (b3t1.c1 = b3t3.c1)
1834- -> Tid Scan on t3 b3t3
1835- TID Cond: (ctid = '(1,1)'::tid)
18361806 -> Nested Loop
18371807 Join Filter: (b3t1.c1 = b3t2.c1)
18381808 -> Tid Scan on t1 b3t1
18391809 TID Cond: (ctid = '(1,1)'::tid)
1840- -> Materialize
1841- -> Seq Scan on t2 b3t2
1842- Filter: (ctid = '(1,1)'::tid)
1810+ -> Seq Scan on t2 b3t2
1811+ Filter: (ctid = '(1,1)'::tid)
1812+ -> Tid Scan on t3 b3t3
1813+ TID Cond: (ctid = '(1,1)'::tid)
1814+ -> Tid Scan on t4 b3t4
1815+ TID Cond: (ctid = '(1,1)'::tid)
18431816 -> Nested Loop
18441817 Join Filter: (bmt1.c1 = bmt4.c1)
1845- -> Tid Scan on t4 bmt4
1846- TID Cond: (ctid = '(1,1)'::tid)
18471818 -> Nested Loop
18481819 Join Filter: (bmt1.c1 = bmt3.c1)
1849- -> Tid Scan on t3 bmt3
1850- TID Cond: (ctid = '(1,1)'::tid)
18511820 -> Nested Loop
18521821 Join Filter: (bmt1.c1 = bmt2.c1)
18531822 -> Tid Scan on t1 bmt1
18541823 TID Cond: (ctid = '(1,1)'::tid)
18551824 Filter: ((c1 <> $0) AND (c1 <> $1) AND (c1 <> $2))
1856- -> Materialize
1857- -> Seq Scan on t2 bmt2
1858- Filter: (ctid = '(1,1)'::tid)
1859-(68 rows)
1825+ -> Seq Scan on t2 bmt2
1826+ Filter: (ctid = '(1,1)'::tid)
1827+ -> Tid Scan on t3 bmt3
1828+ TID Cond: (ctid = '(1,1)'::tid)
1829+ -> Tid Scan on t4 bmt4
1830+ TID Cond: (ctid = '(1,1)'::tid)
1831+(64 rows)
18601832
18611833 /*+
18621834 Leading(bmt1 bmt2 bmt3 bmt4)
@@ -1891,70 +1863,66 @@ error hint:
18911863 -> Aggregate
18921864 -> Nested Loop
18931865 Join Filter: (b1t2.c1 = b1t1.c1)
1894- -> Tid Scan on t1 b1t1
1895- TID Cond: (ctid = '(1,1)'::tid)
18961866 -> Nested Loop
18971867 Join Filter: (b1t2.c1 = b1t4.c1)
1898- -> Tid Scan on t4 b1t4
1899- TID Cond: (ctid = '(1,1)'::tid)
19001868 -> Nested Loop
19011869 Join Filter: (b1t2.c1 = b1t3.c1)
19021870 -> Seq Scan on t2 b1t2
19031871 Filter: (ctid = '(1,1)'::tid)
1904- -> Materialize
1905- -> Tid Scan on t3 b1t3
1906- TID Cond: (ctid = '(1,1)'::tid)
1872+ -> Tid Scan on t3 b1t3
1873+ TID Cond: (ctid = '(1,1)'::tid)
1874+ -> Tid Scan on t4 b1t4
1875+ TID Cond: (ctid = '(1,1)'::tid)
1876+ -> Tid Scan on t1 b1t1
1877+ TID Cond: (ctid = '(1,1)'::tid)
19071878 InitPlan 2 (returns $1)
19081879 -> Aggregate
19091880 -> Nested Loop
19101881 Join Filter: (b2t1.c1 = b2t2.c1)
1911- -> Seq Scan on t2 b2t2
1912- Filter: (ctid = '(1,1)'::tid)
19131882 -> Nested Loop
19141883 Join Filter: (b2t3.c1 = b2t1.c1)
1915- -> Tid Scan on t1 b2t1
1916- TID Cond: (ctid = '(1,1)'::tid)
19171884 -> Nested Loop
19181885 Join Filter: (b2t3.c1 = b2t4.c1)
19191886 -> Tid Scan on t3 b2t3
19201887 TID Cond: (ctid = '(1,1)'::tid)
1921- -> Materialize
1922- -> Tid Scan on t4 b2t4
1923- TID Cond: (ctid = '(1,1)'::tid)
1888+ -> Tid Scan on t4 b2t4
1889+ TID Cond: (ctid = '(1,1)'::tid)
1890+ -> Tid Scan on t1 b2t1
1891+ TID Cond: (ctid = '(1,1)'::tid)
1892+ -> Seq Scan on t2 b2t2
1893+ Filter: (ctid = '(1,1)'::tid)
19241894 InitPlan 3 (returns $2)
19251895 -> Aggregate
19261896 -> Nested Loop
19271897 Join Filter: (b3t1.c1 = b3t3.c1)
1928- -> Tid Scan on t3 b3t3
1929- TID Cond: (ctid = '(1,1)'::tid)
19301898 -> Nested Loop
19311899 Join Filter: (b3t1.c1 = b3t2.c1)
1932- -> Seq Scan on t2 b3t2
1933- Filter: (ctid = '(1,1)'::tid)
19341900 -> Nested Loop
19351901 Join Filter: (b3t1.c1 = b3t4.c1)
19361902 -> Tid Scan on t1 b3t1
19371903 TID Cond: (ctid = '(1,1)'::tid)
1938- -> Materialize
1939- -> Tid Scan on t4 b3t4
1940- TID Cond: (ctid = '(1,1)'::tid)
1904+ -> Tid Scan on t4 b3t4
1905+ TID Cond: (ctid = '(1,1)'::tid)
1906+ -> Seq Scan on t2 b3t2
1907+ Filter: (ctid = '(1,1)'::tid)
1908+ -> Tid Scan on t3 b3t3
1909+ TID Cond: (ctid = '(1,1)'::tid)
19411910 -> Nested Loop
19421911 Join Filter: (bmt1.c1 = bmt4.c1)
1943- -> Tid Scan on t4 bmt4
1944- TID Cond: (ctid = '(1,1)'::tid)
19451912 -> Nested Loop
19461913 Join Filter: (bmt1.c1 = bmt3.c1)
1947- -> Tid Scan on t3 bmt3
1948- TID Cond: (ctid = '(1,1)'::tid)
19491914 -> Nested Loop
19501915 Join Filter: (bmt1.c1 = bmt2.c1)
19511916 -> Tid Scan on t1 bmt1
19521917 TID Cond: (ctid = '(1,1)'::tid)
19531918 Filter: ((c1 <> $0) AND (c1 <> $1) AND (c1 <> $2))
1954- -> Materialize
1955- -> Seq Scan on t2 bmt2
1956- Filter: (ctid = '(1,1)'::tid)
1957-(68 rows)
1919+ -> Seq Scan on t2 bmt2
1920+ Filter: (ctid = '(1,1)'::tid)
1921+ -> Tid Scan on t3 bmt3
1922+ TID Cond: (ctid = '(1,1)'::tid)
1923+ -> Tid Scan on t4 bmt4
1924+ TID Cond: (ctid = '(1,1)'::tid)
1925+(64 rows)
19581926
19591927 -- No. L-2-1-7
19601928 EXPLAIN (COSTS false)
@@ -1977,57 +1945,55 @@ AND bmt1.c1 = c2.c1
19771945 -> Aggregate
19781946 -> Nested Loop
19791947 Join Filter: (b1t1.c1 = b1t4.c1)
1980- -> Tid Scan on t4 b1t4
1981- TID Cond: (ctid = '(1,1)'::tid)
19821948 -> Nested Loop
19831949 Join Filter: (b1t1.c1 = b1t3.c1)
1984- -> Tid Scan on t3 b1t3
1985- TID Cond: (ctid = '(1,1)'::tid)
19861950 -> Nested Loop
19871951 Join Filter: (b1t1.c1 = b1t2.c1)
19881952 -> Tid Scan on t1 b1t1
19891953 TID Cond: (ctid = '(1,1)'::tid)
1990- -> Materialize
1991- -> Seq Scan on t2 b1t2
1992- Filter: (ctid = '(1,1)'::tid)
1954+ -> Seq Scan on t2 b1t2
1955+ Filter: (ctid = '(1,1)'::tid)
1956+ -> Tid Scan on t3 b1t3
1957+ TID Cond: (ctid = '(1,1)'::tid)
1958+ -> Tid Scan on t4 b1t4
1959+ TID Cond: (ctid = '(1,1)'::tid)
19931960 CTE c2
19941961 -> Aggregate
19951962 -> Nested Loop
19961963 Join Filter: (b2t1.c1 = b2t4.c1)
1997- -> Tid Scan on t4 b2t4
1998- TID Cond: (ctid = '(1,1)'::tid)
19991964 -> Nested Loop
20001965 Join Filter: (b2t1.c1 = b2t3.c1)
2001- -> Tid Scan on t3 b2t3
2002- TID Cond: (ctid = '(1,1)'::tid)
20031966 -> Nested Loop
20041967 Join Filter: (b2t1.c1 = b2t2.c1)
20051968 -> Tid Scan on t1 b2t1
20061969 TID Cond: (ctid = '(1,1)'::tid)
2007- -> Materialize
2008- -> Seq Scan on t2 b2t2
2009- Filter: (ctid = '(1,1)'::tid)
1970+ -> Seq Scan on t2 b2t2
1971+ Filter: (ctid = '(1,1)'::tid)
1972+ -> Tid Scan on t3 b2t3
1973+ TID Cond: (ctid = '(1,1)'::tid)
1974+ -> Tid Scan on t4 b2t4
1975+ TID Cond: (ctid = '(1,1)'::tid)
20101976 -> Nested Loop
20111977 Join Filter: (bmt1.c1 = c2.c1)
20121978 -> Nested Loop
2013- Join Filter: (bmt1.c1 = bmt4.c1)
2014- -> Tid Scan on t4 bmt4
2015- TID Cond: (ctid = '(1,1)'::tid)
1979+ Join Filter: (bmt1.c1 = c1.c1)
20161980 -> Nested Loop
2017- Join Filter: (bmt1.c1 = bmt3.c1)
2018- -> Tid Scan on t3 bmt3
2019- TID Cond: (ctid = '(1,1)'::tid)
1981+ Join Filter: (bmt1.c1 = bmt4.c1)
20201982 -> Nested Loop
2021- Join Filter: (bmt1.c1 = bmt2.c1)
2022- -> Seq Scan on t2 bmt2
2023- Filter: (ctid = '(1,1)'::tid)
1983+ Join Filter: (bmt1.c1 = bmt3.c1)
20241984 -> Nested Loop
2025- Join Filter: (bmt1.c1 = c1.c1)
1985+ Join Filter: (bmt1.c1 = bmt2.c1)
20261986 -> Tid Scan on t1 bmt1
20271987 TID Cond: (ctid = '(1,1)'::tid)
2028- -> CTE Scan on c1
1988+ -> Seq Scan on t2 bmt2
1989+ Filter: (ctid = '(1,1)'::tid)
1990+ -> Tid Scan on t3 bmt3
1991+ TID Cond: (ctid = '(1,1)'::tid)
1992+ -> Tid Scan on t4 bmt4
1993+ TID Cond: (ctid = '(1,1)'::tid)
1994+ -> CTE Scan on c1
20291995 -> CTE Scan on c2
2030-(55 rows)
1996+(53 rows)
20311997
20321998 /*+
20331999 Leading(c2 c1 bmt1 bmt2 bmt3 bmt4)
@@ -2056,64 +2022,62 @@ not used hint:
20562022 duplication hint:
20572023 error hint:
20582024
2059- QUERY PLAN
2060--------------------------------------------------------------------------
2025+ QUERY PLAN
2026+-------------------------------------------------------------------
20612027 Aggregate
20622028 CTE c1
20632029 -> Aggregate
20642030 -> Nested Loop
20652031 Join Filter: (b1t2.c1 = b1t1.c1)
2066- -> Tid Scan on t1 b1t1
2067- TID Cond: (ctid = '(1,1)'::tid)
20682032 -> Nested Loop
20692033 Join Filter: (b1t2.c1 = b1t4.c1)
2070- -> Tid Scan on t4 b1t4
2071- TID Cond: (ctid = '(1,1)'::tid)
20722034 -> Nested Loop
20732035 Join Filter: (b1t2.c1 = b1t3.c1)
20742036 -> Seq Scan on t2 b1t2
20752037 Filter: (ctid = '(1,1)'::tid)
2076- -> Materialize
2077- -> Tid Scan on t3 b1t3
2078- TID Cond: (ctid = '(1,1)'::tid)
2038+ -> Tid Scan on t3 b1t3
2039+ TID Cond: (ctid = '(1,1)'::tid)
2040+ -> Tid Scan on t4 b1t4
2041+ TID Cond: (ctid = '(1,1)'::tid)
2042+ -> Tid Scan on t1 b1t1
2043+ TID Cond: (ctid = '(1,1)'::tid)
20792044 CTE c2
20802045 -> Aggregate
20812046 -> Nested Loop
20822047 Join Filter: (b2t1.c1 = b2t2.c1)
2083- -> Seq Scan on t2 b2t2
2084- Filter: (ctid = '(1,1)'::tid)
20852048 -> Nested Loop
20862049 Join Filter: (b2t3.c1 = b2t1.c1)
2087- -> Tid Scan on t1 b2t1
2088- TID Cond: (ctid = '(1,1)'::tid)
20892050 -> Nested Loop
20902051 Join Filter: (b2t3.c1 = b2t4.c1)
20912052 -> Tid Scan on t3 b2t3
20922053 TID Cond: (ctid = '(1,1)'::tid)
2093- -> Materialize
2094- -> Tid Scan on t4 b2t4
2095- TID Cond: (ctid = '(1,1)'::tid)
2054+ -> Tid Scan on t4 b2t4
2055+ TID Cond: (ctid = '(1,1)'::tid)
2056+ -> Tid Scan on t1 b2t1
2057+ TID Cond: (ctid = '(1,1)'::tid)
2058+ -> Seq Scan on t2 b2t2
2059+ Filter: (ctid = '(1,1)'::tid)
20962060 -> Nested Loop
20972061 Join Filter: (bmt1.c1 = bmt4.c1)
2098- -> Tid Scan on t4 bmt4
2099- TID Cond: (ctid = '(1,1)'::tid)
21002062 -> Nested Loop
21012063 Join Filter: (bmt1.c1 = bmt3.c1)
2102- -> Tid Scan on t3 bmt3
2103- TID Cond: (ctid = '(1,1)'::tid)
21042064 -> Nested Loop
21052065 Join Filter: (bmt1.c1 = bmt2.c1)
2106- -> Seq Scan on t2 bmt2
2107- Filter: (ctid = '(1,1)'::tid)
21082066 -> Nested Loop
21092067 Join Filter: (c1.c1 = bmt1.c1)
2110- -> Tid Scan on t1 bmt1
2111- TID Cond: (ctid = '(1,1)'::tid)
21122068 -> Nested Loop
21132069 Join Filter: (c1.c1 = c2.c1)
21142070 -> CTE Scan on c1
21152071 -> CTE Scan on c2
2116-(55 rows)
2072+ -> Tid Scan on t1 bmt1
2073+ TID Cond: (ctid = '(1,1)'::tid)
2074+ -> Seq Scan on t2 bmt2
2075+ Filter: (ctid = '(1,1)'::tid)
2076+ -> Tid Scan on t3 bmt3
2077+ TID Cond: (ctid = '(1,1)'::tid)
2078+ -> Tid Scan on t4 bmt4
2079+ TID Cond: (ctid = '(1,1)'::tid)
2080+(53 rows)
21172081
21182082 -- No. L-2-1-8
21192083 EXPLAIN (COSTS false)
@@ -2140,77 +2104,74 @@ AND bmt1.c1 = c3.c1
21402104 -> Aggregate
21412105 -> Nested Loop
21422106 Join Filter: (b1t1.c1 = b1t4.c1)
2143- -> Tid Scan on t4 b1t4
2144- TID Cond: (ctid = '(1,1)'::tid)
21452107 -> Nested Loop
21462108 Join Filter: (b1t1.c1 = b1t3.c1)
2147- -> Tid Scan on t3 b1t3
2148- TID Cond: (ctid = '(1,1)'::tid)
21492109 -> Nested Loop
21502110 Join Filter: (b1t1.c1 = b1t2.c1)
21512111 -> Tid Scan on t1 b1t1
21522112 TID Cond: (ctid = '(1,1)'::tid)
2153- -> Materialize
2154- -> Seq Scan on t2 b1t2
2155- Filter: (ctid = '(1,1)'::tid)
2113+ -> Seq Scan on t2 b1t2
2114+ Filter: (ctid = '(1,1)'::tid)
2115+ -> Tid Scan on t3 b1t3
2116+ TID Cond: (ctid = '(1,1)'::tid)
2117+ -> Tid Scan on t4 b1t4
2118+ TID Cond: (ctid = '(1,1)'::tid)
21562119 CTE c2
21572120 -> Aggregate
21582121 -> Nested Loop
21592122 Join Filter: (b2t1.c1 = b2t4.c1)
2160- -> Tid Scan on t4 b2t4
2161- TID Cond: (ctid = '(1,1)'::tid)
21622123 -> Nested Loop
21632124 Join Filter: (b2t1.c1 = b2t3.c1)
2164- -> Tid Scan on t3 b2t3
2165- TID Cond: (ctid = '(1,1)'::tid)
21662125 -> Nested Loop
21672126 Join Filter: (b2t1.c1 = b2t2.c1)
21682127 -> Tid Scan on t1 b2t1
21692128 TID Cond: (ctid = '(1,1)'::tid)
2170- -> Materialize
2171- -> Seq Scan on t2 b2t2
2172- Filter: (ctid = '(1,1)'::tid)
2129+ -> Seq Scan on t2 b2t2
2130+ Filter: (ctid = '(1,1)'::tid)
2131+ -> Tid Scan on t3 b2t3
2132+ TID Cond: (ctid = '(1,1)'::tid)
2133+ -> Tid Scan on t4 b2t4
2134+ TID Cond: (ctid = '(1,1)'::tid)
21732135 CTE c3
21742136 -> Aggregate
21752137 -> Nested Loop
21762138 Join Filter: (b3t1.c1 = b3t4.c1)
2177- -> Tid Scan on t4 b3t4
2178- TID Cond: (ctid = '(1,1)'::tid)
21792139 -> Nested Loop
21802140 Join Filter: (b3t1.c1 = b3t3.c1)
2181- -> Tid Scan on t3 b3t3
2182- TID Cond: (ctid = '(1,1)'::tid)
21832141 -> Nested Loop
21842142 Join Filter: (b3t1.c1 = b3t2.c1)
21852143 -> Tid Scan on t1 b3t1
21862144 TID Cond: (ctid = '(1,1)'::tid)
2187- -> Materialize
2188- -> Seq Scan on t2 b3t2
2189- Filter: (ctid = '(1,1)'::tid)
2145+ -> Seq Scan on t2 b3t2
2146+ Filter: (ctid = '(1,1)'::tid)
2147+ -> Tid Scan on t3 b3t3
2148+ TID Cond: (ctid = '(1,1)'::tid)
2149+ -> Tid Scan on t4 b3t4
2150+ TID Cond: (ctid = '(1,1)'::tid)
21902151 -> Nested Loop
21912152 Join Filter: (bmt1.c1 = c3.c1)
21922153 -> Nested Loop
21932154 Join Filter: (bmt1.c1 = c2.c1)
21942155 -> Nested Loop
2195- Join Filter: (bmt1.c1 = bmt4.c1)
2196- -> Tid Scan on t4 bmt4
2197- TID Cond: (ctid = '(1,1)'::tid)
2156+ Join Filter: (bmt1.c1 = c1.c1)
21982157 -> Nested Loop
2199- Join Filter: (bmt1.c1 = bmt3.c1)
2200- -> Tid Scan on t3 bmt3
2201- TID Cond: (ctid = '(1,1)'::tid)
2158+ Join Filter: (bmt1.c1 = bmt4.c1)
22022159 -> Nested Loop
2203- Join Filter: (bmt1.c1 = bmt2.c1)
2204- -> Seq Scan on t2 bmt2
2205- Filter: (ctid = '(1,1)'::tid)
2160+ Join Filter: (bmt1.c1 = bmt3.c1)
22062161 -> Nested Loop
2207- Join Filter: (bmt1.c1 = c1.c1)
2162+ Join Filter: (bmt1.c1 = bmt2.c1)
22082163 -> Tid Scan on t1 bmt1
22092164 TID Cond: (ctid = '(1,1)'::tid)
2210- -> CTE Scan on c1
2165+ -> Seq Scan on t2 bmt2
2166+ Filter: (ctid = '(1,1)'::tid)
2167+ -> Tid Scan on t3 bmt3
2168+ TID Cond: (ctid = '(1,1)'::tid)
2169+ -> Tid Scan on t4 bmt4
2170+ TID Cond: (ctid = '(1,1)'::tid)
2171+ -> CTE Scan on c1
22112172 -> CTE Scan on c2
22122173 -> CTE Scan on c3
2213-(75 rows)
2174+(72 rows)
22142175
22152176 /*+
22162177 Leading(c3 c2 c1 bmt1 bmt2 bmt3 bmt4)
@@ -2245,76 +2206,65 @@ not used hint:
22452206 duplication hint:
22462207 error hint:
22472208
2248- QUERY PLAN
2249--------------------------------------------------------------------------
2209+ QUERY PLAN
2210+--------------------------------------------------------------------
22502211 Aggregate
22512212 CTE c1
22522213 -> Aggregate
22532214 -> Nested Loop
22542215 Join Filter: (b1t2.c1 = b1t1.c1)
2255- -> Tid Scan on t1 b1t1
2256- TID Cond: (ctid = '(1,1)'::tid)
22572216 -> Nested Loop
22582217 Join Filter: (b1t2.c1 = b1t4.c1)
2259- -> Tid Scan on t4 b1t4
2260- TID Cond: (ctid = '(1,1)'::tid)
22612218 -> Nested Loop
22622219 Join Filter: (b1t2.c1 = b1t3.c1)
22632220 -> Seq Scan on t2 b1t2
22642221 Filter: (ctid = '(1,1)'::tid)
2265- -> Materialize
2266- -> Tid Scan on t3 b1t3
2267- TID Cond: (ctid = '(1,1)'::tid)
2222+ -> Tid Scan on t3 b1t3
2223+ TID Cond: (ctid = '(1,1)'::tid)
2224+ -> Tid Scan on t4 b1t4
2225+ TID Cond: (ctid = '(1,1)'::tid)
2226+ -> Tid Scan on t1 b1t1
2227+ TID Cond: (ctid = '(1,1)'::tid)
22682228 CTE c2
22692229 -> Aggregate
22702230 -> Nested Loop
22712231 Join Filter: (b2t1.c1 = b2t2.c1)
2272- -> Seq Scan on t2 b2t2
2273- Filter: (ctid = '(1,1)'::tid)
22742232 -> Nested Loop
22752233 Join Filter: (b2t3.c1 = b2t1.c1)
2276- -> Tid Scan on t1 b2t1
2277- TID Cond: (ctid = '(1,1)'::tid)
22782234 -> Nested Loop
22792235 Join Filter: (b2t3.c1 = b2t4.c1)
22802236 -> Tid Scan on t3 b2t3
22812237 TID Cond: (ctid = '(1,1)'::tid)
2282- -> Materialize
2283- -> Tid Scan on t4 b2t4
2284- TID Cond: (ctid = '(1,1)'::tid)
2238+ -> Tid Scan on t4 b2t4
2239+ TID Cond: (ctid = '(1,1)'::tid)
2240+ -> Tid Scan on t1 b2t1
2241+ TID Cond: (ctid = '(1,1)'::tid)
2242+ -> Seq Scan on t2 b2t2
2243+ Filter: (ctid = '(1,1)'::tid)
22852244 CTE c3
22862245 -> Aggregate
22872246 -> Nested Loop
2288- Join Filter: (b3t1.c1 = b3t3.c1)
2289- -> Tid Scan on t3 b3t3
2290- TID Cond: (ctid = '(1,1)'::tid)
2247+ Join Filter: (b3t1.c1 = b3t3.c1)
22912248 -> Nested Loop
22922249 Join Filter: (b3t1.c1 = b3t2.c1)
2293- -> Seq Scan on t2 b3t2
2294- Filter: (ctid = '(1,1)'::tid)
22952250 -> Nested Loop
22962251 Join Filter: (b3t1.c1 = b3t4.c1)
22972252 -> Tid Scan on t1 b3t1
22982253 TID Cond: (ctid = '(1,1)'::tid)
2299- -> Materialize
2300- -> Tid Scan on t4 b3t4
2301- TID Cond: (ctid = '(1,1)'::tid)
2254+ -> Tid Scan on t4 b3t4
2255+ TID Cond: (ctid = '(1,1)'::tid)
2256+ -> Seq Scan on t2 b3t2
2257+ Filter: (ctid = '(1,1)'::tid)
2258+ -> Tid Scan on t3 b3t3
2259+ TID Cond: (ctid = '(1,1)'::tid)
23022260 -> Nested Loop
23032261 Join Filter: (bmt1.c1 = bmt4.c1)
2304- -> Tid Scan on t4 bmt4
2305- TID Cond: (ctid = '(1,1)'::tid)
23062262 -> Nested Loop
23072263 Join Filter: (bmt1.c1 = bmt3.c1)
2308- -> Tid Scan on t3 bmt3
2309- TID Cond: (ctid = '(1,1)'::tid)
23102264 -> Nested Loop
23112265 Join Filter: (bmt1.c1 = bmt2.c1)
2312- -> Seq Scan on t2 bmt2
2313- Filter: (ctid = '(1,1)'::tid)
23142266 -> Nested Loop
23152267 Join Filter: (c1.c1 = bmt1.c1)
2316- -> Tid Scan on t1 bmt1
2317- TID Cond: (ctid = '(1,1)'::tid)
23182268 -> Nested Loop
23192269 Join Filter: (c2.c1 = c1.c1)
23202270 -> Nested Loop
@@ -2322,7 +2272,15 @@ error hint:
23222272 -> CTE Scan on c2
23232273 -> CTE Scan on c3
23242274 -> CTE Scan on c1
2325-(75 rows)
2275+ -> Tid Scan on t1 bmt1
2276+ TID Cond: (ctid = '(1,1)'::tid)
2277+ -> Seq Scan on t2 bmt2
2278+ Filter: (ctid = '(1,1)'::tid)
2279+ -> Tid Scan on t3 bmt3
2280+ TID Cond: (ctid = '(1,1)'::tid)
2281+ -> Tid Scan on t4 bmt4
2282+ TID Cond: (ctid = '(1,1)'::tid)
2283+(72 rows)
23262284
23272285 ----
23282286 ---- No. L-2-2 the number of the tables per quiry block
@@ -2438,8 +2396,8 @@ AND bmt1.c1 <> (
24382396 SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)'
24392397 )
24402398 ;
2441- QUERY PLAN
2442------------------------------------------------------------
2399+ QUERY PLAN
2400+-------------------------------------------------------
24432401 Aggregate
24442402 CTE c1
24452403 -> Aggregate
@@ -2447,38 +2405,35 @@ SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2 WHERE b3t1.ctid = '(1,1)' AND b3
24472405 Join Filter: (b1t1.c1 = b1t2.c1)
24482406 -> Tid Scan on t1 b1t1
24492407 TID Cond: (ctid = '(1,1)'::tid)
2450- -> Materialize
2451- -> Seq Scan on t2 b1t2
2452- Filter: (ctid = '(1,1)'::tid)
2408+ -> Seq Scan on t2 b1t2
2409+ Filter: (ctid = '(1,1)'::tid)
24532410 InitPlan 2 (returns $1)
24542411 -> Aggregate
24552412 -> Nested Loop
24562413 Join Filter: (b2t1.c1 = b2t2.c1)
24572414 -> Tid Scan on t1 b2t1
24582415 TID Cond: (ctid = '(1,1)'::tid)
2459- -> Materialize
2460- -> Seq Scan on t2 b2t2
2461- Filter: (ctid = '(1,1)'::tid)
2416+ -> Seq Scan on t2 b2t2
2417+ Filter: (ctid = '(1,1)'::tid)
24622418 InitPlan 3 (returns $2)
24632419 -> Aggregate
24642420 -> Nested Loop
24652421 Join Filter: (b3t1.c1 = b3t2.c1)
24662422 -> Tid Scan on t1 b3t1
24672423 TID Cond: (ctid = '(1,1)'::tid)
2468- -> Materialize
2469- -> Seq Scan on t2 b3t2
2470- Filter: (ctid = '(1,1)'::tid)
2424+ -> Seq Scan on t2 b3t2
2425+ Filter: (ctid = '(1,1)'::tid)
24712426 -> Nested Loop
2472- Join Filter: (bmt1.c1 = bmt2.c1)
2473- -> Seq Scan on t2 bmt2
2474- Filter: (ctid = '(1,1)'::tid)
2427+ Join Filter: (bmt1.c1 = c1.c1)
24752428 -> Nested Loop
2476- Join Filter: (bmt1.c1 = c1.c1)
2429+ Join Filter: (bmt1.c1 = bmt2.c1)
24772430 -> Tid Scan on t1 bmt1
24782431 TID Cond: (ctid = '(1,1)'::tid)
24792432 Filter: (c1 <> $2)
2480- -> CTE Scan on c1
2481-(38 rows)
2433+ -> Seq Scan on t2 bmt2
2434+ Filter: (ctid = '(1,1)'::tid)
2435+ -> CTE Scan on c1
2436+(35 rows)
24822437
24832438 /*+
24842439 Leading(c1 bmt2 bmt1)
@@ -2509,8 +2464,8 @@ not used hint:
25092464 duplication hint:
25102465 error hint:
25112466
2512- QUERY PLAN
2513------------------------------------------------------------
2467+ QUERY PLAN
2468+-------------------------------------------------------
25142469 Aggregate
25152470 CTE c1
25162471 -> Aggregate
@@ -2518,38 +2473,35 @@ error hint:
25182473 Join Filter: (b1t1.c1 = b1t2.c1)
25192474 -> Tid Scan on t1 b1t1
25202475 TID Cond: (ctid = '(1,1)'::tid)
2521- -> Materialize
2522- -> Seq Scan on t2 b1t2
2523- Filter: (ctid = '(1,1)'::tid)
2476+ -> Seq Scan on t2 b1t2
2477+ Filter: (ctid = '(1,1)'::tid)
25242478 InitPlan 2 (returns $1)
25252479 -> Aggregate
25262480 -> Nested Loop
25272481 Join Filter: (b2t1.c1 = b2t2.c1)
25282482 -> Tid Scan on t1 b2t1
25292483 TID Cond: (ctid = '(1,1)'::tid)
2530- -> Materialize
2531- -> Seq Scan on t2 b2t2
2532- Filter: (ctid = '(1,1)'::tid)
2484+ -> Seq Scan on t2 b2t2
2485+ Filter: (ctid = '(1,1)'::tid)
25332486 InitPlan 3 (returns $2)
25342487 -> Aggregate
25352488 -> Nested Loop
25362489 Join Filter: (b3t1.c1 = b3t2.c1)
25372490 -> Tid Scan on t1 b3t1
25382491 TID Cond: (ctid = '(1,1)'::tid)
2539- -> Materialize
2540- -> Seq Scan on t2 b3t2
2541- Filter: (ctid = '(1,1)'::tid)
2492+ -> Seq Scan on t2 b3t2
2493+ Filter: (ctid = '(1,1)'::tid)
25422494 -> Nested Loop
25432495 Join Filter: (bmt2.c1 = bmt1.c1)
2544- -> Tid Scan on t1 bmt1
2545- TID Cond: (ctid = '(1,1)'::tid)
2546- Filter: (c1 <> $2)
25472496 -> Nested Loop
25482497 Join Filter: (bmt2.c1 = c1.c1)
25492498 -> Seq Scan on t2 bmt2
25502499 Filter: (ctid = '(1,1)'::tid)
25512500 -> CTE Scan on c1
2552-(38 rows)
2501+ -> Tid Scan on t1 bmt1
2502+ TID Cond: (ctid = '(1,1)'::tid)
2503+ Filter: (c1 <> $2)
2504+(35 rows)
25532505
25542506 -- No. L-2-2-3
25552507 EXPLAIN (COSTS false)
@@ -2564,79 +2516,76 @@ AND bmt1.c1 <> (
25642516 SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
25652517 )
25662518 ;
2567- QUERY PLAN
2568------------------------------------------------------------------------
2519+ QUERY PLAN
2520+-------------------------------------------------------------------
25692521 Aggregate
25702522 CTE c1
25712523 -> Aggregate
25722524 -> Nested Loop
25732525 Join Filter: (b1t1.c1 = b1t4.c1)
2574- -> Tid Scan on t4 b1t4
2575- TID Cond: (ctid = '(1,1)'::tid)
25762526 -> Nested Loop
25772527 Join Filter: (b1t1.c1 = b1t3.c1)
2578- -> Tid Scan on t3 b1t3
2579- TID Cond: (ctid = '(1,1)'::tid)
25802528 -> Nested Loop
25812529 Join Filter: (b1t1.c1 = b1t2.c1)
25822530 -> Tid Scan on t1 b1t1
25832531 TID Cond: (ctid = '(1,1)'::tid)
2584- -> Materialize
2585- -> Seq Scan on t2 b1t2
2586- Filter: (ctid = '(1,1)'::tid)
2532+ -> Seq Scan on t2 b1t2
2533+ Filter: (ctid = '(1,1)'::tid)
2534+ -> Tid Scan on t3 b1t3
2535+ TID Cond: (ctid = '(1,1)'::tid)
2536+ -> Tid Scan on t4 b1t4
2537+ TID Cond: (ctid = '(1,1)'::tid)
25872538 InitPlan 2 (returns $1)
25882539 -> Aggregate
25892540 -> Nested Loop
25902541 Join Filter: (b2t1.c1 = b2t4.c1)
2591- -> Tid Scan on t4 b2t4
2592- TID Cond: (ctid = '(1,1)'::tid)
25932542 -> Nested Loop
25942543 Join Filter: (b2t1.c1 = b2t3.c1)
2595- -> Tid Scan on t3 b2t3
2596- TID Cond: (ctid = '(1,1)'::tid)
25972544 -> Nested Loop
25982545 Join Filter: (b2t1.c1 = b2t2.c1)
25992546 -> Tid Scan on t1 b2t1
26002547 TID Cond: (ctid = '(1,1)'::tid)
2601- -> Materialize
2602- -> Seq Scan on t2 b2t2
2603- Filter: (ctid = '(1,1)'::tid)
2548+ -> Seq Scan on t2 b2t2
2549+ Filter: (ctid = '(1,1)'::tid)
2550+ -> Tid Scan on t3 b2t3
2551+ TID Cond: (ctid = '(1,1)'::tid)
2552+ -> Tid Scan on t4 b2t4
2553+ TID Cond: (ctid = '(1,1)'::tid)
26042554 InitPlan 3 (returns $2)
26052555 -> Aggregate
26062556 -> Nested Loop
26072557 Join Filter: (b3t1.c1 = b3t4.c1)
2608- -> Tid Scan on t4 b3t4
2609- TID Cond: (ctid = '(1,1)'::tid)
26102558 -> Nested Loop
26112559 Join Filter: (b3t1.c1 = b3t3.c1)
2612- -> Tid Scan on t3 b3t3
2613- TID Cond: (ctid = '(1,1)'::tid)
26142560 -> Nested Loop
26152561 Join Filter: (b3t1.c1 = b3t2.c1)
26162562 -> Tid Scan on t1 b3t1
26172563 TID Cond: (ctid = '(1,1)'::tid)
2618- -> Materialize
2619- -> Seq Scan on t2 b3t2
2620- Filter: (ctid = '(1,1)'::tid)
2564+ -> Seq Scan on t2 b3t2
2565+ Filter: (ctid = '(1,1)'::tid)
2566+ -> Tid Scan on t3 b3t3
2567+ TID Cond: (ctid = '(1,1)'::tid)
2568+ -> Tid Scan on t4 b3t4
2569+ TID Cond: (ctid = '(1,1)'::tid)
26212570 -> Nested Loop
2622- Join Filter: (bmt1.c1 = bmt4.c1)
2623- -> Tid Scan on t4 bmt4
2624- TID Cond: (ctid = '(1,1)'::tid)
2571+ Join Filter: (bmt1.c1 = c1.c1)
26252572 -> Nested Loop
2626- Join Filter: (bmt1.c1 = bmt3.c1)
2627- -> Tid Scan on t3 bmt3
2628- TID Cond: (ctid = '(1,1)'::tid)
2573+ Join Filter: (bmt1.c1 = bmt4.c1)
26292574 -> Nested Loop
2630- Join Filter: (bmt1.c1 = bmt2.c1)
2631- -> Seq Scan on t2 bmt2
2632- Filter: (ctid = '(1,1)'::tid)
2575+ Join Filter: (bmt1.c1 = bmt3.c1)
26332576 -> Nested Loop
2634- Join Filter: (bmt1.c1 = c1.c1)
2577+ Join Filter: (bmt1.c1 = bmt2.c1)
26352578 -> Tid Scan on t1 bmt1
26362579 TID Cond: (ctid = '(1,1)'::tid)
26372580 Filter: (c1 <> $2)
2638- -> CTE Scan on c1
2639-(70 rows)
2581+ -> Seq Scan on t2 bmt2
2582+ Filter: (ctid = '(1,1)'::tid)
2583+ -> Tid Scan on t3 bmt3
2584+ TID Cond: (ctid = '(1,1)'::tid)
2585+ -> Tid Scan on t4 bmt4
2586+ TID Cond: (ctid = '(1,1)'::tid)
2587+ -> CTE Scan on c1
2588+(67 rows)
26402589
26412590 /*+
26422591 Leading(c1 bmt4 bmt3 bmt2 bmt1)
@@ -2666,79 +2615,76 @@ not used hint:
26662615 duplication hint:
26672616 error hint:
26682617
2669- QUERY PLAN
2670--------------------------------------------------------------------------
2618+ QUERY PLAN
2619+-------------------------------------------------------------------
26712620 Aggregate
26722621 CTE c1
26732622 -> Aggregate
26742623 -> Nested Loop
26752624 Join Filter: (b1t2.c1 = b1t1.c1)
2676- -> Tid Scan on t1 b1t1
2677- TID Cond: (ctid = '(1,1)'::tid)
26782625 -> Nested Loop
26792626 Join Filter: (b1t3.c1 = b1t2.c1)
2680- -> Seq Scan on t2 b1t2
2681- Filter: (ctid = '(1,1)'::tid)
26822627 -> Nested Loop
26832628 Join Filter: (b1t3.c1 = b1t4.c1)
26842629 -> Tid Scan on t3 b1t3
26852630 TID Cond: (ctid = '(1,1)'::tid)
2686- -> Materialize
2687- -> Tid Scan on t4 b1t4
2688- TID Cond: (ctid = '(1,1)'::tid)
2631+ -> Tid Scan on t4 b1t4
2632+ TID Cond: (ctid = '(1,1)'::tid)
2633+ -> Seq Scan on t2 b1t2
2634+ Filter: (ctid = '(1,1)'::tid)
2635+ -> Tid Scan on t1 b1t1
2636+ TID Cond: (ctid = '(1,1)'::tid)
26892637 InitPlan 2 (returns $1)
26902638 -> Aggregate
26912639 -> Nested Loop
26922640 Join Filter: (b2t2.c1 = b2t1.c1)
2693- -> Tid Scan on t1 b2t1
2694- TID Cond: (ctid = '(1,1)'::tid)
26952641 -> Nested Loop
26962642 Join Filter: (b2t3.c1 = b2t2.c1)
2697- -> Seq Scan on t2 b2t2
2698- Filter: (ctid = '(1,1)'::tid)
26992643 -> Nested Loop
27002644 Join Filter: (b2t3.c1 = b2t4.c1)
27012645 -> Tid Scan on t3 b2t3
27022646 TID Cond: (ctid = '(1,1)'::tid)
2703- -> Materialize
2704- -> Tid Scan on t4 b2t4
2705- TID Cond: (ctid = '(1,1)'::tid)
2647+ -> Tid Scan on t4 b2t4
2648+ TID Cond: (ctid = '(1,1)'::tid)
2649+ -> Seq Scan on t2 b2t2
2650+ Filter: (ctid = '(1,1)'::tid)
2651+ -> Tid Scan on t1 b2t1
2652+ TID Cond: (ctid = '(1,1)'::tid)
27062653 InitPlan 3 (returns $2)
27072654 -> Aggregate
27082655 -> Nested Loop
27092656 Join Filter: (b3t2.c1 = b3t1.c1)
2710- -> Tid Scan on t1 b3t1
2711- TID Cond: (ctid = '(1,1)'::tid)
27122657 -> Nested Loop
27132658 Join Filter: (b3t3.c1 = b3t2.c1)
2714- -> Seq Scan on t2 b3t2
2715- Filter: (ctid = '(1,1)'::tid)
27162659 -> Nested Loop
27172660 Join Filter: (b3t3.c1 = b3t4.c1)
27182661 -> Tid Scan on t3 b3t3
27192662 TID Cond: (ctid = '(1,1)'::tid)
2720- -> Materialize
2721- -> Tid Scan on t4 b3t4
2722- TID Cond: (ctid = '(1,1)'::tid)
2663+ -> Tid Scan on t4 b3t4
2664+ TID Cond: (ctid = '(1,1)'::tid)
2665+ -> Seq Scan on t2 b3t2
2666+ Filter: (ctid = '(1,1)'::tid)
2667+ -> Tid Scan on t1 b3t1
2668+ TID Cond: (ctid = '(1,1)'::tid)
27232669 -> Nested Loop
27242670 Join Filter: (bmt2.c1 = bmt1.c1)
2725- -> Tid Scan on t1 bmt1
2726- TID Cond: (ctid = '(1,1)'::tid)
2727- Filter: (c1 <> $2)
27282671 -> Nested Loop
27292672 Join Filter: (bmt3.c1 = bmt2.c1)
2730- -> Seq Scan on t2 bmt2
2731- Filter: (ctid = '(1,1)'::tid)
27322673 -> Nested Loop
27332674 Join Filter: (bmt4.c1 = bmt3.c1)
2734- -> Tid Scan on t3 bmt3
2735- TID Cond: (ctid = '(1,1)'::tid)
27362675 -> Nested Loop
27372676 Join Filter: (bmt4.c1 = c1.c1)
27382677 -> Tid Scan on t4 bmt4
27392678 TID Cond: (ctid = '(1,1)'::tid)
27402679 -> CTE Scan on c1
2741-(70 rows)
2680+ -> Tid Scan on t3 bmt3
2681+ TID Cond: (ctid = '(1,1)'::tid)
2682+ -> Seq Scan on t2 bmt2
2683+ Filter: (ctid = '(1,1)'::tid)
2684+ -> Tid Scan on t1 bmt1
2685+ TID Cond: (ctid = '(1,1)'::tid)
2686+ Filter: (c1 <> $2)
2687+(67 rows)
27422688
27432689 -- No. L-2-2-4
27442690 EXPLAIN (COSTS false)
@@ -2753,26 +2699,25 @@ AND bmt1.c1 <> (
27532699 SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)'
27542700 )
27552701 ;
2756- QUERY PLAN
2757------------------------------------------------------------------------
2702+ QUERY PLAN
2703+-------------------------------------------------------------------
27582704 Aggregate
27592705 CTE c1
27602706 -> Aggregate
27612707 -> Nested Loop
27622708 Join Filter: (b1t1.c1 = b1t4.c1)
2763- -> Tid Scan on t4 b1t4
2764- TID Cond: (ctid = '(1,1)'::tid)
27652709 -> Nested Loop
27662710 Join Filter: (b1t1.c1 = b1t3.c1)
2767- -> Tid Scan on t3 b1t3
2768- TID Cond: (ctid = '(1,1)'::tid)
27692711 -> Nested Loop
27702712 Join Filter: (b1t1.c1 = b1t2.c1)
27712713 -> Tid Scan on t1 b1t1
27722714 TID Cond: (ctid = '(1,1)'::tid)
2773- -> Materialize
2774- -> Seq Scan on t2 b1t2
2775- Filter: (ctid = '(1,1)'::tid)
2715+ -> Seq Scan on t2 b1t2
2716+ Filter: (ctid = '(1,1)'::tid)
2717+ -> Tid Scan on t3 b1t3
2718+ TID Cond: (ctid = '(1,1)'::tid)
2719+ -> Tid Scan on t4 b1t4
2720+ TID Cond: (ctid = '(1,1)'::tid)
27762721 InitPlan 3 (returns $2)
27772722 -> Result
27782723 InitPlan 2 (returns $1)
@@ -2785,24 +2730,24 @@ SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)'
27852730 -> Tid Scan on t1 b3t1
27862731 TID Cond: (ctid = '(1,1)'::tid)
27872732 -> Nested Loop
2788- Join Filter: (bmt1.c1 = bmt4.c1)
2789- -> Tid Scan on t4 bmt4
2790- TID Cond: (ctid = '(1,1)'::tid)
2733+ Join Filter: (bmt1.c1 = c1.c1)
27912734 -> Nested Loop
2792- Join Filter: (bmt1.c1 = bmt3.c1)
2793- -> Tid Scan on t3 bmt3
2794- TID Cond: (ctid = '(1,1)'::tid)
2735+ Join Filter: (bmt1.c1 = bmt4.c1)
27952736 -> Nested Loop
2796- Join Filter: (bmt1.c1 = bmt2.c1)
2797- -> Seq Scan on t2 bmt2
2798- Filter: (ctid = '(1,1)'::tid)
2737+ Join Filter: (bmt1.c1 = bmt3.c1)
27992738 -> Nested Loop
2800- Join Filter: (bmt1.c1 = c1.c1)
2739+ Join Filter: (bmt1.c1 = bmt2.c1)
28012740 -> Tid Scan on t1 bmt1
28022741 TID Cond: (ctid = '(1,1)'::tid)
28032742 Filter: (c1 <> $4)
2804- -> CTE Scan on c1
2805-(47 rows)
2743+ -> Seq Scan on t2 bmt2
2744+ Filter: (ctid = '(1,1)'::tid)
2745+ -> Tid Scan on t3 bmt3
2746+ TID Cond: (ctid = '(1,1)'::tid)
2747+ -> Tid Scan on t4 bmt4
2748+ TID Cond: (ctid = '(1,1)'::tid)
2749+ -> CTE Scan on c1
2750+(46 rows)
28062751
28072752 /*+
28082753 Leading(c1 bmt4 bmt3 bmt2 bmt1)
@@ -2828,26 +2773,25 @@ not used hint:
28282773 duplication hint:
28292774 error hint:
28302775
2831- QUERY PLAN
2832--------------------------------------------------------------------------
2776+ QUERY PLAN
2777+-------------------------------------------------------------------
28332778 Aggregate
28342779 CTE c1
28352780 -> Aggregate
28362781 -> Nested Loop
28372782 Join Filter: (b1t2.c1 = b1t1.c1)
2838- -> Tid Scan on t1 b1t1
2839- TID Cond: (ctid = '(1,1)'::tid)
28402783 -> Nested Loop
28412784 Join Filter: (b1t3.c1 = b1t2.c1)
2842- -> Seq Scan on t2 b1t2
2843- Filter: (ctid = '(1,1)'::tid)
28442785 -> Nested Loop
28452786 Join Filter: (b1t3.c1 = b1t4.c1)
28462787 -> Tid Scan on t3 b1t3
28472788 TID Cond: (ctid = '(1,1)'::tid)
2848- -> Materialize
2849- -> Tid Scan on t4 b1t4
2850- TID Cond: (ctid = '(1,1)'::tid)
2789+ -> Tid Scan on t4 b1t4
2790+ TID Cond: (ctid = '(1,1)'::tid)
2791+ -> Seq Scan on t2 b1t2
2792+ Filter: (ctid = '(1,1)'::tid)
2793+ -> Tid Scan on t1 b1t1
2794+ TID Cond: (ctid = '(1,1)'::tid)
28512795 InitPlan 3 (returns $2)
28522796 -> Result
28532797 InitPlan 2 (returns $1)
@@ -2861,23 +2805,23 @@ error hint:
28612805 TID Cond: (ctid = '(1,1)'::tid)
28622806 -> Nested Loop
28632807 Join Filter: (bmt2.c1 = bmt1.c1)
2864- -> Tid Scan on t1 bmt1
2865- TID Cond: (ctid = '(1,1)'::tid)
2866- Filter: (c1 <> $4)
28672808 -> Nested Loop
28682809 Join Filter: (bmt3.c1 = bmt2.c1)
2869- -> Seq Scan on t2 bmt2
2870- Filter: (ctid = '(1,1)'::tid)
28712810 -> Nested Loop
28722811 Join Filter: (bmt4.c1 = bmt3.c1)
2873- -> Tid Scan on t3 bmt3
2874- TID Cond: (ctid = '(1,1)'::tid)
28752812 -> Nested Loop
28762813 Join Filter: (bmt4.c1 = c1.c1)
28772814 -> Tid Scan on t4 bmt4
28782815 TID Cond: (ctid = '(1,1)'::tid)
28792816 -> CTE Scan on c1
2880-(47 rows)
2817+ -> Tid Scan on t3 bmt3
2818+ TID Cond: (ctid = '(1,1)'::tid)
2819+ -> Seq Scan on t2 bmt2
2820+ Filter: (ctid = '(1,1)'::tid)
2821+ -> Tid Scan on t1 bmt1
2822+ TID Cond: (ctid = '(1,1)'::tid)
2823+ Filter: (c1 <> $4)
2824+(46 rows)
28812825
28822826 ----
28832827 ---- No. L-2-3 RULE or VIEW
@@ -2889,22 +2833,22 @@ EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
28892833 Aggregate
28902834 -> Nested Loop
28912835 Join Filter: (t1.c1 = t4.c1)
2892- -> Tid Scan on t4
2893- TID Cond: (ctid = '(1,1)'::tid)
28942836 -> Nested Loop
28952837 Join Filter: (t1.c1 = t3.c1)
2896- -> Tid Scan on t3
2897- TID Cond: (ctid = '(1,1)'::tid)
28982838 -> Nested Loop
28992839 Join Filter: (t1.c1 = t2.c1)
2900- -> Seq Scan on t2
2901- Filter: (ctid = '(1,1)'::tid)
29022840 -> Nested Loop
29032841 -> Tid Scan on r1
29042842 TID Cond: (ctid = '(1,1)'::tid)
29052843 Filter: (c1 = 1)
29062844 -> Tid Scan on t1
29072845 TID Cond: (ctid = '(1,1)'::tid)
2846+ -> Seq Scan on t2
2847+ Filter: (ctid = '(1,1)'::tid)
2848+ -> Tid Scan on t3
2849+ TID Cond: (ctid = '(1,1)'::tid)
2850+ -> Tid Scan on t4
2851+ TID Cond: (ctid = '(1,1)'::tid)
29082852 (19 rows)
29092853
29102854 /*+ Leading(t4 t3 t2 t1 r1) */
@@ -2916,29 +2860,28 @@ not used hint:
29162860 duplication hint:
29172861 error hint:
29182862
2919- QUERY PLAN
2920------------------------------------------------------------------------
2863+ QUERY PLAN
2864+-----------------------------------------------------------------
29212865 Aggregate
29222866 -> Nested Loop
29232867 -> Nested Loop
29242868 Join Filter: (t2.c1 = t1.c1)
2925- -> Tid Scan on t1
2926- TID Cond: (ctid = '(1,1)'::tid)
29272869 -> Nested Loop
29282870 Join Filter: (t3.c1 = t2.c1)
2929- -> Seq Scan on t2
2930- Filter: (ctid = '(1,1)'::tid)
29312871 -> Nested Loop
29322872 Join Filter: (t3.c1 = t4.c1)
29332873 -> Tid Scan on t3
29342874 TID Cond: (ctid = '(1,1)'::tid)
2935- -> Materialize
2936- -> Tid Scan on t4
2937- TID Cond: (ctid = '(1,1)'::tid)
2875+ -> Tid Scan on t4
2876+ TID Cond: (ctid = '(1,1)'::tid)
2877+ -> Seq Scan on t2
2878+ Filter: (ctid = '(1,1)'::tid)
2879+ -> Tid Scan on t1
2880+ TID Cond: (ctid = '(1,1)'::tid)
29382881 -> Tid Scan on r1
29392882 TID Cond: (ctid = '(1,1)'::tid)
29402883 Filter: (c1 = 1)
2941-(20 rows)
2884+(19 rows)
29422885
29432886 EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
29442887 QUERY PLAN
@@ -2946,22 +2889,22 @@ EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
29462889 Aggregate
29472890 -> Nested Loop
29482891 Join Filter: (b1t1.c1 = b1t4.c1)
2949- -> Tid Scan on t4 b1t4
2950- TID Cond: (ctid = '(1,1)'::tid)
29512892 -> Nested Loop
29522893 Join Filter: (b1t1.c1 = b1t3.c1)
2953- -> Tid Scan on t3 b1t3
2954- TID Cond: (ctid = '(1,1)'::tid)
29552894 -> Nested Loop
2956- Join Filter: (b1t1.c1 = b1t2.c1)
2957- -> Seq Scan on t2 b1t2
2958- Filter: (ctid = '(1,1)'::tid)
2895+ Join Filter: (b1t1.c1 = b1t2.c1)
29592896 -> Nested Loop
29602897 -> Tid Scan on r1_
29612898 TID Cond: (ctid = '(1,1)'::tid)
29622899 Filter: (c1 = 1)
29632900 -> Tid Scan on t1 b1t1
29642901 TID Cond: (ctid = '(1,1)'::tid)
2902+ -> Seq Scan on t2 b1t2
2903+ Filter: (ctid = '(1,1)'::tid)
2904+ -> Tid Scan on t3 b1t3
2905+ TID Cond: (ctid = '(1,1)'::tid)
2906+ -> Tid Scan on t4 b1t4
2907+ TID Cond: (ctid = '(1,1)'::tid)
29652908 (19 rows)
29662909
29672910 /*+ Leading(b1t1 b1t2 b1t3 b1t4 r1_) */
@@ -2973,29 +2916,28 @@ not used hint:
29732916 duplication hint:
29742917 error hint:
29752918
2976- QUERY PLAN
2977----------------------------------------------------------------------
2919+ QUERY PLAN
2920+-----------------------------------------------------------------
29782921 Aggregate
29792922 -> Nested Loop
29802923 -> Nested Loop
29812924 Join Filter: (b1t1.c1 = b1t4.c1)
2982- -> Tid Scan on t4 b1t4
2983- TID Cond: (ctid = '(1,1)'::tid)
29842925 -> Nested Loop
29852926 Join Filter: (b1t1.c1 = b1t3.c1)
2986- -> Tid Scan on t3 b1t3
2987- TID Cond: (ctid = '(1,1)'::tid)
29882927 -> Nested Loop
29892928 Join Filter: (b1t1.c1 = b1t2.c1)
29902929 -> Tid Scan on t1 b1t1
29912930 TID Cond: (ctid = '(1,1)'::tid)
2992- -> Materialize
2993- -> Seq Scan on t2 b1t2
2994- Filter: (ctid = '(1,1)'::tid)
2931+ -> Seq Scan on t2 b1t2
2932+ Filter: (ctid = '(1,1)'::tid)
2933+ -> Tid Scan on t3 b1t3
2934+ TID Cond: (ctid = '(1,1)'::tid)
2935+ -> Tid Scan on t4 b1t4
2936+ TID Cond: (ctid = '(1,1)'::tid)
29952937 -> Tid Scan on r1_
29962938 TID Cond: (ctid = '(1,1)'::tid)
29972939 Filter: (c1 = 1)
2998-(20 rows)
2940+(19 rows)
29992941
30002942 -- No. L-2-3-2
30012943 EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
@@ -3004,42 +2946,42 @@ EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
30042946 Aggregate
30052947 -> Nested Loop
30062948 Join Filter: (t1.c1 = t4.c1)
3007- -> Tid Scan on t4
3008- TID Cond: (ctid = '(1,1)'::tid)
30092949 -> Nested Loop
30102950 Join Filter: (t1.c1 = t3.c1)
3011- -> Tid Scan on t3
3012- TID Cond: (ctid = '(1,1)'::tid)
30132951 -> Nested Loop
30142952 Join Filter: (t1.c1 = t2.c1)
3015- -> Seq Scan on t2
3016- Filter: (ctid = '(1,1)'::tid)
30172953 -> Nested Loop
30182954 -> Tid Scan on r2
30192955 TID Cond: (ctid = '(1,1)'::tid)
30202956 Filter: (c1 = 1)
30212957 -> Tid Scan on t1
30222958 TID Cond: (ctid = '(1,1)'::tid)
2959+ -> Seq Scan on t2
2960+ Filter: (ctid = '(1,1)'::tid)
2961+ -> Tid Scan on t3
2962+ TID Cond: (ctid = '(1,1)'::tid)
2963+ -> Tid Scan on t4
2964+ TID Cond: (ctid = '(1,1)'::tid)
30232965
30242966 Aggregate
30252967 -> Nested Loop
30262968 Join Filter: (t1.c1 = t4.c1)
3027- -> Tid Scan on t4
3028- TID Cond: (ctid = '(1,1)'::tid)
30292969 -> Nested Loop
30302970 Join Filter: (t1.c1 = t3.c1)
3031- -> Tid Scan on t3
3032- TID Cond: (ctid = '(1,1)'::tid)
30332971 -> Nested Loop
30342972 Join Filter: (t1.c1 = t2.c1)
3035- -> Seq Scan on t2
3036- Filter: (ctid = '(1,1)'::tid)
30372973 -> Nested Loop
30382974 -> Tid Scan on r2
30392975 TID Cond: (ctid = '(1,1)'::tid)
30402976 Filter: (c1 = 1)
30412977 -> Tid Scan on t1
30422978 TID Cond: (ctid = '(1,1)'::tid)
2979+ -> Seq Scan on t2
2980+ Filter: (ctid = '(1,1)'::tid)
2981+ -> Tid Scan on t3
2982+ TID Cond: (ctid = '(1,1)'::tid)
2983+ -> Tid Scan on t4
2984+ TID Cond: (ctid = '(1,1)'::tid)
30432985 (39 rows)
30442986
30452987 /*+ Leading(t4 t3 t2 t1 r2) */
@@ -3058,25 +3000,24 @@ not used hint:
30583000 duplication hint:
30593001 error hint:
30603002
3061- QUERY PLAN
3062------------------------------------------------------------------------
3003+ QUERY PLAN
3004+-----------------------------------------------------------------
30633005 Aggregate
30643006 -> Nested Loop
30653007 -> Nested Loop
30663008 Join Filter: (t2.c1 = t1.c1)
3067- -> Tid Scan on t1
3068- TID Cond: (ctid = '(1,1)'::tid)
30693009 -> Nested Loop
30703010 Join Filter: (t3.c1 = t2.c1)
3071- -> Seq Scan on t2
3072- Filter: (ctid = '(1,1)'::tid)
30733011 -> Nested Loop
30743012 Join Filter: (t3.c1 = t4.c1)
30753013 -> Tid Scan on t3
30763014 TID Cond: (ctid = '(1,1)'::tid)
3077- -> Materialize
3078- -> Tid Scan on t4
3079- TID Cond: (ctid = '(1,1)'::tid)
3015+ -> Tid Scan on t4
3016+ TID Cond: (ctid = '(1,1)'::tid)
3017+ -> Seq Scan on t2
3018+ Filter: (ctid = '(1,1)'::tid)
3019+ -> Tid Scan on t1
3020+ TID Cond: (ctid = '(1,1)'::tid)
30803021 -> Tid Scan on r2
30813022 TID Cond: (ctid = '(1,1)'::tid)
30823023 Filter: (c1 = 1)
@@ -3085,23 +3026,22 @@ error hint:
30853026 -> Nested Loop
30863027 -> Nested Loop
30873028 Join Filter: (t2.c1 = t1.c1)
3088- -> Tid Scan on t1
3089- TID Cond: (ctid = '(1,1)'::tid)
30903029 -> Nested Loop
30913030 Join Filter: (t3.c1 = t2.c1)
3092- -> Seq Scan on t2
3093- Filter: (ctid = '(1,1)'::tid)
30943031 -> Nested Loop
30953032 Join Filter: (t3.c1 = t4.c1)
30963033 -> Tid Scan on t3
30973034 TID Cond: (ctid = '(1,1)'::tid)
3098- -> Materialize
3099- -> Tid Scan on t4
3100- TID Cond: (ctid = '(1,1)'::tid)
3035+ -> Tid Scan on t4
3036+ TID Cond: (ctid = '(1,1)'::tid)
3037+ -> Seq Scan on t2
3038+ Filter: (ctid = '(1,1)'::tid)
3039+ -> Tid Scan on t1
3040+ TID Cond: (ctid = '(1,1)'::tid)
31013041 -> Tid Scan on r2
31023042 TID Cond: (ctid = '(1,1)'::tid)
31033043 Filter: (c1 = 1)
3104-(41 rows)
3044+(39 rows)
31053045
31063046 EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
31073047 QUERY PLAN
@@ -3109,42 +3049,42 @@ EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
31093049 Aggregate
31103050 -> Nested Loop
31113051 Join Filter: (b1t1.c1 = b1t4.c1)
3112- -> Tid Scan on t4 b1t4
3113- TID Cond: (ctid = '(1,1)'::tid)
31143052 -> Nested Loop
31153053 Join Filter: (b1t1.c1 = b1t3.c1)
3116- -> Tid Scan on t3 b1t3
3117- TID Cond: (ctid = '(1,1)'::tid)
31183054 -> Nested Loop
31193055 Join Filter: (b1t1.c1 = b1t2.c1)
3120- -> Seq Scan on t2 b1t2
3121- Filter: (ctid = '(1,1)'::tid)
31223056 -> Nested Loop
31233057 -> Tid Scan on r2_
31243058 TID Cond: (ctid = '(1,1)'::tid)
31253059 Filter: (c1 = 1)
31263060 -> Tid Scan on t1 b1t1
31273061 TID Cond: (ctid = '(1,1)'::tid)
3062+ -> Seq Scan on t2 b1t2
3063+ Filter: (ctid = '(1,1)'::tid)
3064+ -> Tid Scan on t3 b1t3
3065+ TID Cond: (ctid = '(1,1)'::tid)
3066+ -> Tid Scan on t4 b1t4
3067+ TID Cond: (ctid = '(1,1)'::tid)
31283068
31293069 Aggregate
31303070 -> Nested Loop
31313071 Join Filter: (b2t1.c1 = b2t4.c1)
3132- -> Tid Scan on t4 b2t4
3133- TID Cond: (ctid = '(1,1)'::tid)
31343072 -> Nested Loop
31353073 Join Filter: (b2t1.c1 = b2t3.c1)
3136- -> Tid Scan on t3 b2t3
3137- TID Cond: (ctid = '(1,1)'::tid)
31383074 -> Nested Loop
31393075 Join Filter: (b2t1.c1 = b2t2.c1)
3140- -> Seq Scan on t2 b2t2
3141- Filter: (ctid = '(1,1)'::tid)
31423076 -> Nested Loop
31433077 -> Tid Scan on r2_
31443078 TID Cond: (ctid = '(1,1)'::tid)
31453079 Filter: (c1 = 1)
31463080 -> Tid Scan on t1 b2t1
31473081 TID Cond: (ctid = '(1,1)'::tid)
3082+ -> Seq Scan on t2 b2t2
3083+ Filter: (ctid = '(1,1)'::tid)
3084+ -> Tid Scan on t3 b2t3
3085+ TID Cond: (ctid = '(1,1)'::tid)
3086+ -> Tid Scan on t4 b2t4
3087+ TID Cond: (ctid = '(1,1)'::tid)
31483088 (39 rows)
31493089
31503090 /*+
@@ -3168,25 +3108,24 @@ Leading(b1t1 b1t2 b1t3 b1t4 r2_)
31683108 duplication hint:
31693109 error hint:
31703110
3171- QUERY PLAN
3172----------------------------------------------------------------------
3111+ QUERY PLAN
3112+-----------------------------------------------------------------
31733113 Aggregate
31743114 -> Nested Loop
31753115 -> Nested Loop
31763116 Join Filter: (b1t1.c1 = b1t4.c1)
3177- -> Tid Scan on t4 b1t4
3178- TID Cond: (ctid = '(1,1)'::tid)
31793117 -> Nested Loop
31803118 Join Filter: (b1t1.c1 = b1t3.c1)
3181- -> Tid Scan on t3 b1t3
3182- TID Cond: (ctid = '(1,1)'::tid)
31833119 -> Nested Loop
31843120 Join Filter: (b1t1.c1 = b1t2.c1)
31853121 -> Tid Scan on t1 b1t1
31863122 TID Cond: (ctid = '(1,1)'::tid)
3187- -> Materialize
3188- -> Seq Scan on t2 b1t2
3189- Filter: (ctid = '(1,1)'::tid)
3123+ -> Seq Scan on t2 b1t2
3124+ Filter: (ctid = '(1,1)'::tid)
3125+ -> Tid Scan on t3 b1t3
3126+ TID Cond: (ctid = '(1,1)'::tid)
3127+ -> Tid Scan on t4 b1t4
3128+ TID Cond: (ctid = '(1,1)'::tid)
31903129 -> Tid Scan on r2_
31913130 TID Cond: (ctid = '(1,1)'::tid)
31923131 Filter: (c1 = 1)
@@ -3195,23 +3134,22 @@ error hint:
31953134 -> Nested Loop
31963135 -> Nested Loop
31973136 Join Filter: (b2t1.c1 = b2t4.c1)
3198- -> Tid Scan on t4 b2t4
3199- TID Cond: (ctid = '(1,1)'::tid)
32003137 -> Nested Loop
32013138 Join Filter: (b2t1.c1 = b2t3.c1)
3202- -> Tid Scan on t3 b2t3
3203- TID Cond: (ctid = '(1,1)'::tid)
32043139 -> Nested Loop
32053140 Join Filter: (b2t1.c1 = b2t2.c1)
32063141 -> Tid Scan on t1 b2t1
32073142 TID Cond: (ctid = '(1,1)'::tid)
3208- -> Materialize
3209- -> Seq Scan on t2 b2t2
3210- Filter: (ctid = '(1,1)'::tid)
3143+ -> Seq Scan on t2 b2t2
3144+ Filter: (ctid = '(1,1)'::tid)
3145+ -> Tid Scan on t3 b2t3
3146+ TID Cond: (ctid = '(1,1)'::tid)
3147+ -> Tid Scan on t4 b2t4
3148+ TID Cond: (ctid = '(1,1)'::tid)
32113149 -> Tid Scan on r2_
32123150 TID Cond: (ctid = '(1,1)'::tid)
32133151 Filter: (c1 = 1)
3214-(41 rows)
3152+(39 rows)
32153153
32163154 -- No. L-2-3-3
32173155 EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
@@ -3220,62 +3158,62 @@ EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
32203158 Aggregate
32213159 -> Nested Loop
32223160 Join Filter: (t1.c1 = t4.c1)
3223- -> Tid Scan on t4
3224- TID Cond: (ctid = '(1,1)'::tid)
32253161 -> Nested Loop
32263162 Join Filter: (t1.c1 = t3.c1)
3227- -> Tid Scan on t3
3228- TID Cond: (ctid = '(1,1)'::tid)
32293163 -> Nested Loop
32303164 Join Filter: (t1.c1 = t2.c1)
3231- -> Seq Scan on t2
3232- Filter: (ctid = '(1,1)'::tid)
32333165 -> Nested Loop
32343166 -> Tid Scan on r3
32353167 TID Cond: (ctid = '(1,1)'::tid)
32363168 Filter: (c1 = 1)
32373169 -> Tid Scan on t1
32383170 TID Cond: (ctid = '(1,1)'::tid)
3171+ -> Seq Scan on t2
3172+ Filter: (ctid = '(1,1)'::tid)
3173+ -> Tid Scan on t3
3174+ TID Cond: (ctid = '(1,1)'::tid)
3175+ -> Tid Scan on t4
3176+ TID Cond: (ctid = '(1,1)'::tid)
32393177
32403178 Aggregate
32413179 -> Nested Loop
32423180 Join Filter: (t1.c1 = t4.c1)
3243- -> Tid Scan on t4
3244- TID Cond: (ctid = '(1,1)'::tid)
32453181 -> Nested Loop
32463182 Join Filter: (t1.c1 = t3.c1)
3247- -> Tid Scan on t3
3248- TID Cond: (ctid = '(1,1)'::tid)
32493183 -> Nested Loop
32503184 Join Filter: (t1.c1 = t2.c1)
3251- -> Seq Scan on t2
3252- Filter: (ctid = '(1,1)'::tid)
32533185 -> Nested Loop
32543186 -> Tid Scan on r3
32553187 TID Cond: (ctid = '(1,1)'::tid)
32563188 Filter: (c1 = 1)
32573189 -> Tid Scan on t1
32583190 TID Cond: (ctid = '(1,1)'::tid)
3191+ -> Seq Scan on t2
3192+ Filter: (ctid = '(1,1)'::tid)
3193+ -> Tid Scan on t3
3194+ TID Cond: (ctid = '(1,1)'::tid)
3195+ -> Tid Scan on t4
3196+ TID Cond: (ctid = '(1,1)'::tid)
32593197
32603198 Aggregate
32613199 -> Nested Loop
32623200 Join Filter: (t1.c1 = t4.c1)
3263- -> Tid Scan on t4
3264- TID Cond: (ctid = '(1,1)'::tid)
32653201 -> Nested Loop
32663202 Join Filter: (t1.c1 = t3.c1)
3267- -> Tid Scan on t3
3268- TID Cond: (ctid = '(1,1)'::tid)
32693203 -> Nested Loop
32703204 Join Filter: (t1.c1 = t2.c1)
3271- -> Seq Scan on t2
3272- Filter: (ctid = '(1,1)'::tid)
32733205 -> Nested Loop
32743206 -> Tid Scan on r3
32753207 TID Cond: (ctid = '(1,1)'::tid)
32763208 Filter: (c1 = 1)
32773209 -> Tid Scan on t1
32783210 TID Cond: (ctid = '(1,1)'::tid)
3211+ -> Seq Scan on t2
3212+ Filter: (ctid = '(1,1)'::tid)
3213+ -> Tid Scan on t3
3214+ TID Cond: (ctid = '(1,1)'::tid)
3215+ -> Tid Scan on t4
3216+ TID Cond: (ctid = '(1,1)'::tid)
32793217 (59 rows)
32803218
32813219 /*+ Leading(t4 t3 t2 t1 r3) */
@@ -3301,25 +3239,24 @@ not used hint:
33013239 duplication hint:
33023240 error hint:
33033241
3304- QUERY PLAN
3305------------------------------------------------------------------------
3242+ QUERY PLAN
3243+-----------------------------------------------------------------
33063244 Aggregate
33073245 -> Nested Loop
33083246 -> Nested Loop
33093247 Join Filter: (t2.c1 = t1.c1)
3310- -> Tid Scan on t1
3311- TID Cond: (ctid = '(1,1)'::tid)
33123248 -> Nested Loop
33133249 Join Filter: (t3.c1 = t2.c1)
3314- -> Seq Scan on t2
3315- Filter: (ctid = '(1,1)'::tid)
33163250 -> Nested Loop
33173251 Join Filter: (t3.c1 = t4.c1)
33183252 -> Tid Scan on t3
33193253 TID Cond: (ctid = '(1,1)'::tid)
3320- -> Materialize
3321- -> Tid Scan on t4
3322- TID Cond: (ctid = '(1,1)'::tid)
3254+ -> Tid Scan on t4
3255+ TID Cond: (ctid = '(1,1)'::tid)
3256+ -> Seq Scan on t2
3257+ Filter: (ctid = '(1,1)'::tid)
3258+ -> Tid Scan on t1
3259+ TID Cond: (ctid = '(1,1)'::tid)
33233260 -> Tid Scan on r3
33243261 TID Cond: (ctid = '(1,1)'::tid)
33253262 Filter: (c1 = 1)
@@ -3328,19 +3265,18 @@ error hint:
33283265 -> Nested Loop
33293266 -> Nested Loop
33303267 Join Filter: (t2.c1 = t1.c1)
3331- -> Tid Scan on t1
3332- TID Cond: (ctid = '(1,1)'::tid)
33333268 -> Nested Loop
33343269 Join Filter: (t3.c1 = t2.c1)
3335- -> Seq Scan on t2
3336- Filter: (ctid = '(1,1)'::tid)
33373270 -> Nested Loop
33383271 Join Filter: (t3.c1 = t4.c1)
33393272 -> Tid Scan on t3
33403273 TID Cond: (ctid = '(1,1)'::tid)
3341- -> Materialize
3342- -> Tid Scan on t4
3343- TID Cond: (ctid = '(1,1)'::tid)
3274+ -> Tid Scan on t4
3275+ TID Cond: (ctid = '(1,1)'::tid)
3276+ -> Seq Scan on t2
3277+ Filter: (ctid = '(1,1)'::tid)
3278+ -> Tid Scan on t1
3279+ TID Cond: (ctid = '(1,1)'::tid)
33443280 -> Tid Scan on r3
33453281 TID Cond: (ctid = '(1,1)'::tid)
33463282 Filter: (c1 = 1)
@@ -3349,23 +3285,22 @@ error hint:
33493285 -> Nested Loop
33503286 -> Nested Loop
33513287 Join Filter: (t2.c1 = t1.c1)
3352- -> Tid Scan on t1
3353- TID Cond: (ctid = '(1,1)'::tid)
33543288 -> Nested Loop
33553289 Join Filter: (t3.c1 = t2.c1)
3356- -> Seq Scan on t2
3357- Filter: (ctid = '(1,1)'::tid)
33583290 -> Nested Loop
33593291 Join Filter: (t3.c1 = t4.c1)
33603292 -> Tid Scan on t3
33613293 TID Cond: (ctid = '(1,1)'::tid)
3362- -> Materialize
3363- -> Tid Scan on t4
3364- TID Cond: (ctid = '(1,1)'::tid)
3294+ -> Tid Scan on t4
3295+ TID Cond: (ctid = '(1,1)'::tid)
3296+ -> Seq Scan on t2
3297+ Filter: (ctid = '(1,1)'::tid)
3298+ -> Tid Scan on t1
3299+ TID Cond: (ctid = '(1,1)'::tid)
33653300 -> Tid Scan on r3
33663301 TID Cond: (ctid = '(1,1)'::tid)
33673302 Filter: (c1 = 1)
3368-(62 rows)
3303+(59 rows)
33693304
33703305 EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
33713306 QUERY PLAN
@@ -3373,62 +3308,62 @@ EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
33733308 Aggregate
33743309 -> Nested Loop
33753310 Join Filter: (b1t1.c1 = b1t4.c1)
3376- -> Tid Scan on t4 b1t4
3377- TID Cond: (ctid = '(1,1)'::tid)
33783311 -> Nested Loop
33793312 Join Filter: (b1t1.c1 = b1t3.c1)
3380- -> Tid Scan on t3 b1t3
3381- TID Cond: (ctid = '(1,1)'::tid)
33823313 -> Nested Loop
33833314 Join Filter: (b1t1.c1 = b1t2.c1)
3384- -> Seq Scan on t2 b1t2
3385- Filter: (ctid = '(1,1)'::tid)
33863315 -> Nested Loop
33873316 -> Tid Scan on r3_
33883317 TID Cond: (ctid = '(1,1)'::tid)
33893318 Filter: (c1 = 1)
33903319 -> Tid Scan on t1 b1t1
33913320 TID Cond: (ctid = '(1,1)'::tid)
3321+ -> Seq Scan on t2 b1t2
3322+ Filter: (ctid = '(1,1)'::tid)
3323+ -> Tid Scan on t3 b1t3
3324+ TID Cond: (ctid = '(1,1)'::tid)
3325+ -> Tid Scan on t4 b1t4
3326+ TID Cond: (ctid = '(1,1)'::tid)
33923327
33933328 Aggregate
33943329 -> Nested Loop
33953330 Join Filter: (b2t1.c1 = b2t4.c1)
3396- -> Tid Scan on t4 b2t4
3397- TID Cond: (ctid = '(1,1)'::tid)
33983331 -> Nested Loop
33993332 Join Filter: (b2t1.c1 = b2t3.c1)
3400- -> Tid Scan on t3 b2t3
3401- TID Cond: (ctid = '(1,1)'::tid)
34023333 -> Nested Loop
34033334 Join Filter: (b2t1.c1 = b2t2.c1)
3404- -> Seq Scan on t2 b2t2
3405- Filter: (ctid = '(1,1)'::tid)
34063335 -> Nested Loop
34073336 -> Tid Scan on r3_
34083337 TID Cond: (ctid = '(1,1)'::tid)
34093338 Filter: (c1 = 1)
34103339 -> Tid Scan on t1 b2t1
34113340 TID Cond: (ctid = '(1,1)'::tid)
3341+ -> Seq Scan on t2 b2t2
3342+ Filter: (ctid = '(1,1)'::tid)
3343+ -> Tid Scan on t3 b2t3
3344+ TID Cond: (ctid = '(1,1)'::tid)
3345+ -> Tid Scan on t4 b2t4
3346+ TID Cond: (ctid = '(1,1)'::tid)
34123347
34133348 Aggregate
34143349 -> Nested Loop
34153350 Join Filter: (b3t1.c1 = b3t4.c1)
3416- -> Tid Scan on t4 b3t4
3417- TID Cond: (ctid = '(1,1)'::tid)
34183351 -> Nested Loop
34193352 Join Filter: (b3t1.c1 = b3t3.c1)
3420- -> Tid Scan on t3 b3t3
3421- TID Cond: (ctid = '(1,1)'::tid)
34223353 -> Nested Loop
34233354 Join Filter: (b3t1.c1 = b3t2.c1)
3424- -> Seq Scan on t2 b3t2
3425- Filter: (ctid = '(1,1)'::tid)
34263355 -> Nested Loop
34273356 -> Tid Scan on r3_
34283357 TID Cond: (ctid = '(1,1)'::tid)
34293358 Filter: (c1 = 1)
34303359 -> Tid Scan on t1 b3t1
34313360 TID Cond: (ctid = '(1,1)'::tid)
3361+ -> Seq Scan on t2 b3t2
3362+ Filter: (ctid = '(1,1)'::tid)
3363+ -> Tid Scan on t3 b3t3
3364+ TID Cond: (ctid = '(1,1)'::tid)
3365+ -> Tid Scan on t4 b3t4
3366+ TID Cond: (ctid = '(1,1)'::tid)
34323367 (59 rows)
34333368
34343369 /*+
@@ -3464,25 +3399,24 @@ Leading(b2t1 b2t2 b2t3 b2t4 r3_)
34643399 duplication hint:
34653400 error hint:
34663401
3467- QUERY PLAN
3468----------------------------------------------------------------------
3402+ QUERY PLAN
3403+-----------------------------------------------------------------
34693404 Aggregate
34703405 -> Nested Loop
34713406 -> Nested Loop
34723407 Join Filter: (b1t1.c1 = b1t4.c1)
3473- -> Tid Scan on t4 b1t4
3474- TID Cond: (ctid = '(1,1)'::tid)
34753408 -> Nested Loop
34763409 Join Filter: (b1t1.c1 = b1t3.c1)
3477- -> Tid Scan on t3 b1t3
3478- TID Cond: (ctid = '(1,1)'::tid)
34793410 -> Nested Loop
34803411 Join Filter: (b1t1.c1 = b1t2.c1)
34813412 -> Tid Scan on t1 b1t1
34823413 TID Cond: (ctid = '(1,1)'::tid)
3483- -> Materialize
3484- -> Seq Scan on t2 b1t2
3485- Filter: (ctid = '(1,1)'::tid)
3414+ -> Seq Scan on t2 b1t2
3415+ Filter: (ctid = '(1,1)'::tid)
3416+ -> Tid Scan on t3 b1t3
3417+ TID Cond: (ctid = '(1,1)'::tid)
3418+ -> Tid Scan on t4 b1t4
3419+ TID Cond: (ctid = '(1,1)'::tid)
34863420 -> Tid Scan on r3_
34873421 TID Cond: (ctid = '(1,1)'::tid)
34883422 Filter: (c1 = 1)
@@ -3491,19 +3425,18 @@ error hint:
34913425 -> Nested Loop
34923426 -> Nested Loop
34933427 Join Filter: (b2t1.c1 = b2t4.c1)
3494- -> Tid Scan on t4 b2t4
3495- TID Cond: (ctid = '(1,1)'::tid)
34963428 -> Nested Loop
34973429 Join Filter: (b2t1.c1 = b2t3.c1)
3498- -> Tid Scan on t3 b2t3
3499- TID Cond: (ctid = '(1,1)'::tid)
35003430 -> Nested Loop
35013431 Join Filter: (b2t1.c1 = b2t2.c1)
35023432 -> Tid Scan on t1 b2t1
35033433 TID Cond: (ctid = '(1,1)'::tid)
3504- -> Materialize
3505- -> Seq Scan on t2 b2t2
3506- Filter: (ctid = '(1,1)'::tid)
3434+ -> Seq Scan on t2 b2t2
3435+ Filter: (ctid = '(1,1)'::tid)
3436+ -> Tid Scan on t3 b2t3
3437+ TID Cond: (ctid = '(1,1)'::tid)
3438+ -> Tid Scan on t4 b2t4
3439+ TID Cond: (ctid = '(1,1)'::tid)
35073440 -> Tid Scan on r3_
35083441 TID Cond: (ctid = '(1,1)'::tid)
35093442 Filter: (c1 = 1)
@@ -3512,23 +3445,22 @@ error hint:
35123445 -> Nested Loop
35133446 -> Nested Loop
35143447 Join Filter: (b3t1.c1 = b3t4.c1)
3515- -> Tid Scan on t4 b3t4
3516- TID Cond: (ctid = '(1,1)'::tid)
35173448 -> Nested Loop
35183449 Join Filter: (b3t1.c1 = b3t3.c1)
3519- -> Tid Scan on t3 b3t3
3520- TID Cond: (ctid = '(1,1)'::tid)
35213450 -> Nested Loop
35223451 Join Filter: (b3t1.c1 = b3t2.c1)
35233452 -> Tid Scan on t1 b3t1
35243453 TID Cond: (ctid = '(1,1)'::tid)
3525- -> Materialize
3526- -> Seq Scan on t2 b3t2
3527- Filter: (ctid = '(1,1)'::tid)
3454+ -> Seq Scan on t2 b3t2
3455+ Filter: (ctid = '(1,1)'::tid)
3456+ -> Tid Scan on t3 b3t3
3457+ TID Cond: (ctid = '(1,1)'::tid)
3458+ -> Tid Scan on t4 b3t4
3459+ TID Cond: (ctid = '(1,1)'::tid)
35283460 -> Tid Scan on r3_
35293461 TID Cond: (ctid = '(1,1)'::tid)
35303462 Filter: (c1 = 1)
3531-(62 rows)
3463+(59 rows)
35323464
35333465 -- No. L-2-3-4
35343466 EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
--- a/expected/ut-R.out
+++ b/expected/ut-R.out
@@ -2363,6 +2363,7 @@ error hint:
23632363 -> Sort (cost=xxx rows=1 width=xxx)
23642364 Sort Key: bmt1.c1
23652365 -> Nested Loop (cost=xxx rows=1 width=xxx)
2366+ Join Filter: (c1.c1 = bmt1.c1)
23662367 -> Hash Join (cost=xxx rows=1 width=xxx)
23672368 Hash Cond: (c2.c1 = c1.c1)
23682369 -> Merge Join (cost=xxx rows=1 width=xxx)
@@ -2376,13 +2377,13 @@ error hint:
23762377 -> Hash (cost=xxx rows=1 width=xxx)
23772378 -> CTE Scan on c1 (cost=xxx rows=1 width=xxx)
23782379 -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1 width=xxx)
2379- Index Cond: (c1 = c1.c1)
2380+ Index Cond: (c1 = c2.c1)
23802381 -> Sort (cost=xxx rows=100 width=xxx)
23812382 Sort Key: bmt2.c1
23822383 -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=xxx)
23832384 -> Index Only Scan using t4_i1 on t4 bmt4 (cost=xxx rows=1 width=xxx)
23842385 Index Cond: (c1 = bmt1.c1)
2385-(72 rows)
2386+(73 rows)
23862387
23872388 \o results/ut-R.tmpout
23882389 /*+
@@ -2512,6 +2513,7 @@ error hint:
25122513 -> Sort (cost=xxx rows=1 width=xxx)
25132514 Sort Key: bmt1.c1
25142515 -> Nested Loop (cost=xxx rows=1 width=xxx)
2516+ Join Filter: (c1.c1 = bmt1.c1)
25152517 -> Hash Join (cost=xxx rows=1 width=xxx)
25162518 Hash Cond: (c2.c1 = c1.c1)
25172519 -> Merge Join (cost=xxx rows=1 width=xxx)
@@ -2525,13 +2527,13 @@ error hint:
25252527 -> Hash (cost=xxx rows=1 width=xxx)
25262528 -> CTE Scan on c1 (cost=xxx rows=1 width=xxx)
25272529 -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1 width=xxx)
2528- Index Cond: (c1 = c1.c1)
2530+ Index Cond: (c1 = c2.c1)
25292531 -> Sort (cost=xxx rows=100 width=xxx)
25302532 Sort Key: bmt2.c1
25312533 -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=xxx)
25322534 -> Index Only Scan using t4_i1 on t4 bmt4 (cost=xxx rows=1 width=xxx)
25332535 Index Cond: (c1 = bmt1.c1)
2534-(72 rows)
2536+(73 rows)
25352537
25362538 ----
25372539 ---- No. R-2-2 the number of the tables per quiry block
@@ -3272,8 +3274,6 @@ error hint:
32723274 Aggregate (cost=xxx rows=1 width=xxx)
32733275 -> Nested Loop (cost=xxx rows=1 width=xxx)
32743276 Join Filter: (t1.c1 = t4.c1)
3275- -> Tid Scan on t4 (cost=xxx rows=1 width=xxx)
3276- TID Cond: (ctid = '(1,1)'::tid)
32773277 -> Nested Loop (cost=xxx rows=1 width=xxx)
32783278 Join Filter: (t1.c1 = t3.c1)
32793279 -> Merge Join (cost=xxx rows=1 width=xxx)
@@ -3287,10 +3287,11 @@ error hint:
32873287 Sort Key: t2.c1
32883288 -> Seq Scan on t2 (cost=xxx rows=1 width=xxx)
32893289 Filter: (ctid = '(1,1)'::tid)
3290- -> Materialize (cost=xxx rows=1 width=xxx)
3291- -> Tid Scan on t3 (cost=xxx rows=1 width=xxx)
3292- TID Cond: (ctid = '(1,1)'::tid)
3293-(21 rows)
3290+ -> Tid Scan on t3 (cost=xxx rows=1 width=xxx)
3291+ TID Cond: (ctid = '(1,1)'::tid)
3292+ -> Tid Scan on t4 (cost=xxx rows=1 width=xxx)
3293+ TID Cond: (ctid = '(1,1)'::tid)
3294+(20 rows)
32943295
32953296 \o results/ut-R.tmpout
32963297 /*+
@@ -3355,8 +3356,6 @@ error hint:
33553356 Aggregate (cost=xxx rows=1 width=xxx)
33563357 -> Nested Loop (cost=xxx rows=1 width=xxx)
33573358 Join Filter: (b1t1.c1 = b1t4.c1)
3358- -> Tid Scan on t4 b1t4 (cost=xxx rows=1 width=xxx)
3359- TID Cond: (ctid = '(1,1)'::tid)
33603359 -> Nested Loop (cost=xxx rows=1 width=xxx)
33613360 Join Filter: (b1t1.c1 = b1t3.c1)
33623361 -> Merge Join (cost=xxx rows=1 width=xxx)
@@ -3370,10 +3369,11 @@ error hint:
33703369 Sort Key: b1t2.c1
33713370 -> Seq Scan on t2 b1t2 (cost=xxx rows=1 width=xxx)
33723371 Filter: (ctid = '(1,1)'::tid)
3373- -> Materialize (cost=xxx rows=1 width=xxx)
3374- -> Tid Scan on t3 b1t3 (cost=xxx rows=1 width=xxx)
3375- TID Cond: (ctid = '(1,1)'::tid)
3376-(21 rows)
3372+ -> Tid Scan on t3 b1t3 (cost=xxx rows=1 width=xxx)
3373+ TID Cond: (ctid = '(1,1)'::tid)
3374+ -> Tid Scan on t4 b1t4 (cost=xxx rows=1 width=xxx)
3375+ TID Cond: (ctid = '(1,1)'::tid)
3376+(20 rows)
33773377
33783378 \o results/ut-R.tmpout
33793379 /*+
@@ -3446,8 +3446,6 @@ error hint:
34463446 Aggregate (cost=xxx rows=1 width=xxx)
34473447 -> Nested Loop (cost=xxx rows=1 width=xxx)
34483448 Join Filter: (t1.c1 = t4.c1)
3449- -> Tid Scan on t4 (cost=xxx rows=1 width=xxx)
3450- TID Cond: (ctid = '(1,1)'::tid)
34513449 -> Nested Loop (cost=xxx rows=1 width=xxx)
34523450 Join Filter: (t1.c1 = t3.c1)
34533451 -> Merge Join (cost=xxx rows=1 width=xxx)
@@ -3461,15 +3459,14 @@ error hint:
34613459 Sort Key: t2.c1
34623460 -> Seq Scan on t2 (cost=xxx rows=1 width=xxx)
34633461 Filter: (ctid = '(1,1)'::tid)
3464- -> Materialize (cost=xxx rows=1 width=xxx)
3465- -> Tid Scan on t3 (cost=xxx rows=1 width=xxx)
3466- TID Cond: (ctid = '(1,1)'::tid)
3462+ -> Tid Scan on t3 (cost=xxx rows=1 width=xxx)
3463+ TID Cond: (ctid = '(1,1)'::tid)
3464+ -> Tid Scan on t4 (cost=xxx rows=1 width=xxx)
3465+ TID Cond: (ctid = '(1,1)'::tid)
34673466
34683467 Aggregate (cost=xxx rows=1 width=xxx)
34693468 -> Nested Loop (cost=xxx rows=1 width=xxx)
34703469 Join Filter: (t1.c1 = t4.c1)
3471- -> Tid Scan on t4 (cost=xxx rows=1 width=xxx)
3472- TID Cond: (ctid = '(1,1)'::tid)
34733470 -> Nested Loop (cost=xxx rows=1 width=xxx)
34743471 Join Filter: (t1.c1 = t3.c1)
34753472 -> Merge Join (cost=xxx rows=1 width=xxx)
@@ -3483,10 +3480,11 @@ error hint:
34833480 Sort Key: t2.c1
34843481 -> Seq Scan on t2 (cost=xxx rows=1 width=xxx)
34853482 Filter: (ctid = '(1,1)'::tid)
3486- -> Materialize (cost=xxx rows=1 width=xxx)
3487- -> Tid Scan on t3 (cost=xxx rows=1 width=xxx)
3488- TID Cond: (ctid = '(1,1)'::tid)
3489-(43 rows)
3483+ -> Tid Scan on t3 (cost=xxx rows=1 width=xxx)
3484+ TID Cond: (ctid = '(1,1)'::tid)
3485+ -> Tid Scan on t4 (cost=xxx rows=1 width=xxx)
3486+ TID Cond: (ctid = '(1,1)'::tid)
3487+(41 rows)
34903488
34913489 \o results/ut-R.tmpout
34923490 /*+
@@ -3591,8 +3589,6 @@ error hint:
35913589 Aggregate (cost=xxx rows=1 width=xxx)
35923590 -> Nested Loop (cost=xxx rows=1 width=xxx)
35933591 Join Filter: (b1t1.c1 = b1t4.c1)
3594- -> Tid Scan on t4 b1t4 (cost=xxx rows=1 width=xxx)
3595- TID Cond: (ctid = '(1,1)'::tid)
35963592 -> Nested Loop (cost=xxx rows=1 width=xxx)
35973593 Join Filter: (b1t1.c1 = b1t3.c1)
35983594 -> Merge Join (cost=xxx rows=1 width=xxx)
@@ -3606,15 +3602,14 @@ error hint:
36063602 Sort Key: b1t2.c1
36073603 -> Seq Scan on t2 b1t2 (cost=xxx rows=1 width=xxx)
36083604 Filter: (ctid = '(1,1)'::tid)
3609- -> Materialize (cost=xxx rows=1 width=xxx)
3610- -> Tid Scan on t3 b1t3 (cost=xxx rows=1 width=xxx)
3611- TID Cond: (ctid = '(1,1)'::tid)
3605+ -> Tid Scan on t3 b1t3 (cost=xxx rows=1 width=xxx)
3606+ TID Cond: (ctid = '(1,1)'::tid)
3607+ -> Tid Scan on t4 b1t4 (cost=xxx rows=1 width=xxx)
3608+ TID Cond: (ctid = '(1,1)'::tid)
36123609
36133610 Aggregate (cost=xxx rows=1 width=xxx)
36143611 -> Nested Loop (cost=xxx rows=1 width=xxx)
36153612 Join Filter: (b2t1.c1 = b2t4.c1)
3616- -> Tid Scan on t4 b2t4 (cost=xxx rows=1 width=xxx)
3617- TID Cond: (ctid = '(1,1)'::tid)
36183613 -> Nested Loop (cost=xxx rows=1 width=xxx)
36193614 Join Filter: (b2t1.c1 = b2t3.c1)
36203615 -> Merge Join (cost=xxx rows=1 width=xxx)
@@ -3628,10 +3623,11 @@ error hint:
36283623 Sort Key: b2t2.c1
36293624 -> Seq Scan on t2 b2t2 (cost=xxx rows=1 width=xxx)
36303625 Filter: (ctid = '(1,1)'::tid)
3631- -> Materialize (cost=xxx rows=1 width=xxx)
3632- -> Tid Scan on t3 b2t3 (cost=xxx rows=1 width=xxx)
3633- TID Cond: (ctid = '(1,1)'::tid)
3634-(43 rows)
3626+ -> Tid Scan on t3 b2t3 (cost=xxx rows=1 width=xxx)
3627+ TID Cond: (ctid = '(1,1)'::tid)
3628+ -> Tid Scan on t4 b2t4 (cost=xxx rows=1 width=xxx)
3629+ TID Cond: (ctid = '(1,1)'::tid)
3630+(41 rows)
36353631
36363632 \o results/ut-R.tmpout
36373633 /*+
@@ -3756,8 +3752,6 @@ error hint:
37563752 Aggregate (cost=xxx rows=1 width=xxx)
37573753 -> Nested Loop (cost=xxx rows=1 width=xxx)
37583754 Join Filter: (t1.c1 = t4.c1)
3759- -> Tid Scan on t4 (cost=xxx rows=1 width=xxx)
3760- TID Cond: (ctid = '(1,1)'::tid)
37613755 -> Nested Loop (cost=xxx rows=1 width=xxx)
37623756 Join Filter: (t1.c1 = t3.c1)
37633757 -> Merge Join (cost=xxx rows=1 width=xxx)
@@ -3771,15 +3765,14 @@ error hint:
37713765 Sort Key: t2.c1
37723766 -> Seq Scan on t2 (cost=xxx rows=1 width=xxx)
37733767 Filter: (ctid = '(1,1)'::tid)
3774- -> Materialize (cost=xxx rows=1 width=xxx)
3775- -> Tid Scan on t3 (cost=xxx rows=1 width=xxx)
3776- TID Cond: (ctid = '(1,1)'::tid)
3768+ -> Tid Scan on t3 (cost=xxx rows=1 width=xxx)
3769+ TID Cond: (ctid = '(1,1)'::tid)
3770+ -> Tid Scan on t4 (cost=xxx rows=1 width=xxx)
3771+ TID Cond: (ctid = '(1,1)'::tid)
37773772
37783773 Aggregate (cost=xxx rows=1 width=xxx)
37793774 -> Nested Loop (cost=xxx rows=1 width=xxx)
37803775 Join Filter: (t1.c1 = t4.c1)
3781- -> Tid Scan on t4 (cost=xxx rows=1 width=xxx)
3782- TID Cond: (ctid = '(1,1)'::tid)
37833776 -> Nested Loop (cost=xxx rows=1 width=xxx)
37843777 Join Filter: (t1.c1 = t3.c1)
37853778 -> Merge Join (cost=xxx rows=1 width=xxx)
@@ -3793,15 +3786,14 @@ error hint:
37933786 Sort Key: t2.c1
37943787 -> Seq Scan on t2 (cost=xxx rows=1 width=xxx)
37953788 Filter: (ctid = '(1,1)'::tid)
3796- -> Materialize (cost=xxx rows=1 width=xxx)
3797- -> Tid Scan on t3 (cost=xxx rows=1 width=xxx)
3798- TID Cond: (ctid = '(1,1)'::tid)
3789+ -> Tid Scan on t3 (cost=xxx rows=1 width=xxx)
3790+ TID Cond: (ctid = '(1,1)'::tid)
3791+ -> Tid Scan on t4 (cost=xxx rows=1 width=xxx)
3792+ TID Cond: (ctid = '(1,1)'::tid)
37993793
38003794 Aggregate (cost=xxx rows=1 width=xxx)
38013795 -> Nested Loop (cost=xxx rows=1 width=xxx)
38023796 Join Filter: (t1.c1 = t4.c1)
3803- -> Tid Scan on t4 (cost=xxx rows=1 width=xxx)
3804- TID Cond: (ctid = '(1,1)'::tid)
38053797 -> Nested Loop (cost=xxx rows=1 width=xxx)
38063798 Join Filter: (t1.c1 = t3.c1)
38073799 -> Merge Join (cost=xxx rows=1 width=xxx)
@@ -3815,10 +3807,11 @@ error hint:
38153807 Sort Key: t2.c1
38163808 -> Seq Scan on t2 (cost=xxx rows=1 width=xxx)
38173809 Filter: (ctid = '(1,1)'::tid)
3818- -> Materialize (cost=xxx rows=1 width=xxx)
3819- -> Tid Scan on t3 (cost=xxx rows=1 width=xxx)
3820- TID Cond: (ctid = '(1,1)'::tid)
3821-(65 rows)
3810+ -> Tid Scan on t3 (cost=xxx rows=1 width=xxx)
3811+ TID Cond: (ctid = '(1,1)'::tid)
3812+ -> Tid Scan on t4 (cost=xxx rows=1 width=xxx)
3813+ TID Cond: (ctid = '(1,1)'::tid)
3814+(62 rows)
38223815
38233816 \o results/ut-R.tmpout
38243817 /*+
@@ -3965,8 +3958,6 @@ error hint:
39653958 Aggregate (cost=xxx rows=1 width=xxx)
39663959 -> Nested Loop (cost=xxx rows=1 width=xxx)
39673960 Join Filter: (b1t1.c1 = b1t4.c1)
3968- -> Tid Scan on t4 b1t4 (cost=xxx rows=1 width=xxx)
3969- TID Cond: (ctid = '(1,1)'::tid)
39703961 -> Nested Loop (cost=xxx rows=1 width=xxx)
39713962 Join Filter: (b1t1.c1 = b1t3.c1)
39723963 -> Merge Join (cost=xxx rows=1 width=xxx)
@@ -3980,15 +3971,14 @@ error hint:
39803971 Sort Key: b1t2.c1
39813972 -> Seq Scan on t2 b1t2 (cost=xxx rows=1 width=xxx)
39823973 Filter: (ctid = '(1,1)'::tid)
3983- -> Materialize (cost=xxx rows=1 width=xxx)
3984- -> Tid Scan on t3 b1t3 (cost=xxx rows=1 width=xxx)
3985- TID Cond: (ctid = '(1,1)'::tid)
3974+ -> Tid Scan on t3 b1t3 (cost=xxx rows=1 width=xxx)
3975+ TID Cond: (ctid = '(1,1)'::tid)
3976+ -> Tid Scan on t4 b1t4 (cost=xxx rows=1 width=xxx)
3977+ TID Cond: (ctid = '(1,1)'::tid)
39863978
39873979 Aggregate (cost=xxx rows=1 width=xxx)
39883980 -> Nested Loop (cost=xxx rows=1 width=xxx)
39893981 Join Filter: (b2t1.c1 = b2t4.c1)
3990- -> Tid Scan on t4 b2t4 (cost=xxx rows=1 width=xxx)
3991- TID Cond: (ctid = '(1,1)'::tid)
39923982 -> Nested Loop (cost=xxx rows=1 width=xxx)
39933983 Join Filter: (b2t1.c1 = b2t3.c1)
39943984 -> Merge Join (cost=xxx rows=1 width=xxx)
@@ -4002,15 +3992,14 @@ error hint:
40023992 Sort Key: b2t2.c1
40033993 -> Seq Scan on t2 b2t2 (cost=xxx rows=1 width=xxx)
40043994 Filter: (ctid = '(1,1)'::tid)
4005- -> Materialize (cost=xxx rows=1 width=xxx)
4006- -> Tid Scan on t3 b2t3 (cost=xxx rows=1 width=xxx)
4007- TID Cond: (ctid = '(1,1)'::tid)
3995+ -> Tid Scan on t3 b2t3 (cost=xxx rows=1 width=xxx)
3996+ TID Cond: (ctid = '(1,1)'::tid)
3997+ -> Tid Scan on t4 b2t4 (cost=xxx rows=1 width=xxx)
3998+ TID Cond: (ctid = '(1,1)'::tid)
40083999
40094000 Aggregate (cost=xxx rows=1 width=xxx)
40104001 -> Nested Loop (cost=xxx rows=1 width=xxx)
40114002 Join Filter: (b3t1.c1 = b3t4.c1)
4012- -> Tid Scan on t4 b3t4 (cost=xxx rows=1 width=xxx)
4013- TID Cond: (ctid = '(1,1)'::tid)
40144003 -> Nested Loop (cost=xxx rows=1 width=xxx)
40154004 Join Filter: (b3t1.c1 = b3t3.c1)
40164005 -> Merge Join (cost=xxx rows=1 width=xxx)
@@ -4024,10 +4013,11 @@ error hint:
40244013 Sort Key: b3t2.c1
40254014 -> Seq Scan on t2 b3t2 (cost=xxx rows=1 width=xxx)
40264015 Filter: (ctid = '(1,1)'::tid)
4027- -> Materialize (cost=xxx rows=1 width=xxx)
4028- -> Tid Scan on t3 b3t3 (cost=xxx rows=1 width=xxx)
4029- TID Cond: (ctid = '(1,1)'::tid)
4030-(65 rows)
4016+ -> Tid Scan on t3 b3t3 (cost=xxx rows=1 width=xxx)
4017+ TID Cond: (ctid = '(1,1)'::tid)
4018+ -> Tid Scan on t4 b3t4 (cost=xxx rows=1 width=xxx)
4019+ TID Cond: (ctid = '(1,1)'::tid)
4020+(62 rows)
40314021
40324022 \o results/ut-R.tmpout
40334023 /*+
--- a/expected/ut-S.out
+++ b/expected/ut-S.out
@@ -1620,8 +1620,8 @@ AND bmt1.c1 <> (
16201620 SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)'
16211621 )
16221622 ;
1623- QUERY PLAN
1624------------------------------------------------------------
1623+ QUERY PLAN
1624+-------------------------------------------------------
16251625 Aggregate
16261626 CTE c1
16271627 -> Aggregate
@@ -1629,37 +1629,34 @@ SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2 WHERE b3t1.ctid = '(1,1)' AND b3
16291629 Join Filter: (b1t1.c1 = b1t2.c1)
16301630 -> Tid Scan on t1 b1t1
16311631 TID Cond: (ctid = '(1,1)'::tid)
1632- -> Materialize
1633- -> Seq Scan on t2 b1t2
1634- Filter: (ctid = '(1,1)'::tid)
1632+ -> Seq Scan on t2 b1t2
1633+ Filter: (ctid = '(1,1)'::tid)
16351634 InitPlan 2 (returns $1)
16361635 -> Aggregate
16371636 -> Nested Loop
16381637 Join Filter: (b2t1.c1 = b2t2.c1)
16391638 -> Tid Scan on t1 b2t1
16401639 TID Cond: (ctid = '(1,1)'::tid)
1641- -> Materialize
1642- -> Seq Scan on t2 b2t2
1643- Filter: (ctid = '(1,1)'::tid)
1640+ -> Seq Scan on t2 b2t2
1641+ Filter: (ctid = '(1,1)'::tid)
16441642 InitPlan 3 (returns $2)
16451643 -> Aggregate
16461644 -> Nested Loop
16471645 Join Filter: (b3t1.c1 = b3t2.c1)
16481646 -> Tid Scan on t1 b3t1
16491647 TID Cond: (ctid = '(1,1)'::tid)
1650- -> Materialize
1651- -> Seq Scan on t2 b3t2
1652- Filter: (ctid = '(1,1)'::tid)
1648+ -> Seq Scan on t2 b3t2
1649+ Filter: (ctid = '(1,1)'::tid)
16531650 -> Nested Loop
1654- Join Filter: (bmt1.c1 = bmt2.c1)
1655- -> Seq Scan on t2 bmt2
1656- Filter: (ctid = '(1,1)'::tid)
16571651 -> Nested Loop
1658- -> CTE Scan on c1
1652+ Join Filter: (bmt1.c1 = bmt2.c1)
16591653 -> Tid Scan on t1 bmt1
16601654 TID Cond: (ctid = '(1,1)'::tid)
16611655 Filter: (c1 <> $2)
1662-(37 rows)
1656+ -> Seq Scan on t2 bmt2
1657+ Filter: (ctid = '(1,1)'::tid)
1658+ -> CTE Scan on c1
1659+(34 rows)
16631660
16641661 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)
16651662 TidScan(b1t1)SeqScan(b1t2)
@@ -1730,10 +1727,10 @@ error hint:
17301727 -> Nested Loop
17311728 -> Nested Loop
17321729 Join Filter: (bmt1.c1 = bmt2.c1)
1733- -> Index Scan using t2_pkey on t2 bmt2
1734- Filter: (ctid = '(1,1)'::tid)
17351730 -> Seq Scan on t1 bmt1
17361731 Filter: ((c1 <> $4) AND (ctid = '(1,1)'::tid))
1732+ -> Index Scan using t2_pkey on t2 bmt2
1733+ Filter: (ctid = '(1,1)'::tid)
17371734 -> CTE Scan on c1
17381735 (37 rows)
17391736
@@ -1750,79 +1747,76 @@ AND bmt1.c1 <> (
17501747 SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
17511748 )
17521749 ;
1753- QUERY PLAN
1754------------------------------------------------------------------------
1750+ QUERY PLAN
1751+-------------------------------------------------------------------
17551752 Aggregate
17561753 CTE c1
17571754 -> Aggregate
17581755 -> Nested Loop
17591756 Join Filter: (b1t1.c1 = b1t4.c1)
1760- -> Tid Scan on t4 b1t4
1761- TID Cond: (ctid = '(1,1)'::tid)
17621757 -> Nested Loop
17631758 Join Filter: (b1t1.c1 = b1t3.c1)
1764- -> Tid Scan on t3 b1t3
1765- TID Cond: (ctid = '(1,1)'::tid)
17661759 -> Nested Loop
17671760 Join Filter: (b1t1.c1 = b1t2.c1)
17681761 -> Tid Scan on t1 b1t1
17691762 TID Cond: (ctid = '(1,1)'::tid)
1770- -> Materialize
1771- -> Seq Scan on t2 b1t2
1772- Filter: (ctid = '(1,1)'::tid)
1763+ -> Seq Scan on t2 b1t2
1764+ Filter: (ctid = '(1,1)'::tid)
1765+ -> Tid Scan on t3 b1t3
1766+ TID Cond: (ctid = '(1,1)'::tid)
1767+ -> Tid Scan on t4 b1t4
1768+ TID Cond: (ctid = '(1,1)'::tid)
17731769 InitPlan 2 (returns $1)
17741770 -> Aggregate
17751771 -> Nested Loop
17761772 Join Filter: (b2t1.c1 = b2t4.c1)
1777- -> Tid Scan on t4 b2t4
1778- TID Cond: (ctid = '(1,1)'::tid)
17791773 -> Nested Loop
17801774 Join Filter: (b2t1.c1 = b2t3.c1)
1781- -> Tid Scan on t3 b2t3
1782- TID Cond: (ctid = '(1,1)'::tid)
17831775 -> Nested Loop
17841776 Join Filter: (b2t1.c1 = b2t2.c1)
17851777 -> Tid Scan on t1 b2t1
17861778 TID Cond: (ctid = '(1,1)'::tid)
1787- -> Materialize
1788- -> Seq Scan on t2 b2t2
1789- Filter: (ctid = '(1,1)'::tid)
1779+ -> Seq Scan on t2 b2t2
1780+ Filter: (ctid = '(1,1)'::tid)
1781+ -> Tid Scan on t3 b2t3
1782+ TID Cond: (ctid = '(1,1)'::tid)
1783+ -> Tid Scan on t4 b2t4
1784+ TID Cond: (ctid = '(1,1)'::tid)
17901785 InitPlan 3 (returns $2)
17911786 -> Aggregate
17921787 -> Nested Loop
17931788 Join Filter: (b3t1.c1 = b3t4.c1)
1794- -> Tid Scan on t4 b3t4
1795- TID Cond: (ctid = '(1,1)'::tid)
17961789 -> Nested Loop
17971790 Join Filter: (b3t1.c1 = b3t3.c1)
1798- -> Tid Scan on t3 b3t3
1799- TID Cond: (ctid = '(1,1)'::tid)
18001791 -> Nested Loop
18011792 Join Filter: (b3t1.c1 = b3t2.c1)
18021793 -> Tid Scan on t1 b3t1
18031794 TID Cond: (ctid = '(1,1)'::tid)
1804- -> Materialize
1805- -> Seq Scan on t2 b3t2
1806- Filter: (ctid = '(1,1)'::tid)
1795+ -> Seq Scan on t2 b3t2
1796+ Filter: (ctid = '(1,1)'::tid)
1797+ -> Tid Scan on t3 b3t3
1798+ TID Cond: (ctid = '(1,1)'::tid)
1799+ -> Tid Scan on t4 b3t4
1800+ TID Cond: (ctid = '(1,1)'::tid)
18071801 -> Nested Loop
1808- Join Filter: (bmt1.c1 = bmt4.c1)
1809- -> Tid Scan on t4 bmt4
1810- TID Cond: (ctid = '(1,1)'::tid)
1802+ Join Filter: (bmt1.c1 = c1.c1)
18111803 -> Nested Loop
1812- Join Filter: (bmt1.c1 = bmt3.c1)
1813- -> Tid Scan on t3 bmt3
1814- TID Cond: (ctid = '(1,1)'::tid)
1804+ Join Filter: (bmt1.c1 = bmt4.c1)
18151805 -> Nested Loop
1816- Join Filter: (bmt1.c1 = bmt2.c1)
1817- -> Seq Scan on t2 bmt2
1818- Filter: (ctid = '(1,1)'::tid)
1806+ Join Filter: (bmt1.c1 = bmt3.c1)
18191807 -> Nested Loop
1820- Join Filter: (bmt1.c1 = c1.c1)
1808+ Join Filter: (bmt1.c1 = bmt2.c1)
18211809 -> Tid Scan on t1 bmt1
18221810 TID Cond: (ctid = '(1,1)'::tid)
18231811 Filter: (c1 <> $2)
1824- -> CTE Scan on c1
1825-(70 rows)
1812+ -> Seq Scan on t2 bmt2
1813+ Filter: (ctid = '(1,1)'::tid)
1814+ -> Tid Scan on t3 bmt3
1815+ TID Cond: (ctid = '(1,1)'::tid)
1816+ -> Tid Scan on t4 bmt4
1817+ TID Cond: (ctid = '(1,1)'::tid)
1818+ -> CTE Scan on c1
1819+(67 rows)
18261820
18271821 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
18281822 TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
@@ -1877,7 +1871,9 @@ error hint:
18771871 CTE c1
18781872 -> Aggregate
18791873 -> Nested Loop
1874+ Join Filter: (b1t1.c1 = b1t4.c1)
18801875 -> Nested Loop
1876+ Join Filter: (b1t1.c1 = b1t3.c1)
18811877 -> Nested Loop
18821878 Join Filter: (b1t1.c1 = b1t2.c1)
18831879 -> Tid Scan on t1 b1t1
@@ -1885,69 +1881,75 @@ error hint:
18851881 -> Seq Scan on t2 b1t2
18861882 Filter: (ctid = '(1,1)'::tid)
18871883 -> Index Scan using t3_pkey on t3 b1t3
1888- Index Cond: (c1 = b1t1.c1)
1884+ Index Cond: (c1 = b1t2.c1)
18891885 Filter: (ctid = '(1,1)'::tid)
18901886 -> Bitmap Heap Scan on t4 b1t4
1891- Recheck Cond: (c1 = b1t1.c1)
1887+ Recheck Cond: (c1 = b1t2.c1)
18921888 Filter: (ctid = '(1,1)'::tid)
18931889 -> Bitmap Index Scan on t4_pkey
1894- Index Cond: (c1 = b1t1.c1)
1890+ Index Cond: (c1 = b1t2.c1)
18951891 InitPlan 2 (returns $4)
18961892 -> Aggregate
18971893 -> Nested Loop
1894+ Join Filter: (b2t1.c1 = b2t4.c1)
18981895 -> Nested Loop
1899- Join Filter: (b2t1.c1 = b2t3.c1)
1896+ Join Filter: (b2t2.c1 = b2t1.c1)
19001897 -> Nested Loop
1898+ Join Filter: (b2t2.c1 = b2t3.c1)
19011899 -> Tid Scan on t2 b2t2
19021900 TID Cond: (ctid = '(1,1)'::tid)
1903- -> Bitmap Heap Scan on t1 b2t1
1904- Recheck Cond: (c1 = b2t2.c1)
1901+ -> Seq Scan on t3 b2t3
19051902 Filter: (ctid = '(1,1)'::tid)
1906- -> Bitmap Index Scan on t1_pkey
1907- Index Cond: (c1 = b2t2.c1)
1908- -> Seq Scan on t3 b2t3
1903+ -> Bitmap Heap Scan on t1 b2t1
1904+ Recheck Cond: (c1 = b2t3.c1)
19091905 Filter: (ctid = '(1,1)'::tid)
1906+ -> Bitmap Index Scan on t1_pkey
1907+ Index Cond: (c1 = b2t3.c1)
19101908 -> Index Scan using t4_pkey on t4 b2t4
1911- Index Cond: (c1 = b2t1.c1)
1909+ Index Cond: (c1 = b2t2.c1)
19121910 Filter: (ctid = '(1,1)'::tid)
19131911 InitPlan 3 (returns $7)
19141912 -> Aggregate
19151913 -> Nested Loop
1916- Join Filter: (b3t1.c1 = b3t4.c1)
1914+ Join Filter: (b3t1.c1 = b3t2.c1)
19171915 -> Nested Loop
1916+ Join Filter: (b3t3.c1 = b3t1.c1)
19181917 -> Nested Loop
1918+ Join Filter: (b3t3.c1 = b3t4.c1)
19191919 -> Tid Scan on t3 b3t3
19201920 TID Cond: (ctid = '(1,1)'::tid)
1921- -> Index Scan using t1_pkey on t1 b3t1
1922- Index Cond: (c1 = b3t3.c1)
1921+ -> Seq Scan on t4 b3t4
19231922 Filter: (ctid = '(1,1)'::tid)
1924- -> Bitmap Heap Scan on t2 b3t2
1925- Recheck Cond: (c1 = b3t1.c1)
1923+ -> Index Scan using t1_pkey on t1 b3t1
1924+ Index Cond: (c1 = b3t4.c1)
19261925 Filter: (ctid = '(1,1)'::tid)
1927- -> Bitmap Index Scan on t2_pkey
1928- Index Cond: (c1 = b3t1.c1)
1929- -> Seq Scan on t4 b3t4
1926+ -> Bitmap Heap Scan on t2 b3t2
1927+ Recheck Cond: (c1 = b3t3.c1)
19301928 Filter: (ctid = '(1,1)'::tid)
1929+ -> Bitmap Index Scan on t2_pkey
1930+ Index Cond: (c1 = b3t3.c1)
19311931 -> Nested Loop
19321932 Join Filter: (bmt1.c1 = c1.c1)
19331933 -> Nested Loop
1934- Join Filter: (bmt1.c1 = bmt4.c1)
1934+ Join Filter: (bmt1.c1 = bmt3.c1)
19351935 -> Nested Loop
1936+ Join Filter: (bmt1.c1 = bmt2.c1)
19361937 -> Nested Loop
1937- Join Filter: (bmt1.c1 = bmt2.c1)
1938- -> Index Scan using t2_pkey on t2 bmt2
1939- Filter: (ctid = '(1,1)'::tid)
1938+ Join Filter: (bmt1.c1 = bmt4.c1)
19401939 -> Seq Scan on t1 bmt1
19411940 Filter: ((c1 <> $7) AND (ctid = '(1,1)'::tid))
1942- -> Bitmap Heap Scan on t3 bmt3
1943- Recheck Cond: (c1 = bmt1.c1)
1941+ -> Tid Scan on t4 bmt4
1942+ TID Cond: (ctid = '(1,1)'::tid)
1943+ -> Index Scan using t2_pkey on t2 bmt2
1944+ Index Cond: (c1 = bmt4.c1)
19441945 Filter: (ctid = '(1,1)'::tid)
1945- -> Bitmap Index Scan on t3_pkey
1946- Index Cond: (c1 = bmt1.c1)
1947- -> Tid Scan on t4 bmt4
1948- TID Cond: (ctid = '(1,1)'::tid)
1946+ -> Bitmap Heap Scan on t3 bmt3
1947+ Recheck Cond: (c1 = bmt2.c1)
1948+ Filter: (ctid = '(1,1)'::tid)
1949+ -> Bitmap Index Scan on t3_pkey
1950+ Index Cond: (c1 = bmt2.c1)
19491951 -> CTE Scan on c1
1950-(74 rows)
1952+(82 rows)
19511953
19521954 -- No. S-2-2-4
19531955 EXPLAIN (COSTS false)
@@ -1962,26 +1964,25 @@ AND bmt1.c1 <> (
19621964 SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)'
19631965 )
19641966 ;
1965- QUERY PLAN
1966------------------------------------------------------------------------
1967+ QUERY PLAN
1968+-------------------------------------------------------------------
19671969 Aggregate
19681970 CTE c1
19691971 -> Aggregate
19701972 -> Nested Loop
19711973 Join Filter: (b1t1.c1 = b1t4.c1)
1972- -> Tid Scan on t4 b1t4
1973- TID Cond: (ctid = '(1,1)'::tid)
19741974 -> Nested Loop
19751975 Join Filter: (b1t1.c1 = b1t3.c1)
1976- -> Tid Scan on t3 b1t3
1977- TID Cond: (ctid = '(1,1)'::tid)
19781976 -> Nested Loop
19791977 Join Filter: (b1t1.c1 = b1t2.c1)
19801978 -> Tid Scan on t1 b1t1
19811979 TID Cond: (ctid = '(1,1)'::tid)
1982- -> Materialize
1983- -> Seq Scan on t2 b1t2
1984- Filter: (ctid = '(1,1)'::tid)
1980+ -> Seq Scan on t2 b1t2
1981+ Filter: (ctid = '(1,1)'::tid)
1982+ -> Tid Scan on t3 b1t3
1983+ TID Cond: (ctid = '(1,1)'::tid)
1984+ -> Tid Scan on t4 b1t4
1985+ TID Cond: (ctid = '(1,1)'::tid)
19851986 InitPlan 3 (returns $2)
19861987 -> Result
19871988 InitPlan 2 (returns $1)
@@ -1994,24 +1995,24 @@ SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)'
19941995 -> Tid Scan on t1 b3t1
19951996 TID Cond: (ctid = '(1,1)'::tid)
19961997 -> Nested Loop
1997- Join Filter: (bmt1.c1 = bmt4.c1)
1998- -> Tid Scan on t4 bmt4
1999- TID Cond: (ctid = '(1,1)'::tid)
1998+ Join Filter: (bmt1.c1 = c1.c1)
20001999 -> Nested Loop
2001- Join Filter: (bmt1.c1 = bmt3.c1)
2002- -> Tid Scan on t3 bmt3
2003- TID Cond: (ctid = '(1,1)'::tid)
2000+ Join Filter: (bmt1.c1 = bmt4.c1)
20042001 -> Nested Loop
2005- Join Filter: (bmt1.c1 = bmt2.c1)
2006- -> Seq Scan on t2 bmt2
2007- Filter: (ctid = '(1,1)'::tid)
2002+ Join Filter: (bmt1.c1 = bmt3.c1)
20082003 -> Nested Loop
2009- Join Filter: (bmt1.c1 = c1.c1)
2004+ Join Filter: (bmt1.c1 = bmt2.c1)
20102005 -> Tid Scan on t1 bmt1
20112006 TID Cond: (ctid = '(1,1)'::tid)
20122007 Filter: (c1 <> $4)
2013- -> CTE Scan on c1
2014-(47 rows)
2008+ -> Seq Scan on t2 bmt2
2009+ Filter: (ctid = '(1,1)'::tid)
2010+ -> Tid Scan on t3 bmt3
2011+ TID Cond: (ctid = '(1,1)'::tid)
2012+ -> Tid Scan on t4 bmt4
2013+ TID Cond: (ctid = '(1,1)'::tid)
2014+ -> CTE Scan on c1
2015+(46 rows)
20152016
20162017 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
20172018 TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
@@ -2060,7 +2061,9 @@ error hint:
20602061 CTE c1
20612062 -> Aggregate
20622063 -> Nested Loop
2064+ Join Filter: (b1t1.c1 = b1t4.c1)
20632065 -> Nested Loop
2066+ Join Filter: (b1t1.c1 = b1t3.c1)
20642067 -> Nested Loop
20652068 Join Filter: (b1t1.c1 = b1t2.c1)
20662069 -> Tid Scan on t1 b1t1
@@ -2068,13 +2071,13 @@ error hint:
20682071 -> Seq Scan on t2 b1t2
20692072 Filter: (ctid = '(1,1)'::tid)
20702073 -> Index Scan using t3_pkey on t3 b1t3
2071- Index Cond: (c1 = b1t1.c1)
2074+ Index Cond: (c1 = b1t2.c1)
20722075 Filter: (ctid = '(1,1)'::tid)
20732076 -> Bitmap Heap Scan on t4 b1t4
2074- Recheck Cond: (c1 = b1t1.c1)
2077+ Recheck Cond: (c1 = b1t2.c1)
20752078 Filter: (ctid = '(1,1)'::tid)
20762079 -> Bitmap Index Scan on t4_pkey
2077- Index Cond: (c1 = b1t1.c1)
2080+ Index Cond: (c1 = b1t2.c1)
20782081 InitPlan 3 (returns $3)
20792082 -> Result
20802083 InitPlan 2 (returns $2)
@@ -2094,23 +2097,25 @@ error hint:
20942097 -> Nested Loop
20952098 Join Filter: (bmt1.c1 = c1.c1)
20962099 -> Nested Loop
2097- Join Filter: (bmt1.c1 = bmt4.c1)
2100+ Join Filter: (bmt1.c1 = bmt3.c1)
20982101 -> Nested Loop
2102+ Join Filter: (bmt1.c1 = bmt2.c1)
20992103 -> Nested Loop
2100- Join Filter: (bmt1.c1 = bmt2.c1)
2101- -> Index Scan using t2_pkey on t2 bmt2
2102- Filter: (ctid = '(1,1)'::tid)
2104+ Join Filter: (bmt1.c1 = bmt4.c1)
21032105 -> Seq Scan on t1 bmt1
21042106 Filter: ((c1 <> $5) AND (ctid = '(1,1)'::tid))
2105- -> Bitmap Heap Scan on t3 bmt3
2106- Recheck Cond: (c1 = bmt1.c1)
2107+ -> Tid Scan on t4 bmt4
2108+ TID Cond: (ctid = '(1,1)'::tid)
2109+ -> Index Scan using t2_pkey on t2 bmt2
2110+ Index Cond: (c1 = bmt4.c1)
21072111 Filter: (ctid = '(1,1)'::tid)
2108- -> Bitmap Index Scan on t3_pkey
2109- Index Cond: (c1 = bmt1.c1)
2110- -> Tid Scan on t4 bmt4
2111- TID Cond: (ctid = '(1,1)'::tid)
2112+ -> Bitmap Heap Scan on t3 bmt3
2113+ Recheck Cond: (c1 = bmt2.c1)
2114+ Filter: (ctid = '(1,1)'::tid)
2115+ -> Bitmap Index Scan on t3_pkey
2116+ Index Cond: (c1 = bmt2.c1)
21122117 -> CTE Scan on c1
2113-(54 rows)
2118+(58 rows)
21142119
21152120 ----
21162121 ---- No. S-2-3 RULE or VIEW
@@ -2122,22 +2127,22 @@ EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
21222127 Aggregate
21232128 -> Nested Loop
21242129 Join Filter: (t1.c1 = t4.c1)
2125- -> Tid Scan on t4
2126- TID Cond: (ctid = '(1,1)'::tid)
21272130 -> Nested Loop
21282131 Join Filter: (t1.c1 = t3.c1)
2129- -> Tid Scan on t3
2130- TID Cond: (ctid = '(1,1)'::tid)
21312132 -> Nested Loop
21322133 Join Filter: (t1.c1 = t2.c1)
2133- -> Seq Scan on t2
2134- Filter: (ctid = '(1,1)'::tid)
21352134 -> Nested Loop
21362135 -> Tid Scan on r1
21372136 TID Cond: (ctid = '(1,1)'::tid)
21382137 Filter: (c1 = 1)
21392138 -> Tid Scan on t1
21402139 TID Cond: (ctid = '(1,1)'::tid)
2140+ -> Seq Scan on t2
2141+ Filter: (ctid = '(1,1)'::tid)
2142+ -> Tid Scan on t3
2143+ TID Cond: (ctid = '(1,1)'::tid)
2144+ -> Tid Scan on t4
2145+ TID Cond: (ctid = '(1,1)'::tid)
21412146 (19 rows)
21422147
21432148 /*+TidScan(t1)SeqScan(t2)IndexScan(t3 t3_pkey)BitmapScan(t4 t4_pkey)
@@ -2160,7 +2165,9 @@ error hint:
21602165 ------------------------------------------------------------------------------
21612166 Aggregate
21622167 -> Nested Loop
2168+ Join Filter: (t1.c1 = t4.c1)
21632169 -> Nested Loop
2170+ Join Filter: (t1.c1 = t3.c1)
21642171 -> Nested Loop
21652172 Join Filter: (t1.c1 = t2.c1)
21662173 -> Nested Loop
@@ -2171,14 +2178,14 @@ error hint:
21712178 -> Seq Scan on t2
21722179 Filter: (ctid = '(1,1)'::tid)
21732180 -> Index Scan using t3_pkey on t3
2174- Index Cond: (c1 = t1.c1)
2181+ Index Cond: (c1 = t2.c1)
21752182 Filter: (ctid = '(1,1)'::tid)
21762183 -> Bitmap Heap Scan on t4
2177- Recheck Cond: (c1 = t1.c1)
2184+ Recheck Cond: (c1 = t2.c1)
21782185 Filter: (ctid = '(1,1)'::tid)
21792186 -> Bitmap Index Scan on t4_pkey
2180- Index Cond: (c1 = t1.c1)
2181-(20 rows)
2187+ Index Cond: (c1 = t2.c1)
2188+(22 rows)
21822189
21832190 EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
21842191 QUERY PLAN
@@ -2186,22 +2193,22 @@ EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
21862193 Aggregate
21872194 -> Nested Loop
21882195 Join Filter: (b1t1.c1 = b1t4.c1)
2189- -> Tid Scan on t4 b1t4
2190- TID Cond: (ctid = '(1,1)'::tid)
21912196 -> Nested Loop
21922197 Join Filter: (b1t1.c1 = b1t3.c1)
2193- -> Tid Scan on t3 b1t3
2194- TID Cond: (ctid = '(1,1)'::tid)
21952198 -> Nested Loop
21962199 Join Filter: (b1t1.c1 = b1t2.c1)
2197- -> Seq Scan on t2 b1t2
2198- Filter: (ctid = '(1,1)'::tid)
21992200 -> Nested Loop
22002201 -> Tid Scan on r1_
22012202 TID Cond: (ctid = '(1,1)'::tid)
22022203 Filter: (c1 = 1)
22032204 -> Tid Scan on t1 b1t1
22042205 TID Cond: (ctid = '(1,1)'::tid)
2206+ -> Seq Scan on t2 b1t2
2207+ Filter: (ctid = '(1,1)'::tid)
2208+ -> Tid Scan on t3 b1t3
2209+ TID Cond: (ctid = '(1,1)'::tid)
2210+ -> Tid Scan on t4 b1t4
2211+ TID Cond: (ctid = '(1,1)'::tid)
22052212 (19 rows)
22062213
22072214 /*+TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
@@ -2224,7 +2231,9 @@ error hint:
22242231 ------------------------------------------------------------------------------
22252232 Aggregate
22262233 -> Nested Loop
2234+ Join Filter: (b1t1.c1 = b1t4.c1)
22272235 -> Nested Loop
2236+ Join Filter: (b1t1.c1 = b1t3.c1)
22282237 -> Nested Loop
22292238 Join Filter: (b1t1.c1 = b1t2.c1)
22302239 -> Nested Loop
@@ -2235,14 +2244,14 @@ error hint:
22352244 -> Seq Scan on t2 b1t2
22362245 Filter: (ctid = '(1,1)'::tid)
22372246 -> Index Scan using t3_pkey on t3 b1t3
2238- Index Cond: (c1 = b1t1.c1)
2247+ Index Cond: (c1 = b1t2.c1)
22392248 Filter: (ctid = '(1,1)'::tid)
22402249 -> Bitmap Heap Scan on t4 b1t4
2241- Recheck Cond: (c1 = b1t1.c1)
2250+ Recheck Cond: (c1 = b1t2.c1)
22422251 Filter: (ctid = '(1,1)'::tid)
22432252 -> Bitmap Index Scan on t4_pkey
2244- Index Cond: (c1 = b1t1.c1)
2245-(20 rows)
2253+ Index Cond: (c1 = b1t2.c1)
2254+(22 rows)
22462255
22472256 -- No. S-2-3-2
22482257 EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
@@ -2251,42 +2260,42 @@ EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
22512260 Aggregate
22522261 -> Nested Loop
22532262 Join Filter: (t1.c1 = t4.c1)
2254- -> Tid Scan on t4
2255- TID Cond: (ctid = '(1,1)'::tid)
22562263 -> Nested Loop
22572264 Join Filter: (t1.c1 = t3.c1)
2258- -> Tid Scan on t3
2259- TID Cond: (ctid = '(1,1)'::tid)
22602265 -> Nested Loop
22612266 Join Filter: (t1.c1 = t2.c1)
2262- -> Seq Scan on t2
2263- Filter: (ctid = '(1,1)'::tid)
22642267 -> Nested Loop
22652268 -> Tid Scan on r2
22662269 TID Cond: (ctid = '(1,1)'::tid)
22672270 Filter: (c1 = 1)
22682271 -> Tid Scan on t1
22692272 TID Cond: (ctid = '(1,1)'::tid)
2273+ -> Seq Scan on t2
2274+ Filter: (ctid = '(1,1)'::tid)
2275+ -> Tid Scan on t3
2276+ TID Cond: (ctid = '(1,1)'::tid)
2277+ -> Tid Scan on t4
2278+ TID Cond: (ctid = '(1,1)'::tid)
22702279
22712280 Aggregate
22722281 -> Nested Loop
22732282 Join Filter: (t1.c1 = t4.c1)
2274- -> Tid Scan on t4
2275- TID Cond: (ctid = '(1,1)'::tid)
22762283 -> Nested Loop
22772284 Join Filter: (t1.c1 = t3.c1)
2278- -> Tid Scan on t3
2279- TID Cond: (ctid = '(1,1)'::tid)
22802285 -> Nested Loop
22812286 Join Filter: (t1.c1 = t2.c1)
2282- -> Seq Scan on t2
2283- Filter: (ctid = '(1,1)'::tid)
22842287 -> Nested Loop
22852288 -> Tid Scan on r2
22862289 TID Cond: (ctid = '(1,1)'::tid)
22872290 Filter: (c1 = 1)
22882291 -> Tid Scan on t1
22892292 TID Cond: (ctid = '(1,1)'::tid)
2293+ -> Seq Scan on t2
2294+ Filter: (ctid = '(1,1)'::tid)
2295+ -> Tid Scan on t3
2296+ TID Cond: (ctid = '(1,1)'::tid)
2297+ -> Tid Scan on t4
2298+ TID Cond: (ctid = '(1,1)'::tid)
22902299 (39 rows)
22912300
22922301 /*+TidScan(t1)SeqScan(t2)IndexScan(t3 t3_pkey)BitmapScan(t4 t4_pkey)
@@ -2322,7 +2331,9 @@ error hint:
23222331 ------------------------------------------------------------------------------
23232332 Aggregate
23242333 -> Nested Loop
2334+ Join Filter: (t1.c1 = t4.c1)
23252335 -> Nested Loop
2336+ Join Filter: (t1.c1 = t3.c1)
23262337 -> Nested Loop
23272338 Join Filter: (t1.c1 = t2.c1)
23282339 -> Nested Loop
@@ -2333,17 +2344,19 @@ error hint:
23332344 -> Seq Scan on t2
23342345 Filter: (ctid = '(1,1)'::tid)
23352346 -> Index Scan using t3_pkey on t3
2336- Index Cond: (c1 = t1.c1)
2347+ Index Cond: (c1 = t2.c1)
23372348 Filter: (ctid = '(1,1)'::tid)
23382349 -> Bitmap Heap Scan on t4
2339- Recheck Cond: (c1 = t1.c1)
2350+ Recheck Cond: (c1 = t2.c1)
23402351 Filter: (ctid = '(1,1)'::tid)
23412352 -> Bitmap Index Scan on t4_pkey
2342- Index Cond: (c1 = t1.c1)
2353+ Index Cond: (c1 = t2.c1)
23432354
23442355 Aggregate
23452356 -> Nested Loop
2357+ Join Filter: (t1.c1 = t4.c1)
23462358 -> Nested Loop
2359+ Join Filter: (t1.c1 = t3.c1)
23472360 -> Nested Loop
23482361 Join Filter: (t1.c1 = t2.c1)
23492362 -> Nested Loop
@@ -2354,14 +2367,14 @@ error hint:
23542367 -> Seq Scan on t2
23552368 Filter: (ctid = '(1,1)'::tid)
23562369 -> Index Scan using t3_pkey on t3
2357- Index Cond: (c1 = t1.c1)
2370+ Index Cond: (c1 = t2.c1)
23582371 Filter: (ctid = '(1,1)'::tid)
23592372 -> Bitmap Heap Scan on t4
2360- Recheck Cond: (c1 = t1.c1)
2373+ Recheck Cond: (c1 = t2.c1)
23612374 Filter: (ctid = '(1,1)'::tid)
23622375 -> Bitmap Index Scan on t4_pkey
2363- Index Cond: (c1 = t1.c1)
2364-(41 rows)
2376+ Index Cond: (c1 = t2.c1)
2377+(45 rows)
23652378
23662379 EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
23672380 QUERY PLAN
@@ -2369,42 +2382,42 @@ EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
23692382 Aggregate
23702383 -> Nested Loop
23712384 Join Filter: (b1t1.c1 = b1t4.c1)
2372- -> Tid Scan on t4 b1t4
2373- TID Cond: (ctid = '(1,1)'::tid)
23742385 -> Nested Loop
23752386 Join Filter: (b1t1.c1 = b1t3.c1)
2376- -> Tid Scan on t3 b1t3
2377- TID Cond: (ctid = '(1,1)'::tid)
23782387 -> Nested Loop
23792388 Join Filter: (b1t1.c1 = b1t2.c1)
2380- -> Seq Scan on t2 b1t2
2381- Filter: (ctid = '(1,1)'::tid)
23822389 -> Nested Loop
23832390 -> Tid Scan on r2_
23842391 TID Cond: (ctid = '(1,1)'::tid)
23852392 Filter: (c1 = 1)
23862393 -> Tid Scan on t1 b1t1
23872394 TID Cond: (ctid = '(1,1)'::tid)
2395+ -> Seq Scan on t2 b1t2
2396+ Filter: (ctid = '(1,1)'::tid)
2397+ -> Tid Scan on t3 b1t3
2398+ TID Cond: (ctid = '(1,1)'::tid)
2399+ -> Tid Scan on t4 b1t4
2400+ TID Cond: (ctid = '(1,1)'::tid)
23882401
23892402 Aggregate
23902403 -> Nested Loop
23912404 Join Filter: (b2t1.c1 = b2t4.c1)
2392- -> Tid Scan on t4 b2t4
2393- TID Cond: (ctid = '(1,1)'::tid)
23942405 -> Nested Loop
23952406 Join Filter: (b2t1.c1 = b2t3.c1)
2396- -> Tid Scan on t3 b2t3
2397- TID Cond: (ctid = '(1,1)'::tid)
23982407 -> Nested Loop
23992408 Join Filter: (b2t1.c1 = b2t2.c1)
2400- -> Seq Scan on t2 b2t2
2401- Filter: (ctid = '(1,1)'::tid)
24022409 -> Nested Loop
24032410 -> Tid Scan on r2_
24042411 TID Cond: (ctid = '(1,1)'::tid)
24052412 Filter: (c1 = 1)
24062413 -> Tid Scan on t1 b2t1
24072414 TID Cond: (ctid = '(1,1)'::tid)
2415+ -> Seq Scan on t2 b2t2
2416+ Filter: (ctid = '(1,1)'::tid)
2417+ -> Tid Scan on t3 b2t3
2418+ TID Cond: (ctid = '(1,1)'::tid)
2419+ -> Tid Scan on t4 b2t4
2420+ TID Cond: (ctid = '(1,1)'::tid)
24082421 (39 rows)
24092422
24102423 /*+TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
@@ -2449,7 +2462,9 @@ error hint:
24492462 ------------------------------------------------------------------------------
24502463 Aggregate
24512464 -> Nested Loop
2465+ Join Filter: (b1t1.c1 = b1t4.c1)
24522466 -> Nested Loop
2467+ Join Filter: (b1t1.c1 = b1t3.c1)
24532468 -> Nested Loop
24542469 Join Filter: (b1t1.c1 = b1t2.c1)
24552470 -> Nested Loop
@@ -2460,35 +2475,37 @@ error hint:
24602475 -> Seq Scan on t2 b1t2
24612476 Filter: (ctid = '(1,1)'::tid)
24622477 -> Index Scan using t3_pkey on t3 b1t3
2463- Index Cond: (c1 = b1t1.c1)
2478+ Index Cond: (c1 = b1t2.c1)
24642479 Filter: (ctid = '(1,1)'::tid)
24652480 -> Bitmap Heap Scan on t4 b1t4
2466- Recheck Cond: (c1 = b1t1.c1)
2481+ Recheck Cond: (c1 = b1t2.c1)
24672482 Filter: (ctid = '(1,1)'::tid)
24682483 -> Bitmap Index Scan on t4_pkey
2469- Index Cond: (c1 = b1t1.c1)
2484+ Index Cond: (c1 = b1t2.c1)
24702485
24712486 Aggregate
24722487 -> Nested Loop
2488+ Join Filter: (b2t1.c1 = b2t4.c1)
24732489 -> Nested Loop
2474- Join Filter: (b2t1.c1 = b2t3.c1)
2490+ Join Filter: (b2t2.c1 = b2t1.c1)
24752491 -> Nested Loop
2492+ Join Filter: (b2t2.c1 = b2t3.c1)
24762493 -> Nested Loop
24772494 -> Seq Scan on r2_
24782495 Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
24792496 -> Tid Scan on t2 b2t2
24802497 TID Cond: (ctid = '(1,1)'::tid)
2481- -> Bitmap Heap Scan on t1 b2t1
2482- Recheck Cond: (c1 = b2t2.c1)
2498+ -> Seq Scan on t3 b2t3
24832499 Filter: (ctid = '(1,1)'::tid)
2484- -> Bitmap Index Scan on t1_pkey
2485- Index Cond: (c1 = b2t2.c1)
2486- -> Seq Scan on t3 b2t3
2500+ -> Bitmap Heap Scan on t1 b2t1
2501+ Recheck Cond: (c1 = b2t3.c1)
24872502 Filter: (ctid = '(1,1)'::tid)
2503+ -> Bitmap Index Scan on t1_pkey
2504+ Index Cond: (c1 = b2t3.c1)
24882505 -> Index Scan using t4_pkey on t4 b2t4
2489- Index Cond: (c1 = b2t1.c1)
2506+ Index Cond: (c1 = b2t2.c1)
24902507 Filter: (ctid = '(1,1)'::tid)
2491-(41 rows)
2508+(45 rows)
24922509
24932510 -- No. S-2-3-3
24942511 EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
@@ -2497,62 +2514,62 @@ EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
24972514 Aggregate
24982515 -> Nested Loop
24992516 Join Filter: (t1.c1 = t4.c1)
2500- -> Tid Scan on t4
2501- TID Cond: (ctid = '(1,1)'::tid)
25022517 -> Nested Loop
25032518 Join Filter: (t1.c1 = t3.c1)
2504- -> Tid Scan on t3
2505- TID Cond: (ctid = '(1,1)'::tid)
25062519 -> Nested Loop
25072520 Join Filter: (t1.c1 = t2.c1)
2508- -> Seq Scan on t2
2509- Filter: (ctid = '(1,1)'::tid)
25102521 -> Nested Loop
25112522 -> Tid Scan on r3
25122523 TID Cond: (ctid = '(1,1)'::tid)
25132524 Filter: (c1 = 1)
25142525 -> Tid Scan on t1
25152526 TID Cond: (ctid = '(1,1)'::tid)
2527+ -> Seq Scan on t2
2528+ Filter: (ctid = '(1,1)'::tid)
2529+ -> Tid Scan on t3
2530+ TID Cond: (ctid = '(1,1)'::tid)
2531+ -> Tid Scan on t4
2532+ TID Cond: (ctid = '(1,1)'::tid)
25162533
25172534 Aggregate
25182535 -> Nested Loop
25192536 Join Filter: (t1.c1 = t4.c1)
2520- -> Tid Scan on t4
2521- TID Cond: (ctid = '(1,1)'::tid)
25222537 -> Nested Loop
25232538 Join Filter: (t1.c1 = t3.c1)
2524- -> Tid Scan on t3
2525- TID Cond: (ctid = '(1,1)'::tid)
25262539 -> Nested Loop
25272540 Join Filter: (t1.c1 = t2.c1)
2528- -> Seq Scan on t2
2529- Filter: (ctid = '(1,1)'::tid)
25302541 -> Nested Loop
25312542 -> Tid Scan on r3
25322543 TID Cond: (ctid = '(1,1)'::tid)
25332544 Filter: (c1 = 1)
25342545 -> Tid Scan on t1
25352546 TID Cond: (ctid = '(1,1)'::tid)
2547+ -> Seq Scan on t2
2548+ Filter: (ctid = '(1,1)'::tid)
2549+ -> Tid Scan on t3
2550+ TID Cond: (ctid = '(1,1)'::tid)
2551+ -> Tid Scan on t4
2552+ TID Cond: (ctid = '(1,1)'::tid)
25362553
25372554 Aggregate
25382555 -> Nested Loop
25392556 Join Filter: (t1.c1 = t4.c1)
2540- -> Tid Scan on t4
2541- TID Cond: (ctid = '(1,1)'::tid)
25422557 -> Nested Loop
25432558 Join Filter: (t1.c1 = t3.c1)
2544- -> Tid Scan on t3
2545- TID Cond: (ctid = '(1,1)'::tid)
25462559 -> Nested Loop
25472560 Join Filter: (t1.c1 = t2.c1)
2548- -> Seq Scan on t2
2549- Filter: (ctid = '(1,1)'::tid)
25502561 -> Nested Loop
25512562 -> Tid Scan on r3
25522563 TID Cond: (ctid = '(1,1)'::tid)
25532564 Filter: (c1 = 1)
25542565 -> Tid Scan on t1
25552566 TID Cond: (ctid = '(1,1)'::tid)
2567+ -> Seq Scan on t2
2568+ Filter: (ctid = '(1,1)'::tid)
2569+ -> Tid Scan on t3
2570+ TID Cond: (ctid = '(1,1)'::tid)
2571+ -> Tid Scan on t4
2572+ TID Cond: (ctid = '(1,1)'::tid)
25562573 (59 rows)
25572574
25582575 /*+TidScan(t1)SeqScan(t2)IndexScan(t3 t3_pkey)BitmapScan(t4 t4_pkey)
@@ -2601,7 +2618,9 @@ error hint:
26012618 ------------------------------------------------------------------------------
26022619 Aggregate
26032620 -> Nested Loop
2621+ Join Filter: (t1.c1 = t4.c1)
26042622 -> Nested Loop
2623+ Join Filter: (t1.c1 = t3.c1)
26052624 -> Nested Loop
26062625 Join Filter: (t1.c1 = t2.c1)
26072626 -> Nested Loop
@@ -2612,17 +2631,19 @@ error hint:
26122631 -> Seq Scan on t2
26132632 Filter: (ctid = '(1,1)'::tid)
26142633 -> Index Scan using t3_pkey on t3
2615- Index Cond: (c1 = t1.c1)
2634+ Index Cond: (c1 = t2.c1)
26162635 Filter: (ctid = '(1,1)'::tid)
26172636 -> Bitmap Heap Scan on t4
2618- Recheck Cond: (c1 = t1.c1)
2637+ Recheck Cond: (c1 = t2.c1)
26192638 Filter: (ctid = '(1,1)'::tid)
26202639 -> Bitmap Index Scan on t4_pkey
2621- Index Cond: (c1 = t1.c1)
2640+ Index Cond: (c1 = t2.c1)
26222641
26232642 Aggregate
26242643 -> Nested Loop
2644+ Join Filter: (t1.c1 = t4.c1)
26252645 -> Nested Loop
2646+ Join Filter: (t1.c1 = t3.c1)
26262647 -> Nested Loop
26272648 Join Filter: (t1.c1 = t2.c1)
26282649 -> Nested Loop
@@ -2633,17 +2654,19 @@ error hint:
26332654 -> Seq Scan on t2
26342655 Filter: (ctid = '(1,1)'::tid)
26352656 -> Index Scan using t3_pkey on t3
2636- Index Cond: (c1 = t1.c1)
2657+ Index Cond: (c1 = t2.c1)
26372658 Filter: (ctid = '(1,1)'::tid)
26382659 -> Bitmap Heap Scan on t4
2639- Recheck Cond: (c1 = t1.c1)
2660+ Recheck Cond: (c1 = t2.c1)
26402661 Filter: (ctid = '(1,1)'::tid)
26412662 -> Bitmap Index Scan on t4_pkey
2642- Index Cond: (c1 = t1.c1)
2663+ Index Cond: (c1 = t2.c1)
26432664
26442665 Aggregate
26452666 -> Nested Loop
2667+ Join Filter: (t1.c1 = t4.c1)
26462668 -> Nested Loop
2669+ Join Filter: (t1.c1 = t3.c1)
26472670 -> Nested Loop
26482671 Join Filter: (t1.c1 = t2.c1)
26492672 -> Nested Loop
@@ -2654,14 +2677,14 @@ error hint:
26542677 -> Seq Scan on t2
26552678 Filter: (ctid = '(1,1)'::tid)
26562679 -> Index Scan using t3_pkey on t3
2657- Index Cond: (c1 = t1.c1)
2680+ Index Cond: (c1 = t2.c1)
26582681 Filter: (ctid = '(1,1)'::tid)
26592682 -> Bitmap Heap Scan on t4
2660- Recheck Cond: (c1 = t1.c1)
2683+ Recheck Cond: (c1 = t2.c1)
26612684 Filter: (ctid = '(1,1)'::tid)
26622685 -> Bitmap Index Scan on t4_pkey
2663- Index Cond: (c1 = t1.c1)
2664-(62 rows)
2686+ Index Cond: (c1 = t2.c1)
2687+(68 rows)
26652688
26662689 EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
26672690 QUERY PLAN
@@ -2669,62 +2692,62 @@ EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
26692692 Aggregate
26702693 -> Nested Loop
26712694 Join Filter: (b1t1.c1 = b1t4.c1)
2672- -> Tid Scan on t4 b1t4
2673- TID Cond: (ctid = '(1,1)'::tid)
26742695 -> Nested Loop
26752696 Join Filter: (b1t1.c1 = b1t3.c1)
2676- -> Tid Scan on t3 b1t3
2677- TID Cond: (ctid = '(1,1)'::tid)
26782697 -> Nested Loop
26792698 Join Filter: (b1t1.c1 = b1t2.c1)
2680- -> Seq Scan on t2 b1t2
2681- Filter: (ctid = '(1,1)'::tid)
26822699 -> Nested Loop
26832700 -> Tid Scan on r3_
26842701 TID Cond: (ctid = '(1,1)'::tid)
26852702 Filter: (c1 = 1)
26862703 -> Tid Scan on t1 b1t1
26872704 TID Cond: (ctid = '(1,1)'::tid)
2705+ -> Seq Scan on t2 b1t2
2706+ Filter: (ctid = '(1,1)'::tid)
2707+ -> Tid Scan on t3 b1t3
2708+ TID Cond: (ctid = '(1,1)'::tid)
2709+ -> Tid Scan on t4 b1t4
2710+ TID Cond: (ctid = '(1,1)'::tid)
26882711
26892712 Aggregate
26902713 -> Nested Loop
26912714 Join Filter: (b2t1.c1 = b2t4.c1)
2692- -> Tid Scan on t4 b2t4
2693- TID Cond: (ctid = '(1,1)'::tid)
26942715 -> Nested Loop
26952716 Join Filter: (b2t1.c1 = b2t3.c1)
2696- -> Tid Scan on t3 b2t3
2697- TID Cond: (ctid = '(1,1)'::tid)
26982717 -> Nested Loop
26992718 Join Filter: (b2t1.c1 = b2t2.c1)
2700- -> Seq Scan on t2 b2t2
2701- Filter: (ctid = '(1,1)'::tid)
27022719 -> Nested Loop
27032720 -> Tid Scan on r3_
27042721 TID Cond: (ctid = '(1,1)'::tid)
27052722 Filter: (c1 = 1)
27062723 -> Tid Scan on t1 b2t1
27072724 TID Cond: (ctid = '(1,1)'::tid)
2725+ -> Seq Scan on t2 b2t2
2726+ Filter: (ctid = '(1,1)'::tid)
2727+ -> Tid Scan on t3 b2t3
2728+ TID Cond: (ctid = '(1,1)'::tid)
2729+ -> Tid Scan on t4 b2t4
2730+ TID Cond: (ctid = '(1,1)'::tid)
27082731
27092732 Aggregate
27102733 -> Nested Loop
27112734 Join Filter: (b3t1.c1 = b3t4.c1)
2712- -> Tid Scan on t4 b3t4
2713- TID Cond: (ctid = '(1,1)'::tid)
27142735 -> Nested Loop
27152736 Join Filter: (b3t1.c1 = b3t3.c1)
2716- -> Tid Scan on t3 b3t3
2717- TID Cond: (ctid = '(1,1)'::tid)
27182737 -> Nested Loop
27192738 Join Filter: (b3t1.c1 = b3t2.c1)
2720- -> Seq Scan on t2 b3t2
2721- Filter: (ctid = '(1,1)'::tid)
27222739 -> Nested Loop
27232740 -> Tid Scan on r3_
27242741 TID Cond: (ctid = '(1,1)'::tid)
27252742 Filter: (c1 = 1)
27262743 -> Tid Scan on t1 b3t1
27272744 TID Cond: (ctid = '(1,1)'::tid)
2745+ -> Seq Scan on t2 b3t2
2746+ Filter: (ctid = '(1,1)'::tid)
2747+ -> Tid Scan on t3 b3t3
2748+ TID Cond: (ctid = '(1,1)'::tid)
2749+ -> Tid Scan on t4 b3t4
2750+ TID Cond: (ctid = '(1,1)'::tid)
27282751 (59 rows)
27292752
27302753 /*+TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
@@ -2799,7 +2822,9 @@ error hint:
27992822 ------------------------------------------------------------------------------
28002823 Aggregate
28012824 -> Nested Loop
2825+ Join Filter: (b1t1.c1 = b1t4.c1)
28022826 -> Nested Loop
2827+ Join Filter: (b1t1.c1 = b1t3.c1)
28032828 -> Nested Loop
28042829 Join Filter: (b1t1.c1 = b1t2.c1)
28052830 -> Nested Loop
@@ -2810,56 +2835,60 @@ error hint:
28102835 -> Seq Scan on t2 b1t2
28112836 Filter: (ctid = '(1,1)'::tid)
28122837 -> Index Scan using t3_pkey on t3 b1t3
2813- Index Cond: (c1 = b1t1.c1)
2838+ Index Cond: (c1 = b1t2.c1)
28142839 Filter: (ctid = '(1,1)'::tid)
28152840 -> Bitmap Heap Scan on t4 b1t4
2816- Recheck Cond: (c1 = b1t1.c1)
2841+ Recheck Cond: (c1 = b1t2.c1)
28172842 Filter: (ctid = '(1,1)'::tid)
28182843 -> Bitmap Index Scan on t4_pkey
2819- Index Cond: (c1 = b1t1.c1)
2844+ Index Cond: (c1 = b1t2.c1)
28202845
28212846 Aggregate
28222847 -> Nested Loop
2848+ Join Filter: (b2t1.c1 = b2t4.c1)
28232849 -> Nested Loop
2824- Join Filter: (b2t1.c1 = b2t3.c1)
2850+ Join Filter: (b2t2.c1 = b2t1.c1)
28252851 -> Nested Loop
2852+ Join Filter: (b2t2.c1 = b2t3.c1)
28262853 -> Nested Loop
28272854 -> Seq Scan on r3_
28282855 Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
28292856 -> Tid Scan on t2 b2t2
28302857 TID Cond: (ctid = '(1,1)'::tid)
2831- -> Bitmap Heap Scan on t1 b2t1
2832- Recheck Cond: (c1 = b2t2.c1)
2858+ -> Seq Scan on t3 b2t3
28332859 Filter: (ctid = '(1,1)'::tid)
2834- -> Bitmap Index Scan on t1_pkey
2835- Index Cond: (c1 = b2t2.c1)
2836- -> Seq Scan on t3 b2t3
2860+ -> Bitmap Heap Scan on t1 b2t1
2861+ Recheck Cond: (c1 = b2t3.c1)
28372862 Filter: (ctid = '(1,1)'::tid)
2863+ -> Bitmap Index Scan on t1_pkey
2864+ Index Cond: (c1 = b2t3.c1)
28382865 -> Index Scan using t4_pkey on t4 b2t4
2839- Index Cond: (c1 = b2t1.c1)
2866+ Index Cond: (c1 = b2t2.c1)
28402867 Filter: (ctid = '(1,1)'::tid)
28412868
28422869 Aggregate
28432870 -> Nested Loop
2844- Join Filter: (b3t1.c1 = b3t4.c1)
2871+ Join Filter: (b3t1.c1 = b3t2.c1)
28452872 -> Nested Loop
2873+ Join Filter: (b3t3.c1 = b3t1.c1)
28462874 -> Nested Loop
2875+ Join Filter: (b3t3.c1 = b3t4.c1)
28472876 -> Nested Loop
28482877 -> Seq Scan on r3_
28492878 Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
28502879 -> Tid Scan on t3 b3t3
28512880 TID Cond: (ctid = '(1,1)'::tid)
2852- -> Index Scan using t1_pkey on t1 b3t1
2853- Index Cond: (c1 = b3t3.c1)
2881+ -> Seq Scan on t4 b3t4
28542882 Filter: (ctid = '(1,1)'::tid)
2855- -> Bitmap Heap Scan on t2 b3t2
2856- Recheck Cond: (c1 = b3t1.c1)
2883+ -> Index Scan using t1_pkey on t1 b3t1
2884+ Index Cond: (c1 = b3t4.c1)
28572885 Filter: (ctid = '(1,1)'::tid)
2858- -> Bitmap Index Scan on t2_pkey
2859- Index Cond: (c1 = b3t1.c1)
2860- -> Seq Scan on t4 b3t4
2886+ -> Bitmap Heap Scan on t2 b3t2
2887+ Recheck Cond: (c1 = b3t3.c1)
28612888 Filter: (ctid = '(1,1)'::tid)
2862-(62 rows)
2889+ -> Bitmap Index Scan on t2_pkey
2890+ Index Cond: (c1 = b3t3.c1)
2891+(68 rows)
28632892
28642893 -- No. S-2-3-4
28652894 EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
@@ -4605,13 +4634,12 @@ error hint:
46054634 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
46064635 QUERY PLAN
46074636 -----------------------------------------
4608- Hash Join
4609- Hash Cond: (t1.c1 = t2.c1)
4637+ Nested Loop
4638+ Join Filter: (t1.c1 = t2.c1)
46104639 -> Tid Scan on t1
46114640 TID Cond: (ctid = '(1,1)'::tid)
4612- -> Hash
4613- -> Seq Scan on t2
4614-(6 rows)
4641+ -> Seq Scan on t2
4642+(5 rows)
46154643
46164644 -- No. S-3-6-1
46174645 /*+SeqScan(t1)*/
--- /dev/null
+++ b/expected/ut-fdw.out~
@@ -0,0 +1,144 @@
1+LOAD 'pg_hint_plan';
2+SET search_path TO public;
3+SET pg_hint_plan.debug_print TO on;
4+SET client_min_messages TO LOG;
5+SET pg_hint_plan.enable_hint TO on;
6+CREATE EXTENSION file_fdw;
7+CREATE SERVER file_server FOREIGN DATA WRAPPER file_fdw;
8+CREATE USER MAPPING FOR PUBLIC SERVER file_server;
9+CREATE FOREIGN TABLE ft1 (id int, val int) SERVER file_server OPTIONS (format 'csv', filename '/home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv');
10+-- foreign table test
11+SELECT * FROM ft1;
12+ id | val
13+----+-----
14+ 1 | 1
15+ 2 | 2
16+ 3 | 3
17+ 4 | 4
18+ 5 | 5
19+ 6 | 6
20+ 7 | 7
21+ 8 | 8
22+ 9 | 9
23+ 10 | 10
24+(10 rows)
25+
26+\t
27+EXPLAIN (COSTS false) SELECT * FROM s1.t1, ft1 ft_1, ft1 ft_2 WHERE t1.c1 = ft_1.id AND t1.c1 = ft_2.id;
28+ Nested Loop
29+ Join Filter: (t1.c1 = ft_2.id)
30+ -> Nested Loop
31+ -> Foreign Scan on ft1 ft_1
32+ Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
33+ -> Index Scan using t1_i1 on t1
34+ Index Cond: (c1 = ft_1.id)
35+ -> Foreign Scan on ft1 ft_2
36+ Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
37+
38+----
39+---- No. S-1-5 object type for the hint
40+----
41+-- No. S-1-5-6
42+/*+SeqScan(t1)SeqScan(ft_1)SeqScan(ft_2)*/
43+EXPLAIN (COSTS false) SELECT * FROM s1.t1, ft1 ft_1, ft1 ft_2 WHERE t1.c1 = ft_1.id AND t1.c1 = ft_2.id;
44+LOG: pg_hint_plan:
45+used hint:
46+SeqScan(t1)
47+not used hint:
48+SeqScan(ft_1)
49+SeqScan(ft_2)
50+duplication hint:
51+error hint:
52+
53+ Nested Loop
54+ Join Filter: (t1.c1 = ft_2.id)
55+ -> Hash Join
56+ Hash Cond: (t1.c1 = ft_1.id)
57+ -> Seq Scan on t1
58+ -> Hash
59+ -> Foreign Scan on ft1 ft_1
60+ Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
61+ -> Foreign Scan on ft1 ft_2
62+ Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
63+
64+----
65+---- No. J-1-6 object type for the hint
66+----
67+-- No. J-1-6-6
68+/*+MergeJoin(ft_1 ft_2)Leading(ft_1 ft_2 t1)*/
69+EXPLAIN (COSTS false) SELECT * FROM s1.t1, ft1 ft_1, ft1 ft_2 WHERE t1.c1 = ft_1.id AND t1.c1 = ft_2.id;
70+LOG: pg_hint_plan:
71+used hint:
72+MergeJoin(ft_1 ft_2)
73+Leading(ft_1 ft_2 t1)
74+not used hint:
75+duplication hint:
76+error hint:
77+
78+ Nested Loop
79+ -> Merge Join
80+ Merge Cond: (ft_1.id = ft_2.id)
81+ -> Sort
82+ Sort Key: ft_1.id
83+ -> Foreign Scan on ft1 ft_1
84+ Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
85+ -> Sort
86+ Sort Key: ft_2.id
87+ -> Foreign Scan on ft1 ft_2
88+ Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
89+ -> Index Scan using t1_i1 on t1
90+ Index Cond: (c1 = ft_1.id)
91+
92+----
93+---- No. L-1-6 object type for the hint
94+----
95+-- No. L-1-6-6
96+/*+Leading(ft_1 ft_2 t1)*/
97+EXPLAIN (COSTS false) SELECT * FROM s1.t1, ft1 ft_1, ft1 ft_2 WHERE t1.c1 = ft_1.id AND t1.c1 = ft_2.id;
98+LOG: pg_hint_plan:
99+used hint:
100+Leading(ft_1 ft_2 t1)
101+not used hint:
102+duplication hint:
103+error hint:
104+
105+ Nested Loop
106+ -> Nested Loop
107+ Join Filter: (ft_1.id = ft_2.id)
108+ -> Foreign Scan on ft1 ft_1
109+ Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
110+ -> Foreign Scan on ft1 ft_2
111+ Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
112+ -> Index Scan using t1_i1 on t1
113+ Index Cond: (c1 = ft_1.id)
114+
115+----
116+---- No. R-1-6 object type for the hint
117+----
118+-- No. R-1-6-6
119+\o results/ut-fdw.tmpout
120+/*+Rows(ft_1 ft_2 #1)Leading(ft_1 ft_2 t1)*/
121+EXPLAIN SELECT * FROM s1.t1, ft1 ft_1, ft1 ft_2 WHERE t1.c1 = ft_1.id AND t1.c1 = ft_2.id;
122+LOG: pg_hint_plan:
123+used hint:
124+Leading(ft_1 ft_2 t1)
125+Rows(ft_1 ft_2 #1)
126+not used hint:
127+duplication hint:
128+error hint:
129+
130+\o
131+\! sql/maskout.sh results/ut-fdw.tmpout
132+ Nested Loop (cost=xxx rows=1 width=xxx)
133+ -> Nested Loop (cost=xxx rows=1 width=xxx)
134+ Join Filter: (ft_1.id = ft_2.id)
135+ -> Foreign Scan on ft1 ft_1 (cost=xxx rows=1 width=xxx)
136+ Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
137+ Foreign File Size: 42
138+ -> Foreign Scan on ft1 ft_2 (cost=xxx rows=1 width=xxx)
139+ Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
140+ Foreign File Size: 42
141+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=xxx)
142+ Index Cond: (c1 = ft_1.id)
143+
144+\! rm results/ut-fdw.tmpout
--- a/output/ut-fdw.source
+++ b/output/ut-fdw.source
@@ -26,14 +26,15 @@ SELECT * FROM ft1;
2626 \t
2727 EXPLAIN (COSTS false) SELECT * FROM s1.t1, ft1 ft_1, ft1 ft_2 WHERE t1.c1 = ft_1.id AND t1.c1 = ft_2.id;
2828 Nested Loop
29- Join Filter: (t1.c1 = ft_2.id)
29+ Join Filter: (ft_1.id = t1.c1)
3030 -> Nested Loop
31+ Join Filter: (ft_1.id = ft_2.id)
3132 -> Foreign Scan on ft1 ft_1
32- Foreign File: @abs_srcdir@/data/data.csv
33- -> Index Scan using t1_i1 on t1
34- Index Cond: (c1 = ft_1.id)
35- -> Foreign Scan on ft1 ft_2
36- Foreign File: @abs_srcdir@/data/data.csv
33+ Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
34+ -> Foreign Scan on ft1 ft_2
35+ Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
36+ -> Index Scan using t1_i1 on t1
37+ Index Cond: (c1 = ft_2.id)
3738
3839 ----
3940 ---- No. S-1-5 object type for the hint
@@ -76,6 +77,7 @@ duplication hint:
7677 error hint:
7778
7879 Nested Loop
80+ Join Filter: (ft_1.id = t1.c1)
7981 -> Merge Join
8082 Merge Cond: (ft_1.id = ft_2.id)
8183 -> Sort
@@ -87,7 +89,7 @@ error hint:
8789 -> Foreign Scan on ft1 ft_2
8890 Foreign File: @abs_srcdir@/data/data.csv
8991 -> Index Scan using t1_i1 on t1
90- Index Cond: (c1 = ft_1.id)
92+ Index Cond: (c1 = ft_2.id)
9193
9294 ----
9395 ---- No. L-1-6 object type for the hint
@@ -103,6 +105,7 @@ duplication hint:
103105 error hint:
104106
105107 Nested Loop
108+ Join Filter: (ft_1.id = t1.c1)
106109 -> Nested Loop
107110 Join Filter: (ft_1.id = ft_2.id)
108111 -> Foreign Scan on ft1 ft_1
@@ -110,7 +113,7 @@ error hint:
110113 -> Foreign Scan on ft1 ft_2
111114 Foreign File: @abs_srcdir@/data/data.csv
112115 -> Index Scan using t1_i1 on t1
113- Index Cond: (c1 = ft_1.id)
116+ Index Cond: (c1 = ft_2.id)
114117
115118 ----
116119 ---- No. R-1-6 object type for the hint
@@ -130,6 +133,7 @@ error hint:
130133 \o
131134 \! sql/maskout.sh results/ut-fdw.tmpout
132135 Nested Loop (cost=xxx rows=1 width=xxx)
136+ Join Filter: (ft_1.id = t1.c1)
133137 -> Nested Loop (cost=xxx rows=1 width=xxx)
134138 Join Filter: (ft_1.id = ft_2.id)
135139 -> Foreign Scan on ft1 ft_1 (cost=xxx rows=1 width=xxx)
@@ -139,6 +143,6 @@ error hint:
139143 Foreign File: @abs_srcdir@/data/data.csv
140144 Foreign File Size: 42
141145 -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=xxx)
142- Index Cond: (c1 = ft_1.id)
146+ Index Cond: (c1 = ft_2.id)
143147
144148 \! rm results/ut-fdw.tmpout
旧リポジトリブラウザで表示