OSDN Git Service

パラメータ名変更に伴いリグレッションテストを修正した。
[pghintplan/pg_hint_plan.git] / expected / ut-S-9.1.out
1 LOAD 'pg_hint_plan';
2 SET pg_hint_plan.enable_hint TO on;
3 SET pg_hint_plan.debug_print TO on;
4 SET client_min_messages TO LOG;
5 SET search_path TO public;
6 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
7      QUERY PLAN      
8 ---------------------
9  Seq Scan on t1
10    Filter: (c1 >= 1)
11 (2 rows)
12
13 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
14           QUERY PLAN          
15 ------------------------------
16  Index Scan using t1_i1 on t1
17    Index Cond: (c1 = 1)
18 (2 rows)
19
20 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
21            QUERY PLAN            
22 ---------------------------------
23  Bitmap Heap Scan on t1
24    Recheck Cond: (c3 < 10)
25    ->  Bitmap Index Scan on t1_i
26          Index Cond: (c3 < 10)
27 (4 rows)
28
29 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
30             QUERY PLAN             
31 -----------------------------------
32  Tid Scan on t1
33    TID Cond: (ctid = '(1,1)'::tid)
34    Filter: (c1 = 1)
35 (3 rows)
36
37 ----
38 ---- No. S-1-1 specified pattern of the object name
39 ----
40 -- No. S-1-1-1
41 /*+SeqScan(t1)*/
42 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
43 LOG:  pg_hint_plan:
44 used hint:
45 SeqScan(t1)
46 not used hint:
47 duplication hint:
48 error hint:
49
50      QUERY PLAN     
51 --------------------
52  Seq Scan on t1
53    Filter: (c1 = 1)
54 (2 rows)
55
56 -- No. S-1-1-2
57 /*+SeqScan(t1)*/
58 EXPLAIN (COSTS false) SELECT * FROM s1.t1 t_1 WHERE t_1.c1 = 1;
59 LOG:  pg_hint_plan:
60 used hint:
61 not used hint:
62 SeqScan(t1)
63 duplication hint:
64 error hint:
65
66             QUERY PLAN            
67 ----------------------------------
68  Index Scan using t1_i1 on t1 t_1
69    Index Cond: (c1 = 1)
70 (2 rows)
71
72 -- No. S-1-1-3
73 /*+SeqScan(t_1)*/
74 EXPLAIN (COSTS false) SELECT * FROM s1.t1 t_1 WHERE t_1.c1 = 1;
75 LOG:  pg_hint_plan:
76 used hint:
77 SeqScan(t_1)
78 not used hint:
79 duplication hint:
80 error hint:
81
82      QUERY PLAN     
83 --------------------
84  Seq Scan on t1 t_1
85    Filter: (c1 = 1)
86 (2 rows)
87
88 ----
89 ---- No. S-1-2 specified schema name in the hint option
90 ----
91 -- No. S-1-2-1
92 /*+SeqScan(t1)*/
93 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
94 LOG:  pg_hint_plan:
95 used hint:
96 SeqScan(t1)
97 not used hint:
98 duplication hint:
99 error hint:
100
101      QUERY PLAN     
102 --------------------
103  Seq Scan on t1
104    Filter: (c1 = 1)
105 (2 rows)
106
107 -- No. S-1-2-2
108 /*+SeqScan(s1.t1)*/
109 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
110 LOG:  pg_hint_plan:
111 used hint:
112 not used hint:
113 SeqScan(s1.t1)
114 duplication hint:
115 error hint:
116
117           QUERY PLAN          
118 ------------------------------
119  Index Scan using t1_i1 on t1
120    Index Cond: (c1 = 1)
121 (2 rows)
122
123 ----
124 ---- No. S-1-3 table doesn't exist in the hint option
125 ----
126 -- No. S-1-3-1
127 /*+SeqScan(t1)*/
128 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
129 LOG:  pg_hint_plan:
130 used hint:
131 SeqScan(t1)
132 not used hint:
133 duplication hint:
134 error hint:
135
136      QUERY PLAN     
137 --------------------
138  Seq Scan on t1
139    Filter: (c1 = 1)
140 (2 rows)
141
142 -- No. S-1-3-2
143 /*+SeqScan(t2)*/
144 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
145 LOG:  pg_hint_plan:
146 used hint:
147 not used hint:
148 SeqScan(t2)
149 duplication hint:
150 error hint:
151
152           QUERY PLAN          
153 ------------------------------
154  Index Scan using t1_i1 on t1
155    Index Cond: (c1 = 1)
156 (2 rows)
157
158 ----
159 ---- No. S-1-4 conflict table name
160 ----
161 -- No. S-1-4-1
162 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = 1 AND t1.c1 = t2.c1;
163              QUERY PLAN             
164 ------------------------------------
165  Nested Loop
166    ->  Index Scan using t1_i1 on t1
167          Index Cond: (c1 = 1)
168    ->  Seq Scan on t2
169          Filter: (c1 = 1)
170 (5 rows)
171
172 /*+SeqScan(t1)*/
173 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = 1 AND t1.c1 = t2.c1;
174 LOG:  pg_hint_plan:
175 used hint:
176 SeqScan(t1)
177 not used hint:
178 duplication hint:
179 error hint:
180
181         QUERY PLAN        
182 --------------------------
183  Nested Loop
184    ->  Seq Scan on t1
185          Filter: (c1 = 1)
186    ->  Seq Scan on t2
187          Filter: (c1 = 1)
188 (5 rows)
189
190 -- No. S-1-4-2
191 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = 1 AND s1.t1.c1 = s2.t1.c1;
192              QUERY PLAN             
193 ------------------------------------
194  Nested Loop
195    ->  Index Scan using t1_i1 on t1
196          Index Cond: (c1 = 1)
197    ->  Seq Scan on t1
198          Filter: (c1 = 1)
199 (5 rows)
200
201 /*+BitmapScan(t1)*/
202 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = 1 AND s1.t1.c1 = s2.t1.c1;
203 LOG:  pg_hint_plan:
204 used hint:
205 BitmapScan(t1)
206 not used hint:
207 duplication hint:
208 error hint:
209
210                 QUERY PLAN                
211 ------------------------------------------
212  Nested Loop
213    ->  Bitmap Heap Scan on t1
214          Recheck Cond: (c1 = 1)
215          ->  Bitmap Index Scan on t1_i1
216                Index Cond: (c1 = 1)
217    ->  Bitmap Heap Scan on t1
218          Recheck Cond: (c1 = 1)
219          ->  Bitmap Index Scan on t1_pkey
220                Index Cond: (c1 = 1)
221 (9 rows)
222
223 /*+BitmapScan(t1)*/
224 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = 1 AND s1.t1.c1 = s2t1.c1;
225 LOG:  pg_hint_plan:
226 used hint:
227 BitmapScan(t1)
228 not used hint:
229 duplication hint:
230 error hint:
231
232                QUERY PLAN               
233 ----------------------------------------
234  Nested Loop
235    ->  Bitmap Heap Scan on t1
236          Recheck Cond: (c1 = 1)
237          ->  Bitmap Index Scan on t1_i1
238                Index Cond: (c1 = 1)
239    ->  Seq Scan on t1 s2t1
240          Filter: (c1 = 1)
241 (7 rows)
242
243 /*+BitmapScan(s2t1)*/
244 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = 1 AND s1.t1.c1 = s2t1.c1;
245 LOG:  pg_hint_plan:
246 used hint:
247 BitmapScan(s2t1)
248 not used hint:
249 duplication hint:
250 error hint:
251
252                 QUERY PLAN                
253 ------------------------------------------
254  Nested Loop
255    ->  Index Scan using t1_i1 on t1
256          Index Cond: (c1 = 1)
257    ->  Bitmap Heap Scan on t1 s2t1
258          Recheck Cond: (c1 = 1)
259          ->  Bitmap Index Scan on t1_pkey
260                Index Cond: (c1 = 1)
261 (7 rows)
262
263 -- No. S-1-4-3
264 EXPLAIN (COSTS false) SELECT (SELECT max(c1) FROM s1.t1 WHERE s1.t1.c1 = 1) FROM s1.t1 WHERE s1.t1.c1 = 1;
265                              QUERY PLAN                              
266 ---------------------------------------------------------------------
267  Index Scan using t1_i1 on t1
268    Index Cond: (c1 = 1)
269    InitPlan 2 (returns $1)
270      ->  Result
271            InitPlan 1 (returns $0)
272              ->  Limit
273                    ->  Index Scan using t1_i1 on t1
274                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
275 (8 rows)
276
277 /*+BitmapScan(t1)*/
278 EXPLAIN (COSTS false) SELECT (SELECT max(c1) FROM s1.t1 WHERE s1.t1.c1 = 1) FROM s1.t1 WHERE s1.t1.c1 = 1;
279 LOG:  pg_hint_plan:
280 used hint:
281 BitmapScan(t1)
282 not used hint:
283 duplication hint:
284 error hint:
285
286                                 QUERY PLAN                                 
287 ---------------------------------------------------------------------------
288  Bitmap Heap Scan on t1
289    Recheck Cond: (c1 = 1)
290    InitPlan 2 (returns $1)
291      ->  Result
292            InitPlan 1 (returns $0)
293              ->  Limit
294                    ->  Bitmap Heap Scan on t1
295                          Recheck Cond: ((c1 IS NOT NULL) AND (c1 = 1))
296                          ->  Bitmap Index Scan on t1_i1
297                                Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
298    ->  Bitmap Index Scan on t1_i1
299          Index Cond: (c1 = 1)
300 (12 rows)
301
302 /*+BitmapScan(t11)*/
303 EXPLAIN (COSTS false) SELECT (SELECT max(c1) FROM s1.t1 t11 WHERE t11.c1 = 1) FROM s1.t1 t12 WHERE t12.c1 = 1;
304 LOG:  pg_hint_plan:
305 used hint:
306 BitmapScan(t11)
307 not used hint:
308 duplication hint:
309 error hint:
310
311                                 QUERY PLAN                                 
312 ---------------------------------------------------------------------------
313  Index Scan using t1_i1 on t1 t12
314    Index Cond: (c1 = 1)
315    InitPlan 2 (returns $1)
316      ->  Result
317            InitPlan 1 (returns $0)
318              ->  Limit
319                    ->  Bitmap Heap Scan on t1 t11
320                          Recheck Cond: ((c1 IS NOT NULL) AND (c1 = 1))
321                          ->  Bitmap Index Scan on t1_i1
322                                Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
323 (10 rows)
324
325 /*+BitmapScan(t12)*/
326 EXPLAIN (COSTS false) SELECT (SELECT max(c1) FROM s1.t1 t11 WHERE t11.c1 = 1) FROM s1.t1 t12 WHERE t12.c1 = 1;
327 LOG:  pg_hint_plan:
328 used hint:
329 BitmapScan(t12)
330 not used hint:
331 duplication hint:
332 error hint:
333
334                              QUERY PLAN                              
335 ---------------------------------------------------------------------
336  Bitmap Heap Scan on t1 t12
337    Recheck Cond: (c1 = 1)
338    InitPlan 2 (returns $1)
339      ->  Result
340            InitPlan 1 (returns $0)
341              ->  Limit
342                    ->  Index Scan using t1_i1 on t1 t11
343                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
344    ->  Bitmap Index Scan on t1_i1
345          Index Cond: (c1 = 1)
346 (10 rows)
347
348 ----
349 ---- No. S-1-5 object type for the hint
350 ----
351 -- No. S-1-5-1
352 /*+SeqScan(t1)*/
353 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
354 LOG:  pg_hint_plan:
355 used hint:
356 SeqScan(t1)
357 not used hint:
358 duplication hint:
359 error hint:
360
361      QUERY PLAN     
362 --------------------
363  Seq Scan on t1
364    Filter: (c1 = 1)
365 (2 rows)
366
367 -- No. S-1-5-2
368 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE p1.c1 = 1;
369            QUERY PLAN            
370 ---------------------------------
371  Result
372    ->  Append
373          ->  Seq Scan on p1
374                Filter: (c1 = 1)
375          ->  Seq Scan on p1c1 p1
376                Filter: (c1 = 1)
377 (6 rows)
378
379 /*+IndexScan(p1)*/
380 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE p1.c1 = 1;
381 LOG:  pg_hint_plan:
382 used hint:
383 IndexScan(p1)
384 not used hint:
385 duplication hint:
386 error hint:
387
388                    QUERY PLAN                   
389 ------------------------------------------------
390  Result
391    ->  Append
392          ->  Index Scan using p1_i on p1
393                Index Cond: (c1 = 1)
394          ->  Index Scan using p1c1_i on p1c1 p1
395                Index Cond: (c1 = 1)
396 (6 rows)
397
398 -- No. S-1-5-3
399 EXPLAIN (COSTS false) SELECT * FROM s1.ul1 WHERE ul1.c1 = 1;
400             QUERY PLAN            
401 ----------------------------------
402  Index Scan using ul1_pkey on ul1
403    Index Cond: (c1 = 1)
404 (2 rows)
405
406 /*+SeqScan(ul1)*/
407 EXPLAIN (COSTS false) SELECT * FROM s1.ul1 WHERE ul1.c1 = 1;
408 LOG:  pg_hint_plan:
409 used hint:
410 SeqScan(ul1)
411 not used hint:
412 duplication hint:
413 error hint:
414
415      QUERY PLAN     
416 --------------------
417  Seq Scan on ul1
418    Filter: (c1 = 1)
419 (2 rows)
420
421 -- No. S-1-5-4
422 CREATE TEMP TABLE tm1 (LIKE s1.t1 INCLUDING ALL);
423 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "tm1_pkey" for table "tm1"
424 EXPLAIN (COSTS false) SELECT * FROM tm1 WHERE tm1.c1 = 1;
425             QUERY PLAN            
426 ----------------------------------
427  Index Scan using tm1_pkey on tm1
428    Index Cond: (c1 = 1)
429 (2 rows)
430
431 /*+SeqScan(tm1)*/
432 EXPLAIN (COSTS false) SELECT * FROM tm1 WHERE tm1.c1 = 1;
433 LOG:  pg_hint_plan:
434 used hint:
435 SeqScan(tm1)
436 not used hint:
437 duplication hint:
438 error hint:
439
440      QUERY PLAN     
441 --------------------
442  Seq Scan on tm1
443    Filter: (c1 = 1)
444 (2 rows)
445
446 -- No. S-1-5-5
447 EXPLAIN (COSTS false) SELECT * FROM pg_catalog.pg_class WHERE oid = 1;
448                    QUERY PLAN                    
449 -------------------------------------------------
450  Index Scan using pg_class_oid_index on pg_class
451    Index Cond: (oid = 1::oid)
452 (2 rows)
453
454 /*+SeqScan(pg_class)*/
455 EXPLAIN (COSTS false) SELECT * FROM pg_catalog.pg_class WHERE oid = 1;
456 LOG:  pg_hint_plan:
457 used hint:
458 SeqScan(pg_class)
459 not used hint:
460 duplication hint:
461 error hint:
462
463         QUERY PLAN        
464 --------------------------
465  Seq Scan on pg_class
466    Filter: (oid = 1::oid)
467 (2 rows)
468
469 -- No. S-1-5-6
470 -- refer fdw.sql
471 -- No. S-1-5-7
472 EXPLAIN (COSTS false) SELECT * FROM s1.f1() AS ft1 WHERE ft1.c1 = 1;
473        QUERY PLAN        
474 -------------------------
475  Function Scan on f1 ft1
476    Filter: (c1 = 1)
477 (2 rows)
478
479 /*+SeqScan(ft1)*/
480 EXPLAIN (COSTS false) SELECT * FROM s1.f1() AS ft1 WHERE ft1.c1 = 1;
481 LOG:  pg_hint_plan:
482 used hint:
483 not used hint:
484 SeqScan(ft1)
485 duplication hint:
486 error hint:
487
488        QUERY PLAN        
489 -------------------------
490  Function Scan on f1 ft1
491    Filter: (c1 = 1)
492 (2 rows)
493
494 -- No. S-1-5-8
495 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS val1 (c1, c2, c3, c4) WHERE val1.c1 = 1;
496         QUERY PLAN         
497 ---------------------------
498  Values Scan on "*VALUES*"
499    Filter: (column1 = 1)
500 (2 rows)
501
502 /*+SeqScan(val1)*/
503 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS val1 (c1, c2, c3, c4) WHERE val1.c1 = 1;
504 LOG:  pg_hint_plan:
505 used hint:
506 not used hint:
507 SeqScan(val1)
508 duplication hint:
509 error hint:
510
511         QUERY PLAN         
512 ---------------------------
513  Values Scan on "*VALUES*"
514    Filter: (column1 = 1)
515 (2 rows)
516
517 /*+SeqScan(*VALUES*)*/
518 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS val1 (c1, c2, c3, c4) WHERE val1.c1 = 1;
519 LOG:  pg_hint_plan:
520 used hint:
521 not used hint:
522 SeqScan(*VALUES*)
523 duplication hint:
524 error hint:
525
526         QUERY PLAN         
527 ---------------------------
528  Values Scan on "*VALUES*"
529    Filter: (column1 = 1)
530 (2 rows)
531
532 -- No. S-1-5-9
533 EXPLAIN (COSTS false) WITH c1(c1) AS (SELECT max(c1) FROM s1.t1 WHERE t1.c1 = 1)
534 SELECT * FROM s1.t1, c1 WHERE t1.c1 = 1 AND t1.c1 = c1.c1;
535                              QUERY PLAN                              
536 ---------------------------------------------------------------------
537  Nested Loop
538    CTE c1
539      ->  Result
540            InitPlan 1 (returns $0)
541              ->  Limit
542                    ->  Index Scan using t1_i1 on t1
543                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
544    ->  Index Scan using t1_i1 on t1
545          Index Cond: (c1 = 1)
546    ->  CTE Scan on c1
547          Filter: (c1 = 1)
548 (11 rows)
549
550 /*+SeqScan(c1)*/
551 EXPLAIN (COSTS false) WITH c1(c1) AS (SELECT max(c1) FROM s1.t1 WHERE t1.c1 = 1)
552 SELECT * FROM s1.t1, c1 WHERE t1.c1 = 1 AND t1.c1 = c1.c1;
553 LOG:  pg_hint_plan:
554 used hint:
555 not used hint:
556 SeqScan(c1)
557 duplication hint:
558 error hint:
559
560                              QUERY PLAN                              
561 ---------------------------------------------------------------------
562  Nested Loop
563    CTE c1
564      ->  Result
565            InitPlan 1 (returns $0)
566              ->  Limit
567                    ->  Index Scan using t1_i1 on t1
568                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
569    ->  Index Scan using t1_i1 on t1
570          Index Cond: (c1 = 1)
571    ->  CTE Scan on c1
572          Filter: (c1 = 1)
573 (11 rows)
574
575 -- No. S-1-5-10
576 EXPLAIN (COSTS false) SELECT * FROM s1.v1 WHERE v1.c1 = 1;
577             QUERY PLAN             
578 -----------------------------------
579  Index Scan using t1_i1 on t1 v1t1
580    Index Cond: (c1 = 1)
581 (2 rows)
582
583 /*+SeqScan(v1)*/
584 EXPLAIN (COSTS false) SELECT * FROM s1.v1 WHERE v1.c1 = 1;
585 LOG:  pg_hint_plan:
586 used hint:
587 not used hint:
588 SeqScan(v1)
589 duplication hint:
590 error hint:
591
592             QUERY PLAN             
593 -----------------------------------
594  Index Scan using t1_i1 on t1 v1t1
595    Index Cond: (c1 = 1)
596 (2 rows)
597
598 -- No. S-1-5-11
599 EXPLAIN (COSTS false) SELECT * FROM (SELECT * FROM s1.t1 WHERE t1.c1 = 1) AS s1 WHERE s1.c1 = 1;
600           QUERY PLAN          
601 ------------------------------
602  Index Scan using t1_i1 on t1
603    Index Cond: (c1 = 1)
604 (2 rows)
605
606 /*+SeqScan(s1)*/
607 EXPLAIN (COSTS false) SELECT * FROM (SELECT * FROM s1.t1 WHERE t1.c1 = 1) AS s1 WHERE s1.c1 = 1;
608 LOG:  pg_hint_plan:
609 used hint:
610 not used hint:
611 SeqScan(s1)
612 duplication hint:
613 error hint:
614
615           QUERY PLAN          
616 ------------------------------
617  Index Scan using t1_i1 on t1
618    Index Cond: (c1 = 1)
619 (2 rows)
620
621 ----
622 ---- No. S-2-1 complexity query block
623 ----
624 -- No. S-2-1-1
625 EXPLAIN (COSTS false)
626 SELECT max(bmt1.c1), (
627 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
628 )
629                     FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
630 ;
631                             QUERY PLAN                             
632 -------------------------------------------------------------------
633  Aggregate
634    InitPlan 1 (returns $0)
635      ->  Aggregate
636            ->  Merge Join
637                  Merge Cond: (b1t1.c1 = b1t2.c1)
638                  ->  Merge Join
639                        Merge Cond: (b1t1.c1 = b1t4.c1)
640                        ->  Merge Join
641                              Merge Cond: (b1t1.c1 = b1t3.c1)
642                              ->  Index Scan using t1_i1 on t1 b1t1
643                              ->  Index Scan using t3_i1 on t3 b1t3
644                        ->  Index Scan using t4_i1 on t4 b1t4
645                  ->  Sort
646                        Sort Key: b1t2.c1
647                        ->  Seq Scan on t2 b1t2
648    ->  Merge Join
649          Merge Cond: (bmt1.c1 = bmt2.c1)
650          ->  Merge Join
651                Merge Cond: (bmt1.c1 = bmt4.c1)
652                ->  Merge Join
653                      Merge Cond: (bmt1.c1 = bmt3.c1)
654                      ->  Index Scan using t1_i1 on t1 bmt1
655                      ->  Index Scan using t3_i1 on t3 bmt3
656                ->  Index Scan using t4_i1 on t4 bmt4
657          ->  Sort
658                Sort Key: bmt2.c1
659                ->  Seq Scan on t2 bmt2
660 (27 rows)
661
662 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
663 TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
664 */
665 EXPLAIN (COSTS false)
666 SELECT max(bmt1.c1), (
667 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
668 )
669                     FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
670 ;
671 LOG:  pg_hint_plan:
672 used hint:
673 TidScan(b1t1)
674 SeqScan(b1t2)
675 IndexScan(b1t3 t3_pkey)
676 BitmapScan(b1t4 t4_pkey)
677 SeqScan(bmt1)
678 IndexScan(bmt2 t2_pkey)
679 BitmapScan(bmt3 t3_pkey)
680 TidScan(bmt4)
681 not used hint:
682 duplication hint:
683 error hint:
684
685                                QUERY PLAN                                
686 -------------------------------------------------------------------------
687  Aggregate
688    InitPlan 1 (returns $1)
689      ->  Aggregate
690            ->  Merge Join
691                  Merge Cond: (b1t1.c1 = b1t2.c1)
692                  ->  Nested Loop
693                        ->  Merge Join
694                              Merge Cond: (b1t1.c1 = b1t3.c1)
695                              ->  Sort
696                                    Sort Key: b1t1.c1
697                                    ->  Seq Scan on t1 b1t1
698                              ->  Index Scan using t3_pkey on t3 b1t3
699                        ->  Bitmap Heap Scan on t4 b1t4
700                              Recheck Cond: (c1 = b1t1.c1)
701                              ->  Bitmap Index Scan on t4_pkey
702                                    Index Cond: (c1 = b1t1.c1)
703                  ->  Sort
704                        Sort Key: b1t2.c1
705                        ->  Seq Scan on t2 b1t2
706    ->  Hash Join
707          Hash Cond: (bmt4.c1 = bmt1.c1)
708          ->  Seq Scan on t4 bmt4
709          ->  Hash
710                ->  Nested Loop
711                      ->  Hash Join
712                            Hash Cond: (bmt1.c1 = bmt2.c1)
713                            ->  Seq Scan on t1 bmt1
714                            ->  Hash
715                                  ->  Index Scan using t2_pkey on t2 bmt2
716                      ->  Bitmap Heap Scan on t3 bmt3
717                            Recheck Cond: (c1 = bmt1.c1)
718                            ->  Bitmap Index Scan on t3_pkey
719                                  Index Cond: (c1 = bmt1.c1)
720 (33 rows)
721
722 -- No. S-2-1-2
723 EXPLAIN (COSTS false)
724 SELECT max(bmt1.c1), (
725 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
726 ), (
727 SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.c1 = b2t2.c1 AND b2t1.c1 = b2t3.c1 AND b2t1.c1 = b2t4.c1
728 )
729                     FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
730 ;
731                             QUERY PLAN                             
732 -------------------------------------------------------------------
733  Aggregate
734    InitPlan 1 (returns $0)
735      ->  Aggregate
736            ->  Merge Join
737                  Merge Cond: (b1t1.c1 = b1t2.c1)
738                  ->  Merge Join
739                        Merge Cond: (b1t1.c1 = b1t4.c1)
740                        ->  Merge Join
741                              Merge Cond: (b1t1.c1 = b1t3.c1)
742                              ->  Index Scan using t1_i1 on t1 b1t1
743                              ->  Index Scan using t3_i1 on t3 b1t3
744                        ->  Index Scan using t4_i1 on t4 b1t4
745                  ->  Sort
746                        Sort Key: b1t2.c1
747                        ->  Seq Scan on t2 b1t2
748    InitPlan 2 (returns $1)
749      ->  Aggregate
750            ->  Merge Join
751                  Merge Cond: (b2t1.c1 = b2t2.c1)
752                  ->  Merge Join
753                        Merge Cond: (b2t1.c1 = b2t4.c1)
754                        ->  Merge Join
755                              Merge Cond: (b2t1.c1 = b2t3.c1)
756                              ->  Index Scan using t1_i1 on t1 b2t1
757                              ->  Index Scan using t3_i1 on t3 b2t3
758                        ->  Index Scan using t4_i1 on t4 b2t4
759                  ->  Sort
760                        Sort Key: b2t2.c1
761                        ->  Seq Scan on t2 b2t2
762    ->  Merge Join
763          Merge Cond: (bmt1.c1 = bmt2.c1)
764          ->  Merge Join
765                Merge Cond: (bmt1.c1 = bmt4.c1)
766                ->  Merge Join
767                      Merge Cond: (bmt1.c1 = bmt3.c1)
768                      ->  Index Scan using t1_i1 on t1 bmt1
769                      ->  Index Scan using t3_i1 on t3 bmt3
770                ->  Index Scan using t4_i1 on t4 bmt4
771          ->  Sort
772                Sort Key: bmt2.c1
773                ->  Seq Scan on t2 bmt2
774 (41 rows)
775
776 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
777 TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
778 BitmapScan(b2t1 t1_pkey)TidScan(b2t2)SeqScan(b2t3)IndexScan(b2t4 t4_pkey)
779 */
780 EXPLAIN (COSTS false)
781 SELECT max(bmt1.c1), (
782 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
783 ), (
784 SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.c1 = b2t2.c1 AND b2t1.c1 = b2t3.c1 AND b2t1.c1 = b2t4.c1
785 )
786                     FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
787 ;
788 LOG:  pg_hint_plan:
789 used hint:
790 TidScan(b1t1)
791 SeqScan(b1t2)
792 IndexScan(b1t3 t3_pkey)
793 BitmapScan(b1t4 t4_pkey)
794 BitmapScan(b2t1 t1_pkey)
795 TidScan(b2t2)
796 SeqScan(b2t3)
797 IndexScan(b2t4 t4_pkey)
798 SeqScan(bmt1)
799 IndexScan(bmt2 t2_pkey)
800 BitmapScan(bmt3 t3_pkey)
801 TidScan(bmt4)
802 not used hint:
803 duplication hint:
804 error hint:
805
806                                 QUERY PLAN                                 
807 ---------------------------------------------------------------------------
808  Aggregate
809    InitPlan 1 (returns $1)
810      ->  Aggregate
811            ->  Merge Join
812                  Merge Cond: (b1t1.c1 = b1t2.c1)
813                  ->  Nested Loop
814                        ->  Merge Join
815                              Merge Cond: (b1t1.c1 = b1t3.c1)
816                              ->  Sort
817                                    Sort Key: b1t1.c1
818                                    ->  Seq Scan on t1 b1t1
819                              ->  Index Scan using t3_pkey on t3 b1t3
820                        ->  Bitmap Heap Scan on t4 b1t4
821                              Recheck Cond: (c1 = b1t1.c1)
822                              ->  Bitmap Index Scan on t4_pkey
823                                    Index Cond: (c1 = b1t1.c1)
824                  ->  Sort
825                        Sort Key: b1t2.c1
826                        ->  Seq Scan on t2 b1t2
827    InitPlan 2 (returns $3)
828      ->  Aggregate
829            ->  Hash Join
830                  Hash Cond: (b2t3.c1 = b2t1.c1)
831                  ->  Seq Scan on t3 b2t3
832                  ->  Hash
833                        ->  Merge Join
834                              Merge Cond: (b2t1.c1 = b2t2.c1)
835                              ->  Nested Loop
836                                    ->  Index Scan using t4_pkey on t4 b2t4
837                                    ->  Bitmap Heap Scan on t1 b2t1
838                                          Recheck Cond: (c1 = b2t4.c1)
839                                          ->  Bitmap Index Scan on t1_pkey
840                                                Index Cond: (c1 = b2t4.c1)
841                              ->  Sort
842                                    Sort Key: b2t2.c1
843                                    ->  Seq Scan on t2 b2t2
844    ->  Hash Join
845          Hash Cond: (bmt4.c1 = bmt1.c1)
846          ->  Seq Scan on t4 bmt4
847          ->  Hash
848                ->  Nested Loop
849                      ->  Hash Join
850                            Hash Cond: (bmt1.c1 = bmt2.c1)
851                            ->  Seq Scan on t1 bmt1
852                            ->  Hash
853                                  ->  Index Scan using t2_pkey on t2 bmt2
854                      ->  Bitmap Heap Scan on t3 bmt3
855                            Recheck Cond: (c1 = bmt1.c1)
856                            ->  Bitmap Index Scan on t3_pkey
857                                  Index Cond: (c1 = bmt1.c1)
858 (50 rows)
859
860 -- No. S-2-1-3
861 EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, (SELECT * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = sbmt4.c1;
862                         QUERY PLAN                         
863 -----------------------------------------------------------
864  Aggregate
865    ->  Merge Join
866          Merge Cond: (bmt1.c1 = bmt2.c1)
867          ->  Merge Join
868                Merge Cond: (bmt1.c1 = bmt4.c1)
869                ->  Merge Join
870                      Merge Cond: (bmt1.c1 = bmt3.c1)
871                      ->  Index Scan using t1_i1 on t1 bmt1
872                      ->  Index Scan using t3_i1 on t3 bmt3
873                ->  Index Scan using t4_i1 on t4 bmt4
874          ->  Sort
875                Sort Key: bmt2.c1
876                ->  Seq Scan on t2 bmt2
877 (13 rows)
878
879 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
880 */
881 EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, (SELECT * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = sbmt4.c1;
882 LOG:  pg_hint_plan:
883 used hint:
884 SeqScan(bmt1)
885 IndexScan(bmt2 t2_pkey)
886 BitmapScan(bmt3 t3_pkey)
887 TidScan(bmt4)
888 not used hint:
889 duplication hint:
890 error hint:
891
892                                QUERY PLAN                                
893 -------------------------------------------------------------------------
894  Aggregate
895    ->  Hash Join
896          Hash Cond: (bmt4.c1 = bmt1.c1)
897          ->  Seq Scan on t4 bmt4
898          ->  Hash
899                ->  Nested Loop
900                      ->  Hash Join
901                            Hash Cond: (bmt1.c1 = bmt2.c1)
902                            ->  Seq Scan on t1 bmt1
903                            ->  Hash
904                                  ->  Index Scan using t2_pkey on t2 bmt2
905                      ->  Bitmap Heap Scan on t3 bmt3
906                            Recheck Cond: (c1 = bmt1.c1)
907                            ->  Bitmap Index Scan on t3_pkey
908                                  Index Cond: (c1 = bmt1.c1)
909 (15 rows)
910
911 -- No. S-2-1-4
912 EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, (SELECT * FROM s1.t3 bmt3) sbmt3, (SELECT * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = sbmt3.c1 AND bmt1.c1 = sbmt4.c1;
913                         QUERY PLAN                         
914 -----------------------------------------------------------
915  Aggregate
916    ->  Merge Join
917          Merge Cond: (bmt1.c1 = bmt2.c1)
918          ->  Merge Join
919                Merge Cond: (bmt1.c1 = bmt4.c1)
920                ->  Merge Join
921                      Merge Cond: (bmt1.c1 = bmt3.c1)
922                      ->  Index Scan using t1_i1 on t1 bmt1
923                      ->  Index Scan using t3_i1 on t3 bmt3
924                ->  Index Scan using t4_i1 on t4 bmt4
925          ->  Sort
926                Sort Key: bmt2.c1
927                ->  Seq Scan on t2 bmt2
928 (13 rows)
929
930 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
931 */
932 EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, (SELECT * FROM s1.t3 bmt3) sbmt3, (SELECT * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = sbmt3.c1 AND bmt1.c1 = sbmt4.c1;
933 LOG:  pg_hint_plan:
934 used hint:
935 SeqScan(bmt1)
936 IndexScan(bmt2 t2_pkey)
937 BitmapScan(bmt3 t3_pkey)
938 TidScan(bmt4)
939 not used hint:
940 duplication hint:
941 error hint:
942
943                                QUERY PLAN                                
944 -------------------------------------------------------------------------
945  Aggregate
946    ->  Hash Join
947          Hash Cond: (bmt4.c1 = bmt1.c1)
948          ->  Seq Scan on t4 bmt4
949          ->  Hash
950                ->  Nested Loop
951                      ->  Hash Join
952                            Hash Cond: (bmt1.c1 = bmt2.c1)
953                            ->  Seq Scan on t1 bmt1
954                            ->  Hash
955                                  ->  Index Scan using t2_pkey on t2 bmt2
956                      ->  Bitmap Heap Scan on t3 bmt3
957                            Recheck Cond: (c1 = bmt1.c1)
958                            ->  Bitmap Index Scan on t3_pkey
959                                  Index Cond: (c1 = bmt1.c1)
960 (15 rows)
961
962 -- No. S-2-1-5
963 EXPLAIN (COSTS false)
964 SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
965   AND bmt1.c1 <> (
966 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
967 )
968 ;
969                             QUERY PLAN                             
970 -------------------------------------------------------------------
971  Aggregate
972    InitPlan 1 (returns $0)
973      ->  Aggregate
974            ->  Merge Join
975                  Merge Cond: (b1t1.c1 = b1t2.c1)
976                  ->  Merge Join
977                        Merge Cond: (b1t1.c1 = b1t4.c1)
978                        ->  Merge Join
979                              Merge Cond: (b1t1.c1 = b1t3.c1)
980                              ->  Index Scan using t1_i1 on t1 b1t1
981                              ->  Index Scan using t3_i1 on t3 b1t3
982                        ->  Index Scan using t4_i1 on t4 b1t4
983                  ->  Sort
984                        Sort Key: b1t2.c1
985                        ->  Seq Scan on t2 b1t2
986    ->  Merge Join
987          Merge Cond: (bmt1.c1 = bmt2.c1)
988          ->  Merge Join
989                Merge Cond: (bmt1.c1 = bmt4.c1)
990                ->  Merge Join
991                      Merge Cond: (bmt1.c1 = bmt3.c1)
992                      ->  Index Scan using t1_i1 on t1 bmt1
993                            Filter: (c1 <> $0)
994                      ->  Index Scan using t3_i1 on t3 bmt3
995                ->  Index Scan using t4_i1 on t4 bmt4
996          ->  Sort
997                Sort Key: bmt2.c1
998                ->  Seq Scan on t2 bmt2
999 (28 rows)
1000
1001 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
1002 TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
1003 */
1004 EXPLAIN (COSTS false)
1005 SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
1006   AND bmt1.c1 <> (
1007 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
1008 )
1009 ;
1010 LOG:  pg_hint_plan:
1011 used hint:
1012 TidScan(b1t1)
1013 SeqScan(b1t2)
1014 IndexScan(b1t3 t3_pkey)
1015 BitmapScan(b1t4 t4_pkey)
1016 SeqScan(bmt1)
1017 IndexScan(bmt2 t2_pkey)
1018 BitmapScan(bmt3 t3_pkey)
1019 TidScan(bmt4)
1020 not used hint:
1021 duplication hint:
1022 error hint:
1023
1024                                QUERY PLAN                                
1025 -------------------------------------------------------------------------
1026  Aggregate
1027    InitPlan 1 (returns $1)
1028      ->  Aggregate
1029            ->  Merge Join
1030                  Merge Cond: (b1t1.c1 = b1t2.c1)
1031                  ->  Nested Loop
1032                        ->  Merge Join
1033                              Merge Cond: (b1t1.c1 = b1t3.c1)
1034                              ->  Sort
1035                                    Sort Key: b1t1.c1
1036                                    ->  Seq Scan on t1 b1t1
1037                              ->  Index Scan using t3_pkey on t3 b1t3
1038                        ->  Bitmap Heap Scan on t4 b1t4
1039                              Recheck Cond: (c1 = b1t1.c1)
1040                              ->  Bitmap Index Scan on t4_pkey
1041                                    Index Cond: (c1 = b1t1.c1)
1042                  ->  Sort
1043                        Sort Key: b1t2.c1
1044                        ->  Seq Scan on t2 b1t2
1045    ->  Hash Join
1046          Hash Cond: (bmt4.c1 = bmt1.c1)
1047          ->  Seq Scan on t4 bmt4
1048          ->  Hash
1049                ->  Nested Loop
1050                      ->  Hash Join
1051                            Hash Cond: (bmt1.c1 = bmt2.c1)
1052                            ->  Seq Scan on t1 bmt1
1053                                  Filter: (c1 <> $1)
1054                            ->  Hash
1055                                  ->  Index Scan using t2_pkey on t2 bmt2
1056                      ->  Bitmap Heap Scan on t3 bmt3
1057                            Recheck Cond: (c1 = bmt1.c1)
1058                            ->  Bitmap Index Scan on t3_pkey
1059                                  Index Cond: (c1 = bmt1.c1)
1060 (34 rows)
1061
1062 -- No. S-2-1-6
1063 EXPLAIN (COSTS false)
1064 SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
1065   AND bmt1.c1 <> (
1066 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
1067 ) AND bmt1.c1 <> (
1068 SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.c1 = b2t2.c1 AND b2t1.c1 = b2t3.c1 AND b2t1.c1 = b2t4.c1
1069 )
1070 ;
1071                             QUERY PLAN                             
1072 -------------------------------------------------------------------
1073  Aggregate
1074    InitPlan 1 (returns $0)
1075      ->  Aggregate
1076            ->  Merge Join
1077                  Merge Cond: (b1t1.c1 = b1t2.c1)
1078                  ->  Merge Join
1079                        Merge Cond: (b1t1.c1 = b1t4.c1)
1080                        ->  Merge Join
1081                              Merge Cond: (b1t1.c1 = b1t3.c1)
1082                              ->  Index Scan using t1_i1 on t1 b1t1
1083                              ->  Index Scan using t3_i1 on t3 b1t3
1084                        ->  Index Scan using t4_i1 on t4 b1t4
1085                  ->  Sort
1086                        Sort Key: b1t2.c1
1087                        ->  Seq Scan on t2 b1t2
1088    InitPlan 2 (returns $1)
1089      ->  Aggregate
1090            ->  Merge Join
1091                  Merge Cond: (b2t1.c1 = b2t2.c1)
1092                  ->  Merge Join
1093                        Merge Cond: (b2t1.c1 = b2t4.c1)
1094                        ->  Merge Join
1095                              Merge Cond: (b2t1.c1 = b2t3.c1)
1096                              ->  Index Scan using t1_i1 on t1 b2t1
1097                              ->  Index Scan using t3_i1 on t3 b2t3
1098                        ->  Index Scan using t4_i1 on t4 b2t4
1099                  ->  Sort
1100                        Sort Key: b2t2.c1
1101                        ->  Seq Scan on t2 b2t2
1102    ->  Merge Join
1103          Merge Cond: (bmt1.c1 = bmt2.c1)
1104          ->  Merge Join
1105                Merge Cond: (bmt1.c1 = bmt4.c1)
1106                ->  Merge Join
1107                      Merge Cond: (bmt1.c1 = bmt3.c1)
1108                      ->  Index Scan using t1_i1 on t1 bmt1
1109                            Filter: ((c1 <> $0) AND (c1 <> $1))
1110                      ->  Index Scan using t3_i1 on t3 bmt3
1111                ->  Index Scan using t4_i1 on t4 bmt4
1112          ->  Sort
1113                Sort Key: bmt2.c1
1114                ->  Seq Scan on t2 bmt2
1115 (42 rows)
1116
1117 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
1118 TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
1119 BitmapScan(b2t1 t1_pkey)TidScan(b2t2)SeqScan(b2t3)IndexScan(b2t4 t4_pkey)
1120 */
1121 EXPLAIN (COSTS false)
1122 SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
1123   AND bmt1.c1 <> (
1124 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
1125 ) AND bmt1.c1 <> (
1126 SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.c1 = b2t2.c1 AND b2t1.c1 = b2t3.c1 AND b2t1.c1 = b2t4.c1
1127 )
1128 ;
1129 LOG:  pg_hint_plan:
1130 used hint:
1131 TidScan(b1t1)
1132 SeqScan(b1t2)
1133 IndexScan(b1t3 t3_pkey)
1134 BitmapScan(b1t4 t4_pkey)
1135 BitmapScan(b2t1 t1_pkey)
1136 TidScan(b2t2)
1137 SeqScan(b2t3)
1138 IndexScan(b2t4 t4_pkey)
1139 SeqScan(bmt1)
1140 IndexScan(bmt2 t2_pkey)
1141 BitmapScan(bmt3 t3_pkey)
1142 TidScan(bmt4)
1143 not used hint:
1144 duplication hint:
1145 error hint:
1146
1147                                 QUERY PLAN                                 
1148 ---------------------------------------------------------------------------
1149  Aggregate
1150    InitPlan 1 (returns $1)
1151      ->  Aggregate
1152            ->  Merge Join
1153                  Merge Cond: (b1t1.c1 = b1t2.c1)
1154                  ->  Nested Loop
1155                        ->  Merge Join
1156                              Merge Cond: (b1t1.c1 = b1t3.c1)
1157                              ->  Sort
1158                                    Sort Key: b1t1.c1
1159                                    ->  Seq Scan on t1 b1t1
1160                              ->  Index Scan using t3_pkey on t3 b1t3
1161                        ->  Bitmap Heap Scan on t4 b1t4
1162                              Recheck Cond: (c1 = b1t1.c1)
1163                              ->  Bitmap Index Scan on t4_pkey
1164                                    Index Cond: (c1 = b1t1.c1)
1165                  ->  Sort
1166                        Sort Key: b1t2.c1
1167                        ->  Seq Scan on t2 b1t2
1168    InitPlan 2 (returns $3)
1169      ->  Aggregate
1170            ->  Hash Join
1171                  Hash Cond: (b2t3.c1 = b2t1.c1)
1172                  ->  Seq Scan on t3 b2t3
1173                  ->  Hash
1174                        ->  Merge Join
1175                              Merge Cond: (b2t1.c1 = b2t2.c1)
1176                              ->  Nested Loop
1177                                    ->  Index Scan using t4_pkey on t4 b2t4
1178                                    ->  Bitmap Heap Scan on t1 b2t1
1179                                          Recheck Cond: (c1 = b2t4.c1)
1180                                          ->  Bitmap Index Scan on t1_pkey
1181                                                Index Cond: (c1 = b2t4.c1)
1182                              ->  Sort
1183                                    Sort Key: b2t2.c1
1184                                    ->  Seq Scan on t2 b2t2
1185    ->  Hash Join
1186          Hash Cond: (bmt4.c1 = bmt1.c1)
1187          ->  Seq Scan on t4 bmt4
1188          ->  Hash
1189                ->  Nested Loop
1190                      ->  Hash Join
1191                            Hash Cond: (bmt1.c1 = bmt2.c1)
1192                            ->  Seq Scan on t1 bmt1
1193                                  Filter: ((c1 <> $1) AND (c1 <> $3))
1194                            ->  Hash
1195                                  ->  Index Scan using t2_pkey on t2 bmt2
1196                      ->  Bitmap Heap Scan on t3 bmt3
1197                            Recheck Cond: (c1 = bmt1.c1)
1198                            ->  Bitmap Index Scan on t3_pkey
1199                                  Index Cond: (c1 = bmt1.c1)
1200 (51 rows)
1201
1202 -- No. S-2-1-7
1203 EXPLAIN (COSTS false)
1204 WITH c1 (c1) AS (
1205 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
1206 )
1207 SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
1208 , c1
1209                                                                         WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
1210 AND bmt1.c1 = c1.c1
1211 ;
1212                             QUERY PLAN                             
1213 -------------------------------------------------------------------
1214  Aggregate
1215    CTE c1
1216      ->  Aggregate
1217            ->  Merge Join
1218                  Merge Cond: (b1t1.c1 = b1t2.c1)
1219                  ->  Merge Join
1220                        Merge Cond: (b1t1.c1 = b1t4.c1)
1221                        ->  Merge Join
1222                              Merge Cond: (b1t1.c1 = b1t3.c1)
1223                              ->  Index Scan using t1_i1 on t1 b1t1
1224                              ->  Index Scan using t3_i1 on t3 b1t3
1225                        ->  Index Scan using t4_i1 on t4 b1t4
1226                  ->  Sort
1227                        Sort Key: b1t2.c1
1228                        ->  Seq Scan on t2 b1t2
1229    ->  Merge Join
1230          Merge Cond: (bmt1.c1 = bmt2.c1)
1231          ->  Merge Join
1232                Merge Cond: (bmt1.c1 = bmt4.c1)
1233                ->  Merge Join
1234                      Merge Cond: (bmt1.c1 = bmt3.c1)
1235                      ->  Index Scan using t1_i1 on t1 bmt1
1236                      ->  Index Scan using t3_i1 on t3 bmt3
1237                ->  Index Scan using t4_i1 on t4 bmt4
1238          ->  Sort
1239                Sort Key: bmt2.c1
1240                ->  Hash Join
1241                      Hash Cond: (bmt2.c1 = c1.c1)
1242                      ->  Seq Scan on t2 bmt2
1243                      ->  Hash
1244                            ->  CTE Scan on c1
1245 (31 rows)
1246
1247 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
1248 TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
1249 */
1250 EXPLAIN (COSTS false)
1251 WITH c1 (c1) AS (
1252 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
1253 )
1254 SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
1255 , c1
1256                                                                         WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
1257 AND bmt1.c1 = c1.c1
1258 ;
1259 LOG:  pg_hint_plan:
1260 used hint:
1261 TidScan(b1t1)
1262 SeqScan(b1t2)
1263 IndexScan(b1t3 t3_pkey)
1264 BitmapScan(b1t4 t4_pkey)
1265 SeqScan(bmt1)
1266 IndexScan(bmt2 t2_pkey)
1267 BitmapScan(bmt3 t3_pkey)
1268 TidScan(bmt4)
1269 not used hint:
1270 duplication hint:
1271 error hint:
1272
1273                              QUERY PLAN                              
1274 ---------------------------------------------------------------------
1275  Aggregate
1276    CTE c1
1277      ->  Aggregate
1278            ->  Merge Join
1279                  Merge Cond: (b1t1.c1 = b1t2.c1)
1280                  ->  Nested Loop
1281                        ->  Merge Join
1282                              Merge Cond: (b1t1.c1 = b1t3.c1)
1283                              ->  Sort
1284                                    Sort Key: b1t1.c1
1285                                    ->  Seq Scan on t1 b1t1
1286                              ->  Index Scan using t3_pkey on t3 b1t3
1287                        ->  Bitmap Heap Scan on t4 b1t4
1288                              Recheck Cond: (c1 = b1t1.c1)
1289                              ->  Bitmap Index Scan on t4_pkey
1290                                    Index Cond: (c1 = b1t1.c1)
1291                  ->  Sort
1292                        Sort Key: b1t2.c1
1293                        ->  Seq Scan on t2 b1t2
1294    ->  Hash Join
1295          Hash Cond: (bmt4.c1 = bmt1.c1)
1296          ->  Seq Scan on t4 bmt4
1297          ->  Hash
1298                ->  Nested Loop
1299                      ->  Nested Loop
1300                            ->  Hash Join
1301                                  Hash Cond: (bmt1.c1 = c1.c1)
1302                                  ->  Seq Scan on t1 bmt1
1303                                  ->  Hash
1304                                        ->  CTE Scan on c1
1305                            ->  Index Scan using t2_pkey on t2 bmt2
1306                                  Index Cond: (c1 = bmt1.c1)
1307                      ->  Bitmap Heap Scan on t3 bmt3
1308                            Recheck Cond: (c1 = bmt1.c1)
1309                            ->  Bitmap Index Scan on t3_pkey
1310                                  Index Cond: (c1 = bmt1.c1)
1311 (36 rows)
1312
1313 -- No. S-2-1-8
1314 EXPLAIN (COSTS false)
1315 WITH c1 (c1) AS (
1316 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
1317 )
1318 , c2 (c1) AS (
1319 SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.c1 = b2t2.c1 AND b2t1.c1 = b2t3.c1 AND b2t1.c1 = b2t4.c1
1320 )
1321 SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
1322 , c1, c2
1323                                                                         WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
1324 AND bmt1.c1 = c1.c1
1325 AND bmt1.c1 = c2.c1
1326 ;
1327                             QUERY PLAN                             
1328 -------------------------------------------------------------------
1329  Aggregate
1330    CTE c1
1331      ->  Aggregate
1332            ->  Merge Join
1333                  Merge Cond: (b1t1.c1 = b1t2.c1)
1334                  ->  Merge Join
1335                        Merge Cond: (b1t1.c1 = b1t4.c1)
1336                        ->  Merge Join
1337                              Merge Cond: (b1t1.c1 = b1t3.c1)
1338                              ->  Index Scan using t1_i1 on t1 b1t1
1339                              ->  Index Scan using t3_i1 on t3 b1t3
1340                        ->  Index Scan using t4_i1 on t4 b1t4
1341                  ->  Sort
1342                        Sort Key: b1t2.c1
1343                        ->  Seq Scan on t2 b1t2
1344    CTE c2
1345      ->  Aggregate
1346            ->  Merge Join
1347                  Merge Cond: (b2t1.c1 = b2t2.c1)
1348                  ->  Merge Join
1349                        Merge Cond: (b2t1.c1 = b2t4.c1)
1350                        ->  Merge Join
1351                              Merge Cond: (b2t1.c1 = b2t3.c1)
1352                              ->  Index Scan using t1_i1 on t1 b2t1
1353                              ->  Index Scan using t3_i1 on t3 b2t3
1354                        ->  Index Scan using t4_i1 on t4 b2t4
1355                  ->  Sort
1356                        Sort Key: b2t2.c1
1357                        ->  Seq Scan on t2 b2t2
1358    ->  Nested Loop
1359          Join Filter: (bmt1.c1 = c2.c1)
1360          ->  Merge Join
1361                Merge Cond: (bmt1.c1 = bmt2.c1)
1362                ->  Merge Join
1363                      Merge Cond: (bmt1.c1 = bmt4.c1)
1364                      ->  Merge Join
1365                            Merge Cond: (bmt1.c1 = bmt3.c1)
1366                            ->  Index Scan using t1_i1 on t1 bmt1
1367                            ->  Index Scan using t3_i1 on t3 bmt3
1368                      ->  Index Scan using t4_i1 on t4 bmt4
1369                ->  Sort
1370                      Sort Key: bmt2.c1
1371                      ->  Hash Join
1372                            Hash Cond: (bmt2.c1 = c1.c1)
1373                            ->  Seq Scan on t2 bmt2
1374                            ->  Hash
1375                                  ->  CTE Scan on c1
1376          ->  CTE Scan on c2
1377 (48 rows)
1378
1379 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
1380 TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
1381 BitmapScan(b2t1 t1_pkey)TidScan(b2t2)SeqScan(b2t3)IndexScan(b2t4 t4_pkey)
1382 */
1383 EXPLAIN (COSTS false)
1384 WITH c1 (c1) AS (
1385 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
1386 )
1387 , c2 (c1) AS (
1388 SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.c1 = b2t2.c1 AND b2t1.c1 = b2t3.c1 AND b2t1.c1 = b2t4.c1
1389 )
1390 SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
1391 , c1, c2
1392                                                                         WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
1393 AND bmt1.c1 = c1.c1
1394 AND bmt1.c1 = c2.c1
1395 ;
1396 LOG:  pg_hint_plan:
1397 used hint:
1398 TidScan(b1t1)
1399 SeqScan(b1t2)
1400 IndexScan(b1t3 t3_pkey)
1401 BitmapScan(b1t4 t4_pkey)
1402 BitmapScan(b2t1 t1_pkey)
1403 TidScan(b2t2)
1404 SeqScan(b2t3)
1405 IndexScan(b2t4 t4_pkey)
1406 SeqScan(bmt1)
1407 IndexScan(bmt2 t2_pkey)
1408 BitmapScan(bmt3 t3_pkey)
1409 TidScan(bmt4)
1410 not used hint:
1411 duplication hint:
1412 error hint:
1413
1414                                 QUERY PLAN                                 
1415 ---------------------------------------------------------------------------
1416  Aggregate
1417    CTE c1
1418      ->  Aggregate
1419            ->  Merge Join
1420                  Merge Cond: (b1t1.c1 = b1t2.c1)
1421                  ->  Nested Loop
1422                        ->  Merge Join
1423                              Merge Cond: (b1t1.c1 = b1t3.c1)
1424                              ->  Sort
1425                                    Sort Key: b1t1.c1
1426                                    ->  Seq Scan on t1 b1t1
1427                              ->  Index Scan using t3_pkey on t3 b1t3
1428                        ->  Bitmap Heap Scan on t4 b1t4
1429                              Recheck Cond: (c1 = b1t1.c1)
1430                              ->  Bitmap Index Scan on t4_pkey
1431                                    Index Cond: (c1 = b1t1.c1)
1432                  ->  Sort
1433                        Sort Key: b1t2.c1
1434                        ->  Seq Scan on t2 b1t2
1435    CTE c2
1436      ->  Aggregate
1437            ->  Hash Join
1438                  Hash Cond: (b2t3.c1 = b2t1.c1)
1439                  ->  Seq Scan on t3 b2t3
1440                  ->  Hash
1441                        ->  Merge Join
1442                              Merge Cond: (b2t1.c1 = b2t2.c1)
1443                              ->  Nested Loop
1444                                    ->  Index Scan using t4_pkey on t4 b2t4
1445                                    ->  Bitmap Heap Scan on t1 b2t1
1446                                          Recheck Cond: (c1 = b2t4.c1)
1447                                          ->  Bitmap Index Scan on t1_pkey
1448                                                Index Cond: (c1 = b2t4.c1)
1449                              ->  Sort
1450                                    Sort Key: b2t2.c1
1451                                    ->  Seq Scan on t2 b2t2
1452    ->  Hash Join
1453          Hash Cond: (bmt4.c1 = bmt1.c1)
1454          ->  Seq Scan on t4 bmt4
1455          ->  Hash
1456                ->  Nested Loop
1457                      ->  Nested Loop
1458                            Join Filter: (bmt1.c1 = c2.c1)
1459                            ->  Nested Loop
1460                                  ->  Hash Join
1461                                        Hash Cond: (bmt1.c1 = c1.c1)
1462                                        ->  Seq Scan on t1 bmt1
1463                                        ->  Hash
1464                                              ->  CTE Scan on c1
1465                                  ->  Index Scan using t2_pkey on t2 bmt2
1466                                        Index Cond: (c1 = bmt1.c1)
1467                            ->  CTE Scan on c2
1468                      ->  Bitmap Heap Scan on t3 bmt3
1469                            Recheck Cond: (c1 = bmt1.c1)
1470                            ->  Bitmap Index Scan on t3_pkey
1471                                  Index Cond: (c1 = bmt1.c1)
1472 (56 rows)
1473
1474 ----
1475 ---- No. S-2-2 the number of the tables per quiry block
1476 ----
1477 -- No. S-2-2-1
1478 EXPLAIN (COSTS false)
1479 WITH c1 (c1) AS (
1480 SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = 1
1481 )
1482 SELECT max(bmt1.c1), (
1483 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
1484 )
1485                     FROM s1.t1 bmt1, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = 1
1486 AND bmt1.c1 <> (
1487 SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = 1
1488 )
1489 ;
1490                            QUERY PLAN                            
1491 -----------------------------------------------------------------
1492  Aggregate
1493    CTE c1
1494      ->  Result
1495            InitPlan 1 (returns $0)
1496              ->  Limit
1497                    ->  Tid Scan on t1 b1t1
1498                          TID Cond: (ctid = '(1,1)'::tid)
1499                          Filter: ((c1 IS NOT NULL) AND (c1 = 1))
1500    InitPlan 4 (returns $3)
1501      ->  Result
1502            InitPlan 3 (returns $2)
1503              ->  Limit
1504                    ->  Tid Scan on t1 b2t1
1505                          TID Cond: (ctid = '(1,1)'::tid)
1506                          Filter: ((c1 IS NOT NULL) AND (c1 = 1))
1507    InitPlan 6 (returns $5)
1508      ->  Result
1509            InitPlan 5 (returns $4)
1510              ->  Limit
1511                    ->  Tid Scan on t1 b3t1
1512                          TID Cond: (ctid = '(1,1)'::tid)
1513                          Filter: ((c1 IS NOT NULL) AND (c1 = 1))
1514    ->  Nested Loop
1515          ->  Tid Scan on t1 bmt1
1516                TID Cond: (ctid = '(1,1)'::tid)
1517                Filter: ((c1 <> $5) AND (c1 = 1))
1518          ->  CTE Scan on c1
1519 (27 rows)
1520
1521 /*+SeqScan(bmt1)
1522 TidScan(b1t1)
1523 BitmapScan(b2t1 t1_pkey)
1524 IndexScan(b3t1 t1_pkey)
1525 */
1526 EXPLAIN (COSTS false)
1527 WITH c1 (c1) AS (
1528 SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = 1
1529 )
1530 SELECT max(bmt1.c1), (
1531 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
1532 )
1533                     FROM s1.t1 bmt1, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = 1
1534 AND bmt1.c1 <> (
1535 SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = 1
1536 )
1537 ;
1538 LOG:  pg_hint_plan:
1539 used hint:
1540 TidScan(b1t1)
1541 BitmapScan(b2t1 t1_pkey)
1542 IndexScan(b3t1 t1_pkey)
1543 SeqScan(bmt1)
1544 not used hint:
1545 duplication hint:
1546 error hint:
1547
1548                                 QUERY PLAN                                 
1549 ---------------------------------------------------------------------------
1550  Aggregate
1551    CTE c1
1552      ->  Result
1553            InitPlan 1 (returns $0)
1554              ->  Limit
1555                    ->  Tid Scan on t1 b1t1
1556                          TID Cond: (ctid = '(1,1)'::tid)
1557                          Filter: ((c1 IS NOT NULL) AND (c1 = 1))
1558    InitPlan 4 (returns $3)
1559      ->  Result
1560            InitPlan 3 (returns $2)
1561              ->  Limit
1562                    ->  Bitmap Heap Scan on t1 b2t1
1563                          Recheck Cond: ((c1 IS NOT NULL) AND (c1 = 1))
1564                          Filter: (ctid = '(1,1)'::tid)
1565                          ->  Bitmap Index Scan on t1_pkey
1566                                Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
1567    InitPlan 6 (returns $5)
1568      ->  Result
1569            InitPlan 5 (returns $4)
1570              ->  Limit
1571                    ->  Index Scan using t1_pkey on t1 b3t1
1572                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
1573                          Filter: (ctid = '(1,1)'::tid)
1574    ->  Nested Loop
1575          ->  Seq Scan on t1 bmt1
1576                Filter: ((c1 <> $5) AND (ctid = '(1,1)'::tid) AND (c1 = 1))
1577          ->  CTE Scan on c1
1578 (28 rows)
1579
1580 -- No. S-2-2-2
1581 EXPLAIN (COSTS false)
1582 WITH c1 (c1) AS (
1583 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)'
1584 )
1585 SELECT max(bmt1.c1), (
1586 SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)'
1587 )
1588                     FROM s1.t1 bmt1, s1.t2 bmt2, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)'
1589 AND bmt1.c1 <> (
1590 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)'
1591 )
1592 ;
1593                       QUERY PLAN                       
1594 -------------------------------------------------------
1595  Aggregate
1596    CTE c1
1597      ->  Aggregate
1598            ->  Nested Loop
1599                  Join Filter: (b1t1.c1 = b1t2.c1)
1600                  ->  Tid Scan on t1 b1t1
1601                        TID Cond: (ctid = '(1,1)'::tid)
1602                  ->  Seq Scan on t2 b1t2
1603                        Filter: (ctid = '(1,1)'::tid)
1604    InitPlan 2 (returns $1)
1605      ->  Aggregate
1606            ->  Nested Loop
1607                  Join Filter: (b2t1.c1 = b2t2.c1)
1608                  ->  Tid Scan on t1 b2t1
1609                        TID Cond: (ctid = '(1,1)'::tid)
1610                  ->  Seq Scan on t2 b2t2
1611                        Filter: (ctid = '(1,1)'::tid)
1612    InitPlan 3 (returns $2)
1613      ->  Aggregate
1614            ->  Nested Loop
1615                  Join Filter: (b3t1.c1 = b3t2.c1)
1616                  ->  Tid Scan on t1 b3t1
1617                        TID Cond: (ctid = '(1,1)'::tid)
1618                  ->  Seq Scan on t2 b3t2
1619                        Filter: (ctid = '(1,1)'::tid)
1620    ->  Nested Loop
1621          ->  Nested Loop
1622                Join Filter: (bmt1.c1 = bmt2.c1)
1623                ->  Tid Scan on t1 bmt1
1624                      TID Cond: (ctid = '(1,1)'::tid)
1625                      Filter: (c1 <> $2)
1626                ->  Seq Scan on t2 bmt2
1627                      Filter: (ctid = '(1,1)'::tid)
1628          ->  CTE Scan on c1
1629 (34 rows)
1630
1631 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)
1632 TidScan(b1t1)SeqScan(b1t2)
1633 BitmapScan(b2t1 t1_pkey)TidScan(b2t2)
1634 IndexScan(b3t1 t1_pkey)BitmapScan(b3t2 t2_pkey)
1635 */
1636 EXPLAIN (COSTS false)
1637 WITH c1 (c1) AS (
1638 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)'
1639 )
1640 SELECT max(bmt1.c1), (
1641 SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)'
1642 )
1643                     FROM s1.t1 bmt1, s1.t2 bmt2, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)'
1644 AND bmt1.c1 <> (
1645 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)'
1646 )
1647 ;
1648 LOG:  pg_hint_plan:
1649 used hint:
1650 TidScan(b1t1)
1651 SeqScan(b1t2)
1652 BitmapScan(b2t1 t1_pkey)
1653 TidScan(b2t2)
1654 IndexScan(b3t1 t1_pkey)
1655 BitmapScan(b3t2 t2_pkey)
1656 SeqScan(bmt1)
1657 IndexScan(bmt2 t2_pkey)
1658 not used hint:
1659 duplication hint:
1660 error hint:
1661
1662                              QUERY PLAN                             
1663 --------------------------------------------------------------------
1664  Aggregate
1665    CTE c1
1666      ->  Aggregate
1667            ->  Nested Loop
1668                  Join Filter: (b1t1.c1 = b1t2.c1)
1669                  ->  Tid Scan on t1 b1t1
1670                        TID Cond: (ctid = '(1,1)'::tid)
1671                  ->  Seq Scan on t2 b1t2
1672                        Filter: (ctid = '(1,1)'::tid)
1673    InitPlan 2 (returns $2)
1674      ->  Aggregate
1675            ->  Nested Loop
1676                  ->  Tid Scan on t2 b2t2
1677                        TID Cond: (ctid = '(1,1)'::tid)
1678                  ->  Bitmap Heap Scan on t1 b2t1
1679                        Recheck Cond: (c1 = b2t2.c1)
1680                        Filter: (ctid = '(1,1)'::tid)
1681                        ->  Bitmap Index Scan on t1_pkey
1682                              Index Cond: (c1 = b2t2.c1)
1683    InitPlan 3 (returns $4)
1684      ->  Aggregate
1685            ->  Nested Loop
1686                  ->  Index Scan using t1_pkey on t1 b3t1
1687                        Filter: (ctid = '(1,1)'::tid)
1688                  ->  Bitmap Heap Scan on t2 b3t2
1689                        Recheck Cond: (c1 = b3t1.c1)
1690                        Filter: (ctid = '(1,1)'::tid)
1691                        ->  Bitmap Index Scan on t2_pkey
1692                              Index Cond: (c1 = b3t1.c1)
1693    ->  Nested Loop
1694          ->  Nested Loop
1695                ->  Seq Scan on t1 bmt1
1696                      Filter: ((c1 <> $4) AND (ctid = '(1,1)'::tid))
1697                ->  Index Scan using t2_pkey on t2 bmt2
1698                      Index Cond: (c1 = bmt1.c1)
1699                      Filter: (ctid = '(1,1)'::tid)
1700          ->  CTE Scan on c1
1701 (37 rows)
1702
1703 -- No. S-2-2-3
1704 EXPLAIN (COSTS false)
1705 WITH c1 (c1) AS (
1706 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
1707 )
1708 SELECT max(bmt1.c1), (
1709 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)'
1710 )
1711                     FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 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)' AND bmt1.c1 = c1.c1
1712 AND bmt1.c1 <> (
1713 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)'
1714 )
1715 ;
1716                             QUERY PLAN                             
1717 -------------------------------------------------------------------
1718  Aggregate
1719    CTE c1
1720      ->  Aggregate
1721            ->  Nested Loop
1722                  Join Filter: (b1t1.c1 = b1t4.c1)
1723                  ->  Nested Loop
1724                        Join Filter: (b1t1.c1 = b1t3.c1)
1725                        ->  Nested Loop
1726                              Join Filter: (b1t1.c1 = b1t2.c1)
1727                              ->  Tid Scan on t1 b1t1
1728                                    TID Cond: (ctid = '(1,1)'::tid)
1729                              ->  Seq Scan on t2 b1t2
1730                                    Filter: (ctid = '(1,1)'::tid)
1731                        ->  Tid Scan on t3 b1t3
1732                              TID Cond: (ctid = '(1,1)'::tid)
1733                  ->  Tid Scan on t4 b1t4
1734                        TID Cond: (ctid = '(1,1)'::tid)
1735    InitPlan 2 (returns $1)
1736      ->  Aggregate
1737            ->  Nested Loop
1738                  Join Filter: (b2t1.c1 = b2t4.c1)
1739                  ->  Nested Loop
1740                        Join Filter: (b2t1.c1 = b2t3.c1)
1741                        ->  Nested Loop
1742                              Join Filter: (b2t1.c1 = b2t2.c1)
1743                              ->  Tid Scan on t1 b2t1
1744                                    TID Cond: (ctid = '(1,1)'::tid)
1745                              ->  Seq Scan on t2 b2t2
1746                                    Filter: (ctid = '(1,1)'::tid)
1747                        ->  Tid Scan on t3 b2t3
1748                              TID Cond: (ctid = '(1,1)'::tid)
1749                  ->  Tid Scan on t4 b2t4
1750                        TID Cond: (ctid = '(1,1)'::tid)
1751    InitPlan 3 (returns $2)
1752      ->  Aggregate
1753            ->  Nested Loop
1754                  Join Filter: (b3t1.c1 = b3t4.c1)
1755                  ->  Nested Loop
1756                        Join Filter: (b3t1.c1 = b3t3.c1)
1757                        ->  Nested Loop
1758                              Join Filter: (b3t1.c1 = b3t2.c1)
1759                              ->  Tid Scan on t1 b3t1
1760                                    TID Cond: (ctid = '(1,1)'::tid)
1761                              ->  Seq Scan on t2 b3t2
1762                                    Filter: (ctid = '(1,1)'::tid)
1763                        ->  Tid Scan on t3 b3t3
1764                              TID Cond: (ctid = '(1,1)'::tid)
1765                  ->  Tid Scan on t4 b3t4
1766                        TID Cond: (ctid = '(1,1)'::tid)
1767    ->  Nested Loop
1768          Join Filter: (bmt1.c1 = c1.c1)
1769          ->  Nested Loop
1770                Join Filter: (bmt1.c1 = bmt2.c1)
1771                ->  Nested Loop
1772                      Join Filter: (bmt3.c1 = bmt1.c1)
1773                      ->  Nested Loop
1774                            Join Filter: (bmt3.c1 = bmt4.c1)
1775                            ->  Tid Scan on t3 bmt3
1776                                  TID Cond: (ctid = '(1,1)'::tid)
1777                            ->  Tid Scan on t4 bmt4
1778                                  TID Cond: (ctid = '(1,1)'::tid)
1779                      ->  Tid Scan on t1 bmt1
1780                            TID Cond: (ctid = '(1,1)'::tid)
1781                            Filter: (c1 <> $2)
1782                ->  Seq Scan on t2 bmt2
1783                      Filter: (ctid = '(1,1)'::tid)
1784          ->  CTE Scan on c1
1785 (67 rows)
1786
1787 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
1788 TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
1789 BitmapScan(b2t1 t1_pkey)TidScan(b2t2)SeqScan(b2t3)IndexScan(b2t4 t4_pkey)
1790 IndexScan(b3t1 t1_pkey)BitmapScan(b3t2 t2_pkey)TidScan(b3t3)SeqScan(b3t4)
1791 */
1792 EXPLAIN (COSTS false)
1793 WITH c1 (c1) AS (
1794 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
1795 )
1796 SELECT max(bmt1.c1), (
1797 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)'
1798 )
1799                     FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 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)' AND bmt1.c1 = c1.c1
1800 AND bmt1.c1 <> (
1801 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)'
1802 )
1803 ;
1804 LOG:  pg_hint_plan:
1805 used hint:
1806 TidScan(b1t1)
1807 SeqScan(b1t2)
1808 IndexScan(b1t3 t3_pkey)
1809 BitmapScan(b1t4 t4_pkey)
1810 BitmapScan(b2t1 t1_pkey)
1811 TidScan(b2t2)
1812 SeqScan(b2t3)
1813 IndexScan(b2t4 t4_pkey)
1814 IndexScan(b3t1 t1_pkey)
1815 BitmapScan(b3t2 t2_pkey)
1816 TidScan(b3t3)
1817 SeqScan(b3t4)
1818 SeqScan(bmt1)
1819 IndexScan(bmt2 t2_pkey)
1820 BitmapScan(bmt3 t3_pkey)
1821 TidScan(bmt4)
1822 not used hint:
1823 duplication hint:
1824 error hint:
1825
1826                                    QUERY PLAN                                   
1827 --------------------------------------------------------------------------------
1828  Aggregate
1829    CTE c1
1830      ->  Aggregate
1831            ->  Nested Loop
1832                  ->  Nested Loop
1833                        ->  Nested Loop
1834                              Join Filter: (b1t1.c1 = b1t2.c1)
1835                              ->  Tid Scan on t1 b1t1
1836                                    TID Cond: (ctid = '(1,1)'::tid)
1837                              ->  Seq Scan on t2 b1t2
1838                                    Filter: (ctid = '(1,1)'::tid)
1839                        ->  Index Scan using t3_pkey on t3 b1t3
1840                              Index Cond: (c1 = b1t1.c1)
1841                              Filter: (ctid = '(1,1)'::tid)
1842                  ->  Bitmap Heap Scan on t4 b1t4
1843                        Recheck Cond: (c1 = b1t1.c1)
1844                        Filter: (ctid = '(1,1)'::tid)
1845                        ->  Bitmap Index Scan on t4_pkey
1846                              Index Cond: (c1 = b1t1.c1)
1847    InitPlan 2 (returns $3)
1848      ->  Aggregate
1849            ->  Nested Loop
1850                  ->  Nested Loop
1851                        Join Filter: (b2t1.c1 = b2t3.c1)
1852                        ->  Nested Loop
1853                              ->  Tid Scan on t2 b2t2
1854                                    TID Cond: (ctid = '(1,1)'::tid)
1855                              ->  Bitmap Heap Scan on t1 b2t1
1856                                    Recheck Cond: (c1 = b2t2.c1)
1857                                    Filter: (ctid = '(1,1)'::tid)
1858                                    ->  Bitmap Index Scan on t1_pkey
1859                                          Index Cond: (c1 = b2t2.c1)
1860                        ->  Seq Scan on t3 b2t3
1861                              Filter: (ctid = '(1,1)'::tid)
1862                  ->  Index Scan using t4_pkey on t4 b2t4
1863                        Index Cond: (c1 = b2t1.c1)
1864                        Filter: (ctid = '(1,1)'::tid)
1865    InitPlan 3 (returns $5)
1866      ->  Aggregate
1867            ->  Nested Loop
1868                  ->  Nested Loop
1869                        ->  Nested Loop
1870                              Join Filter: (b3t3.c1 = b3t4.c1)
1871                              ->  Tid Scan on t3 b3t3
1872                                    TID Cond: (ctid = '(1,1)'::tid)
1873                              ->  Seq Scan on t4 b3t4
1874                                    Filter: (ctid = '(1,1)'::tid)
1875                        ->  Bitmap Heap Scan on t2 b3t2
1876                              Recheck Cond: (c1 = b3t3.c1)
1877                              Filter: (ctid = '(1,1)'::tid)
1878                              ->  Bitmap Index Scan on t2_pkey
1879                                    Index Cond: (c1 = b3t3.c1)
1880                  ->  Index Scan using t1_pkey on t1 b3t1
1881                        Index Cond: (c1 = b3t2.c1)
1882                        Filter: (ctid = '(1,1)'::tid)
1883    ->  Nested Loop
1884          ->  Nested Loop
1885                Join Filter: (bmt1.c1 = c1.c1)
1886                ->  Nested Loop
1887                      Join Filter: (bmt1.c1 = bmt4.c1)
1888                      ->  Nested Loop
1889                            ->  Seq Scan on t1 bmt1
1890                                  Filter: ((c1 <> $5) AND (ctid = '(1,1)'::tid))
1891                            ->  Bitmap Heap Scan on t3 bmt3
1892                                  Recheck Cond: (c1 = bmt1.c1)
1893                                  Filter: (ctid = '(1,1)'::tid)
1894                                  ->  Bitmap Index Scan on t3_pkey
1895                                        Index Cond: (c1 = bmt1.c1)
1896                      ->  Tid Scan on t4 bmt4
1897                            TID Cond: (ctid = '(1,1)'::tid)
1898                ->  CTE Scan on c1
1899          ->  Index Scan using t2_pkey on t2 bmt2
1900                Index Cond: (c1 = bmt1.c1)
1901                Filter: (ctid = '(1,1)'::tid)
1902 (74 rows)
1903
1904 -- No. S-2-2-4
1905 EXPLAIN (COSTS false)
1906 WITH c1 (c1) AS (
1907 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
1908 )
1909 SELECT max(bmt1.c1), (
1910 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
1911 )
1912                     FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 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)' AND bmt1.c1 = c1.c1
1913 AND bmt1.c1 <> (
1914 SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)'
1915 )
1916 ;
1917                             QUERY PLAN                             
1918 -------------------------------------------------------------------
1919  Aggregate
1920    CTE c1
1921      ->  Aggregate
1922            ->  Nested Loop
1923                  Join Filter: (b1t1.c1 = b1t4.c1)
1924                  ->  Nested Loop
1925                        Join Filter: (b1t1.c1 = b1t3.c1)
1926                        ->  Nested Loop
1927                              Join Filter: (b1t1.c1 = b1t2.c1)
1928                              ->  Tid Scan on t1 b1t1
1929                                    TID Cond: (ctid = '(1,1)'::tid)
1930                              ->  Seq Scan on t2 b1t2
1931                                    Filter: (ctid = '(1,1)'::tid)
1932                        ->  Tid Scan on t3 b1t3
1933                              TID Cond: (ctid = '(1,1)'::tid)
1934                  ->  Tid Scan on t4 b1t4
1935                        TID Cond: (ctid = '(1,1)'::tid)
1936    InitPlan 3 (returns $2)
1937      ->  Result
1938            InitPlan 2 (returns $1)
1939              ->  Limit
1940                    ->  Tid Scan on t1 b2t1
1941                          TID Cond: (ctid = '(1,1)'::tid)
1942                          Filter: ((c1 IS NOT NULL) AND (c1 = 1))
1943    InitPlan 4 (returns $3)
1944      ->  Aggregate
1945            ->  Tid Scan on t1 b3t1
1946                  TID Cond: (ctid = '(1,1)'::tid)
1947    ->  Nested Loop
1948          Join Filter: (bmt1.c1 = c1.c1)
1949          ->  Nested Loop
1950                Join Filter: (bmt1.c1 = bmt2.c1)
1951                ->  Nested Loop
1952                      Join Filter: (bmt3.c1 = bmt1.c1)
1953                      ->  Nested Loop
1954                            Join Filter: (bmt3.c1 = bmt4.c1)
1955                            ->  Tid Scan on t3 bmt3
1956                                  TID Cond: (ctid = '(1,1)'::tid)
1957                            ->  Tid Scan on t4 bmt4
1958                                  TID Cond: (ctid = '(1,1)'::tid)
1959                      ->  Tid Scan on t1 bmt1
1960                            TID Cond: (ctid = '(1,1)'::tid)
1961                            Filter: (c1 <> $3)
1962                ->  Seq Scan on t2 bmt2
1963                      Filter: (ctid = '(1,1)'::tid)
1964          ->  CTE Scan on c1
1965 (46 rows)
1966
1967 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
1968 TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
1969 BitmapScan(b2t1 t1_pkey)
1970 IndexScan(b3t1 t1_pkey)
1971 */
1972 EXPLAIN (COSTS false)
1973 WITH c1 (c1) AS (
1974 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
1975 )
1976 SELECT max(bmt1.c1), (
1977 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
1978 )
1979                     FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 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)' AND bmt1.c1 = c1.c1
1980 AND bmt1.c1 <> (
1981 SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)'
1982 )
1983 ;
1984 LOG:  pg_hint_plan:
1985 used hint:
1986 TidScan(b1t1)
1987 SeqScan(b1t2)
1988 IndexScan(b1t3 t3_pkey)
1989 BitmapScan(b1t4 t4_pkey)
1990 BitmapScan(b2t1 t1_pkey)
1991 IndexScan(b3t1 t1_pkey)
1992 SeqScan(bmt1)
1993 IndexScan(bmt2 t2_pkey)
1994 BitmapScan(bmt3 t3_pkey)
1995 TidScan(bmt4)
1996 not used hint:
1997 duplication hint:
1998 error hint:
1999
2000                                    QUERY PLAN                                   
2001 --------------------------------------------------------------------------------
2002  Aggregate
2003    CTE c1
2004      ->  Aggregate
2005            ->  Nested Loop
2006                  ->  Nested Loop
2007                        ->  Nested Loop
2008                              Join Filter: (b1t1.c1 = b1t2.c1)
2009                              ->  Tid Scan on t1 b1t1
2010                                    TID Cond: (ctid = '(1,1)'::tid)
2011                              ->  Seq Scan on t2 b1t2
2012                                    Filter: (ctid = '(1,1)'::tid)
2013                        ->  Index Scan using t3_pkey on t3 b1t3
2014                              Index Cond: (c1 = b1t1.c1)
2015                              Filter: (ctid = '(1,1)'::tid)
2016                  ->  Bitmap Heap Scan on t4 b1t4
2017                        Recheck Cond: (c1 = b1t1.c1)
2018                        Filter: (ctid = '(1,1)'::tid)
2019                        ->  Bitmap Index Scan on t4_pkey
2020                              Index Cond: (c1 = b1t1.c1)
2021    InitPlan 3 (returns $3)
2022      ->  Result
2023            InitPlan 2 (returns $2)
2024              ->  Limit
2025                    ->  Bitmap Heap Scan on t1 b2t1
2026                          Recheck Cond: ((c1 IS NOT NULL) AND (c1 = 1))
2027                          Filter: (ctid = '(1,1)'::tid)
2028                          ->  Bitmap Index Scan on t1_pkey
2029                                Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
2030    InitPlan 5 (returns $5)
2031      ->  Result
2032            InitPlan 4 (returns $4)
2033              ->  Limit
2034                    ->  Index Scan Backward using t1_pkey on t1 b3t1
2035                          Index Cond: (c1 IS NOT NULL)
2036                          Filter: (ctid = '(1,1)'::tid)
2037    ->  Nested Loop
2038          ->  Nested Loop
2039                Join Filter: (bmt1.c1 = c1.c1)
2040                ->  Nested Loop
2041                      Join Filter: (bmt1.c1 = bmt4.c1)
2042                      ->  Nested Loop
2043                            ->  Seq Scan on t1 bmt1
2044                                  Filter: ((c1 <> $5) AND (ctid = '(1,1)'::tid))
2045                            ->  Bitmap Heap Scan on t3 bmt3
2046                                  Recheck Cond: (c1 = bmt1.c1)
2047                                  Filter: (ctid = '(1,1)'::tid)
2048                                  ->  Bitmap Index Scan on t3_pkey
2049                                        Index Cond: (c1 = bmt1.c1)
2050                      ->  Tid Scan on t4 bmt4
2051                            TID Cond: (ctid = '(1,1)'::tid)
2052                ->  CTE Scan on c1
2053          ->  Index Scan using t2_pkey on t2 bmt2
2054                Index Cond: (c1 = bmt1.c1)
2055                Filter: (ctid = '(1,1)'::tid)
2056 (54 rows)
2057
2058 ----
2059 ---- No. S-2-3 RULE definition table
2060 ----
2061 -- No. S-2-3-1
2062 EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2063                            QUERY PLAN                            
2064 -----------------------------------------------------------------
2065  Aggregate
2066    ->  Nested Loop
2067          Join Filter: (t1.c1 = t4.c1)
2068          ->  Nested Loop
2069                Join Filter: (t1.c1 = t3.c1)
2070                ->  Nested Loop
2071                      Join Filter: (t2.c1 = t1.c1)
2072                      ->  Nested Loop
2073                            ->  Tid Scan on r1
2074                                  TID Cond: (ctid = '(1,1)'::tid)
2075                                  Filter: (c1 = 1)
2076                            ->  Seq Scan on t2
2077                                  Filter: (ctid = '(1,1)'::tid)
2078                      ->  Tid Scan on t1
2079                            TID Cond: (ctid = '(1,1)'::tid)
2080                ->  Tid Scan on t3
2081                      TID Cond: (ctid = '(1,1)'::tid)
2082          ->  Tid Scan on t4
2083                TID Cond: (ctid = '(1,1)'::tid)
2084 (19 rows)
2085
2086 /*+TidScan(t1)SeqScan(t2)IndexScan(t3 t3_pkey)BitmapScan(t4 t4_pkey)
2087 SeqScan(r1)*/
2088 EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2089 LOG:  pg_hint_plan:
2090 used hint:
2091 SeqScan(r1)
2092 TidScan(t1)
2093 SeqScan(t2)
2094 IndexScan(t3 t3_pkey)
2095 BitmapScan(t4 t4_pkey)
2096 not used hint:
2097 duplication hint:
2098 error hint:
2099
2100                                QUERY PLAN                               
2101 ------------------------------------------------------------------------
2102  Aggregate
2103    ->  Nested Loop
2104          ->  Nested Loop
2105                Join Filter: (t2.c1 = t1.c1)
2106                ->  Nested Loop
2107                      ->  Nested Loop
2108                            ->  Seq Scan on t2
2109                                  Filter: (ctid = '(1,1)'::tid)
2110                            ->  Index Scan using t3_pkey on t3
2111                                  Index Cond: (c1 = t2.c1)
2112                                  Filter: (ctid = '(1,1)'::tid)
2113                      ->  Seq Scan on r1
2114                            Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2115                ->  Tid Scan on t1
2116                      TID Cond: (ctid = '(1,1)'::tid)
2117          ->  Bitmap Heap Scan on t4
2118                Recheck Cond: (c1 = t1.c1)
2119                Filter: (ctid = '(1,1)'::tid)
2120                ->  Bitmap Index Scan on t4_pkey
2121                      Index Cond: (c1 = t1.c1)
2122 (20 rows)
2123
2124 EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2125                            QUERY PLAN                            
2126 -----------------------------------------------------------------
2127  Aggregate
2128    ->  Nested Loop
2129          Join Filter: (b1t1.c1 = b1t4.c1)
2130          ->  Nested Loop
2131                Join Filter: (b1t1.c1 = b1t3.c1)
2132                ->  Nested Loop
2133                      Join Filter: (b1t2.c1 = b1t1.c1)
2134                      ->  Nested Loop
2135                            ->  Tid Scan on r1_
2136                                  TID Cond: (ctid = '(1,1)'::tid)
2137                                  Filter: (c1 = 1)
2138                            ->  Seq Scan on t2 b1t2
2139                                  Filter: (ctid = '(1,1)'::tid)
2140                      ->  Tid Scan on t1 b1t1
2141                            TID Cond: (ctid = '(1,1)'::tid)
2142                ->  Tid Scan on t3 b1t3
2143                      TID Cond: (ctid = '(1,1)'::tid)
2144          ->  Tid Scan on t4 b1t4
2145                TID Cond: (ctid = '(1,1)'::tid)
2146 (19 rows)
2147
2148 /*+TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
2149 SeqScan(r1_)*/
2150 EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2151 LOG:  pg_hint_plan:
2152 used hint:
2153 TidScan(b1t1)
2154 SeqScan(b1t2)
2155 IndexScan(b1t3 t3_pkey)
2156 BitmapScan(b1t4 t4_pkey)
2157 SeqScan(r1_)
2158 not used hint:
2159 duplication hint:
2160 error hint:
2161
2162                                QUERY PLAN                               
2163 ------------------------------------------------------------------------
2164  Aggregate
2165    ->  Nested Loop
2166          ->  Nested Loop
2167                Join Filter: (b1t2.c1 = b1t1.c1)
2168                ->  Nested Loop
2169                      ->  Nested Loop
2170                            ->  Seq Scan on t2 b1t2
2171                                  Filter: (ctid = '(1,1)'::tid)
2172                            ->  Index Scan using t3_pkey on t3 b1t3
2173                                  Index Cond: (c1 = b1t2.c1)
2174                                  Filter: (ctid = '(1,1)'::tid)
2175                      ->  Seq Scan on r1_
2176                            Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2177                ->  Tid Scan on t1 b1t1
2178                      TID Cond: (ctid = '(1,1)'::tid)
2179          ->  Bitmap Heap Scan on t4 b1t4
2180                Recheck Cond: (c1 = b1t1.c1)
2181                Filter: (ctid = '(1,1)'::tid)
2182                ->  Bitmap Index Scan on t4_pkey
2183                      Index Cond: (c1 = b1t1.c1)
2184 (20 rows)
2185
2186 -- No. S-2-3-2
2187 EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2188                            QUERY PLAN                            
2189 -----------------------------------------------------------------
2190  Aggregate
2191    ->  Nested Loop
2192          Join Filter: (t1.c1 = t4.c1)
2193          ->  Nested Loop
2194                Join Filter: (t1.c1 = t3.c1)
2195                ->  Nested Loop
2196                      Join Filter: (t2.c1 = t1.c1)
2197                      ->  Nested Loop
2198                            ->  Tid Scan on r2
2199                                  TID Cond: (ctid = '(1,1)'::tid)
2200                                  Filter: (c1 = 1)
2201                            ->  Seq Scan on t2
2202                                  Filter: (ctid = '(1,1)'::tid)
2203                      ->  Tid Scan on t1
2204                            TID Cond: (ctid = '(1,1)'::tid)
2205                ->  Tid Scan on t3
2206                      TID Cond: (ctid = '(1,1)'::tid)
2207          ->  Tid Scan on t4
2208                TID Cond: (ctid = '(1,1)'::tid)
2209  
2210  Aggregate
2211    ->  Nested Loop
2212          Join Filter: (t1.c1 = t4.c1)
2213          ->  Nested Loop
2214                Join Filter: (t1.c1 = t3.c1)
2215                ->  Nested Loop
2216                      Join Filter: (t2.c1 = t1.c1)
2217                      ->  Nested Loop
2218                            ->  Tid Scan on r2
2219                                  TID Cond: (ctid = '(1,1)'::tid)
2220                                  Filter: (c1 = 1)
2221                            ->  Seq Scan on t2
2222                                  Filter: (ctid = '(1,1)'::tid)
2223                      ->  Tid Scan on t1
2224                            TID Cond: (ctid = '(1,1)'::tid)
2225                ->  Tid Scan on t3
2226                      TID Cond: (ctid = '(1,1)'::tid)
2227          ->  Tid Scan on t4
2228                TID Cond: (ctid = '(1,1)'::tid)
2229 (39 rows)
2230
2231 /*+TidScan(t1)SeqScan(t2)IndexScan(t3 t3_pkey)BitmapScan(t4 t4_pkey)
2232 SeqScan(r2)*/
2233 EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2234 LOG:  pg_hint_plan:
2235 used hint:
2236 SeqScan(r2)
2237 TidScan(t1)
2238 SeqScan(t2)
2239 IndexScan(t3 t3_pkey)
2240 BitmapScan(t4 t4_pkey)
2241 not used hint:
2242 duplication hint:
2243 error hint:
2244
2245 LOG:  pg_hint_plan:
2246 used hint:
2247 SeqScan(r2)
2248 TidScan(t1)
2249 SeqScan(t2)
2250 IndexScan(t3 t3_pkey)
2251 BitmapScan(t4 t4_pkey)
2252 not used hint:
2253 duplication hint:
2254 error hint:
2255
2256                                QUERY PLAN                               
2257 ------------------------------------------------------------------------
2258  Aggregate
2259    ->  Nested Loop
2260          ->  Nested Loop
2261                Join Filter: (t2.c1 = t1.c1)
2262                ->  Nested Loop
2263                      ->  Nested Loop
2264                            ->  Seq Scan on t2
2265                                  Filter: (ctid = '(1,1)'::tid)
2266                            ->  Index Scan using t3_pkey on t3
2267                                  Index Cond: (c1 = t2.c1)
2268                                  Filter: (ctid = '(1,1)'::tid)
2269                      ->  Seq Scan on r2
2270                            Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2271                ->  Tid Scan on t1
2272                      TID Cond: (ctid = '(1,1)'::tid)
2273          ->  Bitmap Heap Scan on t4
2274                Recheck Cond: (c1 = t1.c1)
2275                Filter: (ctid = '(1,1)'::tid)
2276                ->  Bitmap Index Scan on t4_pkey
2277                      Index Cond: (c1 = t1.c1)
2278  
2279  Aggregate
2280    ->  Nested Loop
2281          ->  Nested Loop
2282                Join Filter: (t2.c1 = t1.c1)
2283                ->  Nested Loop
2284                      ->  Nested Loop
2285                            ->  Seq Scan on t2
2286                                  Filter: (ctid = '(1,1)'::tid)
2287                            ->  Index Scan using t3_pkey on t3
2288                                  Index Cond: (c1 = t2.c1)
2289                                  Filter: (ctid = '(1,1)'::tid)
2290                      ->  Seq Scan on r2
2291                            Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2292                ->  Tid Scan on t1
2293                      TID Cond: (ctid = '(1,1)'::tid)
2294          ->  Bitmap Heap Scan on t4
2295                Recheck Cond: (c1 = t1.c1)
2296                Filter: (ctid = '(1,1)'::tid)
2297                ->  Bitmap Index Scan on t4_pkey
2298                      Index Cond: (c1 = t1.c1)
2299 (41 rows)
2300
2301 EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2302                            QUERY PLAN                            
2303 -----------------------------------------------------------------
2304  Aggregate
2305    ->  Nested Loop
2306          Join Filter: (b1t1.c1 = b1t4.c1)
2307          ->  Nested Loop
2308                Join Filter: (b1t1.c1 = b1t3.c1)
2309                ->  Nested Loop
2310                      Join Filter: (b1t2.c1 = b1t1.c1)
2311                      ->  Nested Loop
2312                            ->  Tid Scan on r2_
2313                                  TID Cond: (ctid = '(1,1)'::tid)
2314                                  Filter: (c1 = 1)
2315                            ->  Seq Scan on t2 b1t2
2316                                  Filter: (ctid = '(1,1)'::tid)
2317                      ->  Tid Scan on t1 b1t1
2318                            TID Cond: (ctid = '(1,1)'::tid)
2319                ->  Tid Scan on t3 b1t3
2320                      TID Cond: (ctid = '(1,1)'::tid)
2321          ->  Tid Scan on t4 b1t4
2322                TID Cond: (ctid = '(1,1)'::tid)
2323  
2324  Aggregate
2325    ->  Nested Loop
2326          Join Filter: (b2t1.c1 = b2t4.c1)
2327          ->  Nested Loop
2328                Join Filter: (b2t1.c1 = b2t3.c1)
2329                ->  Nested Loop
2330                      Join Filter: (b2t2.c1 = b2t1.c1)
2331                      ->  Nested Loop
2332                            ->  Tid Scan on r2_
2333                                  TID Cond: (ctid = '(1,1)'::tid)
2334                                  Filter: (c1 = 1)
2335                            ->  Seq Scan on t2 b2t2
2336                                  Filter: (ctid = '(1,1)'::tid)
2337                      ->  Tid Scan on t1 b2t1
2338                            TID Cond: (ctid = '(1,1)'::tid)
2339                ->  Tid Scan on t3 b2t3
2340                      TID Cond: (ctid = '(1,1)'::tid)
2341          ->  Tid Scan on t4 b2t4
2342                TID Cond: (ctid = '(1,1)'::tid)
2343 (39 rows)
2344
2345 /*+TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
2346 BitmapScan(b2t1 t1_pkey)TidScan(b2t2)SeqScan(b2t3)IndexScan(b2t4 t4_pkey)
2347 SeqScan(r2_)*/
2348 EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2349 LOG:  pg_hint_plan:
2350 used hint:
2351 TidScan(b1t1)
2352 SeqScan(b1t2)
2353 IndexScan(b1t3 t3_pkey)
2354 BitmapScan(b1t4 t4_pkey)
2355 SeqScan(r2_)
2356 not used hint:
2357 BitmapScan(b2t1 t1_pkey)
2358 TidScan(b2t2)
2359 SeqScan(b2t3)
2360 IndexScan(b2t4 t4_pkey)
2361 duplication hint:
2362 error hint:
2363
2364 LOG:  pg_hint_plan:
2365 used hint:
2366 BitmapScan(b2t1 t1_pkey)
2367 TidScan(b2t2)
2368 SeqScan(b2t3)
2369 IndexScan(b2t4 t4_pkey)
2370 SeqScan(r2_)
2371 not used hint:
2372 TidScan(b1t1)
2373 SeqScan(b1t2)
2374 IndexScan(b1t3 t3_pkey)
2375 BitmapScan(b1t4 t4_pkey)
2376 duplication hint:
2377 error hint:
2378
2379                                QUERY PLAN                               
2380 ------------------------------------------------------------------------
2381  Aggregate
2382    ->  Nested Loop
2383          ->  Nested Loop
2384                Join Filter: (b1t2.c1 = b1t1.c1)
2385                ->  Nested Loop
2386                      ->  Nested Loop
2387                            ->  Seq Scan on t2 b1t2
2388                                  Filter: (ctid = '(1,1)'::tid)
2389                            ->  Index Scan using t3_pkey on t3 b1t3
2390                                  Index Cond: (c1 = b1t2.c1)
2391                                  Filter: (ctid = '(1,1)'::tid)
2392                      ->  Seq Scan on r2_
2393                            Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2394                ->  Tid Scan on t1 b1t1
2395                      TID Cond: (ctid = '(1,1)'::tid)
2396          ->  Bitmap Heap Scan on t4 b1t4
2397                Recheck Cond: (c1 = b1t1.c1)
2398                Filter: (ctid = '(1,1)'::tid)
2399                ->  Bitmap Index Scan on t4_pkey
2400                      Index Cond: (c1 = b1t1.c1)
2401  
2402  Aggregate
2403    ->  Nested Loop
2404          ->  Nested Loop
2405                ->  Nested Loop
2406                      ->  Nested Loop
2407                            Join Filter: (b2t2.c1 = b2t3.c1)
2408                            ->  Tid Scan on t2 b2t2
2409                                  TID Cond: (ctid = '(1,1)'::tid)
2410                            ->  Seq Scan on t3 b2t3
2411                                  Filter: (ctid = '(1,1)'::tid)
2412                      ->  Seq Scan on r2_
2413                            Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2414                ->  Bitmap Heap Scan on t1 b2t1
2415                      Recheck Cond: (c1 = b2t2.c1)
2416                      Filter: (ctid = '(1,1)'::tid)
2417                      ->  Bitmap Index Scan on t1_pkey
2418                            Index Cond: (c1 = b2t2.c1)
2419          ->  Index Scan using t4_pkey on t4 b2t4
2420                Index Cond: (c1 = b2t1.c1)
2421                Filter: (ctid = '(1,1)'::tid)
2422 (41 rows)
2423
2424 -- No. S-2-3-3
2425 EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2426                            QUERY PLAN                            
2427 -----------------------------------------------------------------
2428  Aggregate
2429    ->  Nested Loop
2430          Join Filter: (t1.c1 = t4.c1)
2431          ->  Nested Loop
2432                Join Filter: (t1.c1 = t3.c1)
2433                ->  Nested Loop
2434                      Join Filter: (t2.c1 = t1.c1)
2435                      ->  Nested Loop
2436                            ->  Tid Scan on r3
2437                                  TID Cond: (ctid = '(1,1)'::tid)
2438                                  Filter: (c1 = 1)
2439                            ->  Seq Scan on t2
2440                                  Filter: (ctid = '(1,1)'::tid)
2441                      ->  Tid Scan on t1
2442                            TID Cond: (ctid = '(1,1)'::tid)
2443                ->  Tid Scan on t3
2444                      TID Cond: (ctid = '(1,1)'::tid)
2445          ->  Tid Scan on t4
2446                TID Cond: (ctid = '(1,1)'::tid)
2447  
2448  Aggregate
2449    ->  Nested Loop
2450          Join Filter: (t1.c1 = t4.c1)
2451          ->  Nested Loop
2452                Join Filter: (t1.c1 = t3.c1)
2453                ->  Nested Loop
2454                      Join Filter: (t2.c1 = t1.c1)
2455                      ->  Nested Loop
2456                            ->  Tid Scan on r3
2457                                  TID Cond: (ctid = '(1,1)'::tid)
2458                                  Filter: (c1 = 1)
2459                            ->  Seq Scan on t2
2460                                  Filter: (ctid = '(1,1)'::tid)
2461                      ->  Tid Scan on t1
2462                            TID Cond: (ctid = '(1,1)'::tid)
2463                ->  Tid Scan on t3
2464                      TID Cond: (ctid = '(1,1)'::tid)
2465          ->  Tid Scan on t4
2466                TID Cond: (ctid = '(1,1)'::tid)
2467  
2468  Aggregate
2469    ->  Nested Loop
2470          Join Filter: (t1.c1 = t4.c1)
2471          ->  Nested Loop
2472                Join Filter: (t1.c1 = t3.c1)
2473                ->  Nested Loop
2474                      Join Filter: (t2.c1 = t1.c1)
2475                      ->  Nested Loop
2476                            ->  Tid Scan on r3
2477                                  TID Cond: (ctid = '(1,1)'::tid)
2478                                  Filter: (c1 = 1)
2479                            ->  Seq Scan on t2
2480                                  Filter: (ctid = '(1,1)'::tid)
2481                      ->  Tid Scan on t1
2482                            TID Cond: (ctid = '(1,1)'::tid)
2483                ->  Tid Scan on t3
2484                      TID Cond: (ctid = '(1,1)'::tid)
2485          ->  Tid Scan on t4
2486                TID Cond: (ctid = '(1,1)'::tid)
2487 (59 rows)
2488
2489 /*+TidScan(t1)SeqScan(t2)IndexScan(t3 t3_pkey)BitmapScan(t4 t4_pkey)
2490 SeqScan(r3)*/
2491 EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2492 LOG:  pg_hint_plan:
2493 used hint:
2494 SeqScan(r3)
2495 TidScan(t1)
2496 SeqScan(t2)
2497 IndexScan(t3 t3_pkey)
2498 BitmapScan(t4 t4_pkey)
2499 not used hint:
2500 duplication hint:
2501 error hint:
2502
2503 LOG:  pg_hint_plan:
2504 used hint:
2505 SeqScan(r3)
2506 TidScan(t1)
2507 SeqScan(t2)
2508 IndexScan(t3 t3_pkey)
2509 BitmapScan(t4 t4_pkey)
2510 not used hint:
2511 duplication hint:
2512 error hint:
2513
2514 LOG:  pg_hint_plan:
2515 used hint:
2516 SeqScan(r3)
2517 TidScan(t1)
2518 SeqScan(t2)
2519 IndexScan(t3 t3_pkey)
2520 BitmapScan(t4 t4_pkey)
2521 not used hint:
2522 duplication hint:
2523 error hint:
2524
2525                                QUERY PLAN                               
2526 ------------------------------------------------------------------------
2527  Aggregate
2528    ->  Nested Loop
2529          ->  Nested Loop
2530                Join Filter: (t2.c1 = t1.c1)
2531                ->  Nested Loop
2532                      ->  Nested Loop
2533                            ->  Seq Scan on t2
2534                                  Filter: (ctid = '(1,1)'::tid)
2535                            ->  Index Scan using t3_pkey on t3
2536                                  Index Cond: (c1 = t2.c1)
2537                                  Filter: (ctid = '(1,1)'::tid)
2538                      ->  Seq Scan on r3
2539                            Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2540                ->  Tid Scan on t1
2541                      TID Cond: (ctid = '(1,1)'::tid)
2542          ->  Bitmap Heap Scan on t4
2543                Recheck Cond: (c1 = t1.c1)
2544                Filter: (ctid = '(1,1)'::tid)
2545                ->  Bitmap Index Scan on t4_pkey
2546                      Index Cond: (c1 = t1.c1)
2547  
2548  Aggregate
2549    ->  Nested Loop
2550          ->  Nested Loop
2551                Join Filter: (t2.c1 = t1.c1)
2552                ->  Nested Loop
2553                      ->  Nested Loop
2554                            ->  Seq Scan on t2
2555                                  Filter: (ctid = '(1,1)'::tid)
2556                            ->  Index Scan using t3_pkey on t3
2557                                  Index Cond: (c1 = t2.c1)
2558                                  Filter: (ctid = '(1,1)'::tid)
2559                      ->  Seq Scan on r3
2560                            Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2561                ->  Tid Scan on t1
2562                      TID Cond: (ctid = '(1,1)'::tid)
2563          ->  Bitmap Heap Scan on t4
2564                Recheck Cond: (c1 = t1.c1)
2565                Filter: (ctid = '(1,1)'::tid)
2566                ->  Bitmap Index Scan on t4_pkey
2567                      Index Cond: (c1 = t1.c1)
2568  
2569  Aggregate
2570    ->  Nested Loop
2571          ->  Nested Loop
2572                Join Filter: (t2.c1 = t1.c1)
2573                ->  Nested Loop
2574                      ->  Nested Loop
2575                            ->  Seq Scan on t2
2576                                  Filter: (ctid = '(1,1)'::tid)
2577                            ->  Index Scan using t3_pkey on t3
2578                                  Index Cond: (c1 = t2.c1)
2579                                  Filter: (ctid = '(1,1)'::tid)
2580                      ->  Seq Scan on r3
2581                            Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2582                ->  Tid Scan on t1
2583                      TID Cond: (ctid = '(1,1)'::tid)
2584          ->  Bitmap Heap Scan on t4
2585                Recheck Cond: (c1 = t1.c1)
2586                Filter: (ctid = '(1,1)'::tid)
2587                ->  Bitmap Index Scan on t4_pkey
2588                      Index Cond: (c1 = t1.c1)
2589 (62 rows)
2590
2591 EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2592                            QUERY PLAN                            
2593 -----------------------------------------------------------------
2594  Aggregate
2595    ->  Nested Loop
2596          Join Filter: (b1t1.c1 = b1t4.c1)
2597          ->  Nested Loop
2598                Join Filter: (b1t1.c1 = b1t3.c1)
2599                ->  Nested Loop
2600                      Join Filter: (b1t2.c1 = b1t1.c1)
2601                      ->  Nested Loop
2602                            ->  Tid Scan on r3_
2603                                  TID Cond: (ctid = '(1,1)'::tid)
2604                                  Filter: (c1 = 1)
2605                            ->  Seq Scan on t2 b1t2
2606                                  Filter: (ctid = '(1,1)'::tid)
2607                      ->  Tid Scan on t1 b1t1
2608                            TID Cond: (ctid = '(1,1)'::tid)
2609                ->  Tid Scan on t3 b1t3
2610                      TID Cond: (ctid = '(1,1)'::tid)
2611          ->  Tid Scan on t4 b1t4
2612                TID Cond: (ctid = '(1,1)'::tid)
2613  
2614  Aggregate
2615    ->  Nested Loop
2616          Join Filter: (b2t1.c1 = b2t4.c1)
2617          ->  Nested Loop
2618                Join Filter: (b2t1.c1 = b2t3.c1)
2619                ->  Nested Loop
2620                      Join Filter: (b2t2.c1 = b2t1.c1)
2621                      ->  Nested Loop
2622                            ->  Tid Scan on r3_
2623                                  TID Cond: (ctid = '(1,1)'::tid)
2624                                  Filter: (c1 = 1)
2625                            ->  Seq Scan on t2 b2t2
2626                                  Filter: (ctid = '(1,1)'::tid)
2627                      ->  Tid Scan on t1 b2t1
2628                            TID Cond: (ctid = '(1,1)'::tid)
2629                ->  Tid Scan on t3 b2t3
2630                      TID Cond: (ctid = '(1,1)'::tid)
2631          ->  Tid Scan on t4 b2t4
2632                TID Cond: (ctid = '(1,1)'::tid)
2633  
2634  Aggregate
2635    ->  Nested Loop
2636          Join Filter: (b3t1.c1 = b3t4.c1)
2637          ->  Nested Loop
2638                Join Filter: (b3t1.c1 = b3t3.c1)
2639                ->  Nested Loop
2640                      Join Filter: (b3t2.c1 = b3t1.c1)
2641                      ->  Nested Loop
2642                            ->  Tid Scan on r3_
2643                                  TID Cond: (ctid = '(1,1)'::tid)
2644                                  Filter: (c1 = 1)
2645                            ->  Seq Scan on t2 b3t2
2646                                  Filter: (ctid = '(1,1)'::tid)
2647                      ->  Tid Scan on t1 b3t1
2648                            TID Cond: (ctid = '(1,1)'::tid)
2649                ->  Tid Scan on t3 b3t3
2650                      TID Cond: (ctid = '(1,1)'::tid)
2651          ->  Tid Scan on t4 b3t4
2652                TID Cond: (ctid = '(1,1)'::tid)
2653 (59 rows)
2654
2655 /*+TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
2656 BitmapScan(b2t1 t1_pkey)TidScan(b2t2)SeqScan(b2t3)IndexScan(b2t4 t4_pkey)
2657 IndexScan(b3t1 t1_pkey)BitmapScan(b3t2 t2_pkey)TidScan(b3t3)SeqScan(b3t4)
2658 SeqScan(r3_)*/
2659 EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2660 LOG:  pg_hint_plan:
2661 used hint:
2662 TidScan(b1t1)
2663 SeqScan(b1t2)
2664 IndexScan(b1t3 t3_pkey)
2665 BitmapScan(b1t4 t4_pkey)
2666 SeqScan(r3_)
2667 not used hint:
2668 BitmapScan(b2t1 t1_pkey)
2669 TidScan(b2t2)
2670 SeqScan(b2t3)
2671 IndexScan(b2t4 t4_pkey)
2672 IndexScan(b3t1 t1_pkey)
2673 BitmapScan(b3t2 t2_pkey)
2674 TidScan(b3t3)
2675 SeqScan(b3t4)
2676 duplication hint:
2677 error hint:
2678
2679 LOG:  pg_hint_plan:
2680 used hint:
2681 BitmapScan(b2t1 t1_pkey)
2682 TidScan(b2t2)
2683 SeqScan(b2t3)
2684 IndexScan(b2t4 t4_pkey)
2685 SeqScan(r3_)
2686 not used hint:
2687 TidScan(b1t1)
2688 SeqScan(b1t2)
2689 IndexScan(b1t3 t3_pkey)
2690 BitmapScan(b1t4 t4_pkey)
2691 IndexScan(b3t1 t1_pkey)
2692 BitmapScan(b3t2 t2_pkey)
2693 TidScan(b3t3)
2694 SeqScan(b3t4)
2695 duplication hint:
2696 error hint:
2697
2698 LOG:  pg_hint_plan:
2699 used hint:
2700 IndexScan(b3t1 t1_pkey)
2701 BitmapScan(b3t2 t2_pkey)
2702 TidScan(b3t3)
2703 SeqScan(b3t4)
2704 SeqScan(r3_)
2705 not used hint:
2706 TidScan(b1t1)
2707 SeqScan(b1t2)
2708 IndexScan(b1t3 t3_pkey)
2709 BitmapScan(b1t4 t4_pkey)
2710 BitmapScan(b2t1 t1_pkey)
2711 TidScan(b2t2)
2712 SeqScan(b2t3)
2713 IndexScan(b2t4 t4_pkey)
2714 duplication hint:
2715 error hint:
2716
2717                                QUERY PLAN                               
2718 ------------------------------------------------------------------------
2719  Aggregate
2720    ->  Nested Loop
2721          ->  Nested Loop
2722                Join Filter: (b1t2.c1 = b1t1.c1)
2723                ->  Nested Loop
2724                      ->  Nested Loop
2725                            ->  Seq Scan on t2 b1t2
2726                                  Filter: (ctid = '(1,1)'::tid)
2727                            ->  Index Scan using t3_pkey on t3 b1t3
2728                                  Index Cond: (c1 = b1t2.c1)
2729                                  Filter: (ctid = '(1,1)'::tid)
2730                      ->  Seq Scan on r3_
2731                            Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2732                ->  Tid Scan on t1 b1t1
2733                      TID Cond: (ctid = '(1,1)'::tid)
2734          ->  Bitmap Heap Scan on t4 b1t4
2735                Recheck Cond: (c1 = b1t1.c1)
2736                Filter: (ctid = '(1,1)'::tid)
2737                ->  Bitmap Index Scan on t4_pkey
2738                      Index Cond: (c1 = b1t1.c1)
2739  
2740  Aggregate
2741    ->  Nested Loop
2742          ->  Nested Loop
2743                ->  Nested Loop
2744                      ->  Nested Loop
2745                            Join Filter: (b2t2.c1 = b2t3.c1)
2746                            ->  Tid Scan on t2 b2t2
2747                                  TID Cond: (ctid = '(1,1)'::tid)
2748                            ->  Seq Scan on t3 b2t3
2749                                  Filter: (ctid = '(1,1)'::tid)
2750                      ->  Seq Scan on r3_
2751                            Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2752                ->  Bitmap Heap Scan on t1 b2t1
2753                      Recheck Cond: (c1 = b2t2.c1)
2754                      Filter: (ctid = '(1,1)'::tid)
2755                      ->  Bitmap Index Scan on t1_pkey
2756                            Index Cond: (c1 = b2t2.c1)
2757          ->  Index Scan using t4_pkey on t4 b2t4
2758                Index Cond: (c1 = b2t1.c1)
2759                Filter: (ctid = '(1,1)'::tid)
2760  
2761  Aggregate
2762    ->  Nested Loop
2763          Join Filter: (b3t1.c1 = b3t4.c1)
2764          ->  Nested Loop
2765                ->  Nested Loop
2766                      ->  Nested Loop
2767                            ->  Tid Scan on t3 b3t3
2768                                  TID Cond: (ctid = '(1,1)'::tid)
2769                            ->  Bitmap Heap Scan on t2 b3t2
2770                                  Recheck Cond: (c1 = b3t3.c1)
2771                                  Filter: (ctid = '(1,1)'::tid)
2772                                  ->  Bitmap Index Scan on t2_pkey
2773                                        Index Cond: (c1 = b3t3.c1)
2774                      ->  Seq Scan on r3_
2775                            Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2776                ->  Index Scan using t1_pkey on t1 b3t1
2777                      Index Cond: (c1 = b3t2.c1)
2778                      Filter: (ctid = '(1,1)'::tid)
2779          ->  Seq Scan on t4 b3t4
2780                Filter: (ctid = '(1,1)'::tid)
2781 (62 rows)
2782
2783 ----
2784 ---- No. S-2-4 VALUES clause
2785 ----
2786 -- No. S-2-4-1
2787 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1) WHERE t1.c1 = 1;
2788         QUERY PLAN         
2789 ---------------------------
2790  Values Scan on "*VALUES*"
2791    Filter: (column1 = 1)
2792 (2 rows)
2793
2794 /*+SeqScan(t1)*/
2795 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1) WHERE t1.c1 = 1;
2796 LOG:  pg_hint_plan:
2797 used hint:
2798 not used hint:
2799 SeqScan(t1)
2800 duplication hint:
2801 error hint:
2802
2803         QUERY PLAN         
2804 ---------------------------
2805  Values Scan on "*VALUES*"
2806    Filter: (column1 = 1)
2807 (2 rows)
2808
2809 /*+SeqScan(*VALUES*)*/
2810 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1) WHERE t1.c1 = 1;
2811 LOG:  pg_hint_plan:
2812 used hint:
2813 not used hint:
2814 SeqScan(*VALUES*)
2815 duplication hint:
2816 error hint:
2817
2818         QUERY PLAN         
2819 ---------------------------
2820  Values Scan on "*VALUES*"
2821    Filter: (column1 = 1)
2822 (2 rows)
2823
2824 -- No. S-2-4-2
2825 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t2 (c1, c2) WHERE t1.c1 = t2.c1;
2826                         QUERY PLAN                        
2827 ----------------------------------------------------------
2828  Nested Loop
2829    Join Filter: ("*VALUES*".column1 = "*VALUES*".column1)
2830    ->  Values Scan on "*VALUES*"
2831    ->  Values Scan on "*VALUES*"
2832 (4 rows)
2833
2834 /*+SeqScan(t1 t2)*/
2835 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t2 (c1, c2) WHERE t1.c1 = t2.c1;
2836 INFO:  hint syntax error at or near "t2)"
2837 DETAIL:  Closing parenthesis is necessary.
2838                         QUERY PLAN                        
2839 ----------------------------------------------------------
2840  Nested Loop
2841    Join Filter: ("*VALUES*".column1 = "*VALUES*".column1)
2842    ->  Values Scan on "*VALUES*"
2843    ->  Values Scan on "*VALUES*"
2844 (4 rows)
2845
2846 /*+SeqScan(*VALUES*)*/
2847 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t2 (c1, c2) WHERE t1.c1 = t2.c1;
2848 LOG:  pg_hint_plan:
2849 used hint:
2850 not used hint:
2851 SeqScan(*VALUES*)
2852 duplication hint:
2853 error hint:
2854
2855                         QUERY PLAN                        
2856 ----------------------------------------------------------
2857  Nested Loop
2858    Join Filter: ("*VALUES*".column1 = "*VALUES*".column1)
2859    ->  Values Scan on "*VALUES*"
2860    ->  Values Scan on "*VALUES*"
2861 (4 rows)
2862
2863 ----
2864 ---- No. S-3-1 scan method hint
2865 ----
2866 -- No. S-3-1-1
2867 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
2868      QUERY PLAN      
2869 ---------------------
2870  Seq Scan on t1
2871    Filter: (c1 >= 1)
2872 (2 rows)
2873
2874 /*+SeqScan(t1)*/
2875 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
2876 LOG:  pg_hint_plan:
2877 used hint:
2878 SeqScan(t1)
2879 not used hint:
2880 duplication hint:
2881 error hint:
2882
2883      QUERY PLAN      
2884 ---------------------
2885  Seq Scan on t1
2886    Filter: (c1 >= 1)
2887 (2 rows)
2888
2889 -- No. S-3-1-2
2890 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2891           QUERY PLAN          
2892 ------------------------------
2893  Index Scan using t1_i1 on t1
2894    Index Cond: (c1 = 1)
2895 (2 rows)
2896
2897 /*+SeqScan(t1)*/
2898 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2899 LOG:  pg_hint_plan:
2900 used hint:
2901 SeqScan(t1)
2902 not used hint:
2903 duplication hint:
2904 error hint:
2905
2906      QUERY PLAN     
2907 --------------------
2908  Seq Scan on t1
2909    Filter: (c1 = 1)
2910 (2 rows)
2911
2912 -- No. S-3-1-3
2913 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2914           QUERY PLAN          
2915 ------------------------------
2916  Index Scan using t1_i1 on t1
2917    Index Cond: (c1 = 1)
2918 (2 rows)
2919
2920 /*+IndexScan(t1)*/
2921 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2922 LOG:  pg_hint_plan:
2923 used hint:
2924 IndexScan(t1)
2925 not used hint:
2926 duplication hint:
2927 error hint:
2928
2929           QUERY PLAN          
2930 ------------------------------
2931  Index Scan using t1_i1 on t1
2932    Index Cond: (c1 = 1)
2933 (2 rows)
2934
2935 -- No. S-3-1-4
2936 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
2937      QUERY PLAN      
2938 ---------------------
2939  Seq Scan on t1
2940    Filter: (c1 >= 1)
2941 (2 rows)
2942
2943 /*+IndexScan(t1)*/
2944 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
2945 LOG:  pg_hint_plan:
2946 used hint:
2947 IndexScan(t1)
2948 not used hint:
2949 duplication hint:
2950 error hint:
2951
2952           QUERY PLAN          
2953 ------------------------------
2954  Index Scan using t1_i1 on t1
2955    Index Cond: (c1 >= 1)
2956 (2 rows)
2957
2958 -- No. S-3-1-5
2959 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
2960            QUERY PLAN            
2961 ---------------------------------
2962  Bitmap Heap Scan on t1
2963    Recheck Cond: (c3 < 10)
2964    ->  Bitmap Index Scan on t1_i
2965          Index Cond: (c3 < 10)
2966 (4 rows)
2967
2968 /*+BitmapScan(t1)*/
2969 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
2970 LOG:  pg_hint_plan:
2971 used hint:
2972 BitmapScan(t1)
2973 not used hint:
2974 duplication hint:
2975 error hint:
2976
2977            QUERY PLAN            
2978 ---------------------------------
2979  Bitmap Heap Scan on t1
2980    Recheck Cond: (c3 < 10)
2981    ->  Bitmap Index Scan on t1_i
2982          Index Cond: (c3 < 10)
2983 (4 rows)
2984
2985 -- No. S-3-1-6
2986 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2987           QUERY PLAN          
2988 ------------------------------
2989  Index Scan using t1_i1 on t1
2990    Index Cond: (c1 = 1)
2991 (2 rows)
2992
2993 /*+BitmapScan(t1)*/
2994 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2995 LOG:  pg_hint_plan:
2996 used hint:
2997 BitmapScan(t1)
2998 not used hint:
2999 duplication hint:
3000 error hint:
3001
3002             QUERY PLAN            
3003 ----------------------------------
3004  Bitmap Heap Scan on t1
3005    Recheck Cond: (c1 = 1)
3006    ->  Bitmap Index Scan on t1_i1
3007          Index Cond: (c1 = 1)
3008 (4 rows)
3009
3010 -- No. S-3-1-7
3011 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3012             QUERY PLAN             
3013 -----------------------------------
3014  Tid Scan on t1
3015    TID Cond: (ctid = '(1,1)'::tid)
3016    Filter: (c1 = 1)
3017 (3 rows)
3018
3019 /*+TidScan(t1)*/
3020 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3021 LOG:  pg_hint_plan:
3022 used hint:
3023 TidScan(t1)
3024 not used hint:
3025 duplication hint:
3026 error hint:
3027
3028             QUERY PLAN             
3029 -----------------------------------
3030  Tid Scan on t1
3031    TID Cond: (ctid = '(1,1)'::tid)
3032    Filter: (c1 = 1)
3033 (3 rows)
3034
3035 -- No. S-3-1-8
3036 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid IN ('(1,1)', '(2,2)', '(3,3)');
3037                          QUERY PLAN                          
3038 -------------------------------------------------------------
3039  Index Scan using t1_i1 on t1
3040    Index Cond: (c1 = 1)
3041    Filter: (ctid = ANY ('{"(1,1)","(2,2)","(3,3)"}'::tid[]))
3042 (3 rows)
3043
3044 /*+TidScan(t1)*/
3045 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid IN ('(1,1)', '(2,2)', '(3,3)');
3046 LOG:  pg_hint_plan:
3047 used hint:
3048 TidScan(t1)
3049 not used hint:
3050 duplication hint:
3051 error hint:
3052
3053                           QUERY PLAN                           
3054 ---------------------------------------------------------------
3055  Tid Scan on t1
3056    TID Cond: (ctid = ANY ('{"(1,1)","(2,2)","(3,3)"}'::tid[]))
3057    Filter: (c1 = 1)
3058 (3 rows)
3059
3060 -- No. S-3-1-9
3061 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3062      QUERY PLAN      
3063 ---------------------
3064  Seq Scan on t1
3065    Filter: (c1 >= 1)
3066 (2 rows)
3067
3068 /*+NoSeqScan(t1)*/
3069 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3070 LOG:  pg_hint_plan:
3071 used hint:
3072 NoSeqScan(t1)
3073 not used hint:
3074 duplication hint:
3075 error hint:
3076
3077           QUERY PLAN          
3078 ------------------------------
3079  Index Scan using t1_i1 on t1
3080    Index Cond: (c1 >= 1)
3081 (2 rows)
3082
3083 -- No. S-3-1-10
3084 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3085           QUERY PLAN          
3086 ------------------------------
3087  Index Scan using t1_i1 on t1
3088    Index Cond: (c1 = 1)
3089 (2 rows)
3090
3091 /*+NoSeqScan(t1)*/
3092 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3093 LOG:  pg_hint_plan:
3094 used hint:
3095 NoSeqScan(t1)
3096 not used hint:
3097 duplication hint:
3098 error hint:
3099
3100           QUERY PLAN          
3101 ------------------------------
3102  Index Scan using t1_i1 on t1
3103    Index Cond: (c1 = 1)
3104 (2 rows)
3105
3106 -- No. S-3-1-11
3107 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3108           QUERY PLAN          
3109 ------------------------------
3110  Index Scan using t1_i1 on t1
3111    Index Cond: (c1 = 1)
3112 (2 rows)
3113
3114 /*+NoIndexScan(t1)*/
3115 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3116 LOG:  pg_hint_plan:
3117 used hint:
3118 NoIndexScan(t1)
3119 not used hint:
3120 duplication hint:
3121 error hint:
3122
3123             QUERY PLAN            
3124 ----------------------------------
3125  Bitmap Heap Scan on t1
3126    Recheck Cond: (c1 = 1)
3127    ->  Bitmap Index Scan on t1_i1
3128          Index Cond: (c1 = 1)
3129 (4 rows)
3130
3131 -- No. S-3-1-12
3132 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3133      QUERY PLAN      
3134 ---------------------
3135  Seq Scan on t1
3136    Filter: (c1 >= 1)
3137 (2 rows)
3138
3139 /*+NoIndexScan(t1)*/
3140 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3141 LOG:  pg_hint_plan:
3142 used hint:
3143 NoIndexScan(t1)
3144 not used hint:
3145 duplication hint:
3146 error hint:
3147
3148      QUERY PLAN      
3149 ---------------------
3150  Seq Scan on t1
3151    Filter: (c1 >= 1)
3152 (2 rows)
3153
3154 -- No. S-3-1-13
3155 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
3156            QUERY PLAN            
3157 ---------------------------------
3158  Bitmap Heap Scan on t1
3159    Recheck Cond: (c3 < 10)
3160    ->  Bitmap Index Scan on t1_i
3161          Index Cond: (c3 < 10)
3162 (4 rows)
3163
3164 /*+NoBitmapScan(t1)*/
3165 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
3166 LOG:  pg_hint_plan:
3167 used hint:
3168 NoBitmapScan(t1)
3169 not used hint:
3170 duplication hint:
3171 error hint:
3172
3173      QUERY PLAN      
3174 ---------------------
3175  Seq Scan on t1
3176    Filter: (c3 < 10)
3177 (2 rows)
3178
3179 -- No. S-3-1-14
3180 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3181           QUERY PLAN          
3182 ------------------------------
3183  Index Scan using t1_i1 on t1
3184    Index Cond: (c1 = 1)
3185 (2 rows)
3186
3187 /*+NoBitmapScan(t1)*/
3188 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3189 LOG:  pg_hint_plan:
3190 used hint:
3191 NoBitmapScan(t1)
3192 not used hint:
3193 duplication hint:
3194 error hint:
3195
3196           QUERY PLAN          
3197 ------------------------------
3198  Index Scan using t1_i1 on t1
3199    Index Cond: (c1 = 1)
3200 (2 rows)
3201
3202 -- No. S-3-1-15
3203 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3204             QUERY PLAN             
3205 -----------------------------------
3206  Tid Scan on t1
3207    TID Cond: (ctid = '(1,1)'::tid)
3208    Filter: (c1 = 1)
3209 (3 rows)
3210
3211 /*+NoTidScan(t1)*/
3212 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3213 LOG:  pg_hint_plan:
3214 used hint:
3215 NoTidScan(t1)
3216 not used hint:
3217 duplication hint:
3218 error hint:
3219
3220            QUERY PLAN            
3221 ---------------------------------
3222  Index Scan using t1_i1 on t1
3223    Index Cond: (c1 = 1)
3224    Filter: (ctid = '(1,1)'::tid)
3225 (3 rows)
3226
3227 -- No. S-3-1-16
3228 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3229           QUERY PLAN          
3230 ------------------------------
3231  Index Scan using t1_i1 on t1
3232    Index Cond: (c1 = 1)
3233 (2 rows)
3234
3235 /*+NoTidScan(t1)*/
3236 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3237 LOG:  pg_hint_plan:
3238 used hint:
3239 NoTidScan(t1)
3240 not used hint:
3241 duplication hint:
3242 error hint:
3243
3244           QUERY PLAN          
3245 ------------------------------
3246  Index Scan using t1_i1 on t1
3247    Index Cond: (c1 = 1)
3248 (2 rows)
3249
3250 ----
3251 ---- No. S-3-3 index name specified
3252 ----
3253 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3254             QUERY PLAN             
3255 -----------------------------------
3256  Tid Scan on ti1
3257    TID Cond: (ctid = '(1,1)'::tid)
3258    Filter: (c2 = 1)
3259 (3 rows)
3260
3261 SET enable_tidscan TO off;
3262 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3263            QUERY PLAN            
3264 ---------------------------------
3265  Index Scan using ti1_i2 on ti1
3266    Index Cond: (c2 = 1)
3267    Filter: (ctid = '(1,1)'::tid)
3268 (3 rows)
3269
3270 SET enable_indexscan TO off;
3271 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3272             QUERY PLAN             
3273 -----------------------------------
3274  Bitmap Heap Scan on ti1
3275    Recheck Cond: (c2 = 1)
3276    Filter: (ctid = '(1,1)'::tid)
3277    ->  Bitmap Index Scan on ti1_i2
3278          Index Cond: (c2 = 1)
3279 (5 rows)
3280
3281 RESET enable_tidscan;
3282 RESET enable_indexscan;
3283 -- No. S-3-3-1
3284 /*+IndexScan(ti1 ti1_i3)*/
3285 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3286 LOG:  pg_hint_plan:
3287 used hint:
3288 IndexScan(ti1 ti1_i3)
3289 not used hint:
3290 duplication hint:
3291 error hint:
3292
3293            QUERY PLAN            
3294 ---------------------------------
3295  Index Scan using ti1_i3 on ti1
3296    Index Cond: (c2 = 1)
3297    Filter: (ctid = '(1,1)'::tid)
3298 (3 rows)
3299
3300 -- No. S-3-3-2
3301 /*+IndexScan(ti1 ti1_i3 ti1_i2)*/
3302 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3303 LOG:  pg_hint_plan:
3304 used hint:
3305 IndexScan(ti1 ti1_i3 ti1_i2)
3306 not used hint:
3307 duplication hint:
3308 error hint:
3309
3310            QUERY PLAN            
3311 ---------------------------------
3312  Index Scan using ti1_i2 on ti1
3313    Index Cond: (c2 = 1)
3314    Filter: (ctid = '(1,1)'::tid)
3315 (3 rows)
3316
3317 -- No. S-3-3-3
3318 /*+IndexScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)*/
3319 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3320 LOG:  pg_hint_plan:
3321 used hint:
3322 IndexScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)
3323 not used hint:
3324 duplication hint:
3325 error hint:
3326
3327            QUERY PLAN            
3328 ---------------------------------
3329  Index Scan using ti1_i2 on ti1
3330    Index Cond: (c2 = 1)
3331    Filter: (ctid = '(1,1)'::tid)
3332 (3 rows)
3333
3334 -- No. S-3-3-4
3335 /*+BitmapScan(ti1 ti1_i3)*/
3336 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3337 LOG:  pg_hint_plan:
3338 used hint:
3339 BitmapScan(ti1 ti1_i3)
3340 not used hint:
3341 duplication hint:
3342 error hint:
3343
3344             QUERY PLAN             
3345 -----------------------------------
3346  Bitmap Heap Scan on ti1
3347    Recheck Cond: (c2 = 1)
3348    Filter: (ctid = '(1,1)'::tid)
3349    ->  Bitmap Index Scan on ti1_i3
3350          Index Cond: (c2 = 1)
3351 (5 rows)
3352
3353 -- No. S-3-3-5
3354 /*+BitmapScan(ti1 ti1_i3 ti1_i2)*/
3355 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3356 LOG:  pg_hint_plan:
3357 used hint:
3358 BitmapScan(ti1 ti1_i3 ti1_i2)
3359 not used hint:
3360 duplication hint:
3361 error hint:
3362
3363             QUERY PLAN             
3364 -----------------------------------
3365  Bitmap Heap Scan on ti1
3366    Recheck Cond: (c2 = 1)
3367    Filter: (ctid = '(1,1)'::tid)
3368    ->  Bitmap Index Scan on ti1_i2
3369          Index Cond: (c2 = 1)
3370 (5 rows)
3371
3372 -- No. S-3-3-6
3373 /*+BitmapScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)*/
3374 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3375 LOG:  pg_hint_plan:
3376 used hint:
3377 BitmapScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)
3378 not used hint:
3379 duplication hint:
3380 error hint:
3381
3382             QUERY PLAN             
3383 -----------------------------------
3384  Bitmap Heap Scan on ti1
3385    Recheck Cond: (c2 = 1)
3386    Filter: (ctid = '(1,1)'::tid)
3387    ->  Bitmap Index Scan on ti1_i2
3388          Index Cond: (c2 = 1)
3389 (5 rows)
3390
3391 ----
3392 ---- No. S-3-4 index type
3393 ----
3394 \d s1.ti1
3395         Table "s1.ti1"
3396  Column |  Type   | Modifiers 
3397 --------+---------+-----------
3398  c1     | integer | not null
3399  c2     | integer | 
3400  c3     | integer | 
3401  c4     | text    | 
3402 Indexes:
3403     "ti1_pkey" PRIMARY KEY, btree (c1)
3404     "ti1_c2_key" UNIQUE CONSTRAINT, btree (c2)
3405     "ti1_uniq" UNIQUE, btree (c1)
3406     "ti1_btree" btree (c1)
3407     "ti1_expr" btree ((c1 < 100))
3408     "ti1_gin" gin (c1)
3409     "ti1_gist" gist (c1)
3410     "ti1_hash" hash (c1)
3411     "ti1_i1" btree (c2)
3412     "ti1_i2" btree (c2, c4)
3413     "ti1_i3" btree (c2, c4, c4)
3414     "ti1_i4" btree (c2, c4, c4, c4)
3415     "ti1_multi" btree (c1, c2, c3, c4)
3416     "ti1_pred" btree (lower(c4))
3417     "ti1_ts" gin (to_tsvector('english'::regconfig, c4))
3418
3419 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3420                                                                QUERY PLAN                                                                
3421 -----------------------------------------------------------------------------------------------------------------------------------------
3422  Tid Scan on ti1
3423    TID Cond: (ctid = '(1,1)'::tid)
3424    Filter: ((c1 < 100) AND (c2 = 1) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3425 (3 rows)
3426
3427 -- No. S-3-4-1
3428 /*+IndexScan(ti1 ti1_btree)*/
3429 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3430 LOG:  pg_hint_plan:
3431 used hint:
3432 IndexScan(ti1 ti1_btree)
3433 not used hint:
3434 duplication hint:
3435 error hint:
3436
3437                                                                      QUERY PLAN                                                                     
3438 ----------------------------------------------------------------------------------------------------------------------------------------------------
3439  Index Scan using ti1_btree on ti1
3440    Index Cond: (c1 < 100)
3441    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3442 (3 rows)
3443
3444 -- No. S-3-4-2
3445 /*+IndexScan(ti1 ti1_hash)*/
3446 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3447 LOG:  pg_hint_plan:
3448 used hint:
3449 IndexScan(ti1 ti1_hash)
3450 not used hint:
3451 duplication hint:
3452 error hint:
3453
3454                                                                      QUERY PLAN                                                                     
3455 ----------------------------------------------------------------------------------------------------------------------------------------------------
3456  Index Scan using ti1_hash on ti1
3457    Index Cond: (c1 = 100)
3458    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3459 (3 rows)
3460
3461 -- No. S-3-4-3
3462 /*+IndexScan(ti1 ti1_gist)*/
3463 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3464 LOG:  pg_hint_plan:
3465 used hint:
3466 IndexScan(ti1 ti1_gist)
3467 not used hint:
3468 duplication hint:
3469 error hint:
3470
3471                                                                      QUERY PLAN                                                                     
3472 ----------------------------------------------------------------------------------------------------------------------------------------------------
3473  Index Scan using ti1_gist on ti1
3474    Index Cond: (c1 < 100)
3475    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3476 (3 rows)
3477
3478 -- No. S-3-4-4
3479 /*+IndexScan(ti1 ti1_gin)*/
3480 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3481 LOG:  pg_hint_plan:
3482 used hint:
3483 IndexScan(ti1 ti1_gin)
3484 not used hint:
3485 duplication hint:
3486 error hint:
3487
3488                                                                QUERY PLAN                                                                
3489 -----------------------------------------------------------------------------------------------------------------------------------------
3490  Tid Scan on ti1
3491    TID Cond: (ctid = '(1,1)'::tid)
3492    Filter: ((c1 < 100) AND (c2 = 1) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3493 (3 rows)
3494
3495 -- No. S-3-4-5
3496 /*+IndexScan(ti1 ti1_expr)*/
3497 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3498 LOG:  pg_hint_plan:
3499 used hint:
3500 IndexScan(ti1 ti1_expr)
3501 not used hint:
3502 duplication hint:
3503 error hint:
3504
3505                                                                             QUERY PLAN                                                                             
3506 -------------------------------------------------------------------------------------------------------------------------------------------------------------------
3507  Index Scan using ti1_expr on ti1
3508    Index Cond: ((c1 < 100) = true)
3509    Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3510 (3 rows)
3511
3512 -- No. S-3-4-6
3513 /*+IndexScan(ti1 ti1_pred)*/
3514 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3515 LOG:  pg_hint_plan:
3516 used hint:
3517 IndexScan(ti1 ti1_pred)
3518 not used hint:
3519 duplication hint:
3520 error hint:
3521
3522                                                               QUERY PLAN                                                               
3523 ---------------------------------------------------------------------------------------------------------------------------------------
3524  Index Scan using ti1_pred on ti1
3525    Index Cond: (lower(c4) = '1'::text)
3526    Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
3527 (3 rows)
3528
3529 -- No. S-3-4-7
3530 /*+IndexScan(ti1 ti1_uniq)*/
3531 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3532 LOG:  pg_hint_plan:
3533 used hint:
3534 IndexScan(ti1 ti1_uniq)
3535 not used hint:
3536 duplication hint:
3537 error hint:
3538
3539                                                                      QUERY PLAN                                                                     
3540 ----------------------------------------------------------------------------------------------------------------------------------------------------
3541  Index Scan using ti1_uniq on ti1
3542    Index Cond: (c1 < 100)
3543    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3544 (3 rows)
3545
3546 -- No. S-3-4-8
3547 /*+IndexScan(ti1 ti1_multi)*/
3548 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3549 LOG:  pg_hint_plan:
3550 used hint:
3551 IndexScan(ti1 ti1_multi)
3552 not used hint:
3553 duplication hint:
3554 error hint:
3555
3556                                                               QUERY PLAN                                                               
3557 ---------------------------------------------------------------------------------------------------------------------------------------
3558  Index Scan using ti1_multi on ti1
3559    Index Cond: ((c1 < 100) AND (c2 = 1))
3560    Filter: ((ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3561 (3 rows)
3562
3563 -- No. S-3-4-9
3564 /*+IndexScan(ti1 ti1_ts)*/
3565 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3566 LOG:  pg_hint_plan:
3567 used hint:
3568 IndexScan(ti1 ti1_ts)
3569 not used hint:
3570 duplication hint:
3571 error hint:
3572
3573                                                                QUERY PLAN                                                                
3574 -----------------------------------------------------------------------------------------------------------------------------------------
3575  Tid Scan on ti1
3576    TID Cond: (ctid = '(1,1)'::tid)
3577    Filter: ((c1 < 100) AND (c2 = 1) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3578 (3 rows)
3579
3580 -- No. S-3-4-10
3581 /*+IndexScan(ti1 ti1_pkey)*/
3582 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3583 LOG:  pg_hint_plan:
3584 used hint:
3585 IndexScan(ti1 ti1_pkey)
3586 not used hint:
3587 duplication hint:
3588 error hint:
3589
3590                                                                      QUERY PLAN                                                                     
3591 ----------------------------------------------------------------------------------------------------------------------------------------------------
3592  Index Scan using ti1_pkey on ti1
3593    Index Cond: (c1 < 100)
3594    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3595 (3 rows)
3596
3597 -- No. S-3-4-11
3598 /*+IndexScan(ti1 ti1_c2_key)*/
3599 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3600 LOG:  pg_hint_plan:
3601 used hint:
3602 IndexScan(ti1 ti1_c2_key)
3603 not used hint:
3604 duplication hint:
3605 error hint:
3606
3607                                                                       QUERY PLAN                                                                      
3608 ------------------------------------------------------------------------------------------------------------------------------------------------------
3609  Index Scan using ti1_c2_key on ti1
3610    Index Cond: (c2 = 1)
3611    Filter: ((c1 < 100) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3612 (3 rows)
3613
3614 -- No. S-3-4-12
3615 /*+BitmapScan(ti1 ti1_btree)*/
3616 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3617 LOG:  pg_hint_plan:
3618 used hint:
3619 BitmapScan(ti1 ti1_btree)
3620 not used hint:
3621 duplication hint:
3622 error hint:
3623
3624                                                                      QUERY PLAN                                                                     
3625 ----------------------------------------------------------------------------------------------------------------------------------------------------
3626  Bitmap Heap Scan on ti1
3627    Recheck Cond: (c1 < 100)
3628    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3629    ->  Bitmap Index Scan on ti1_btree
3630          Index Cond: (c1 < 100)
3631 (5 rows)
3632
3633 -- No. S-3-4-13
3634 /*+BitmapScan(ti1 ti1_hash)*/
3635 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3636 LOG:  pg_hint_plan:
3637 used hint:
3638 BitmapScan(ti1 ti1_hash)
3639 not used hint:
3640 duplication hint:
3641 error hint:
3642
3643                                                                      QUERY PLAN                                                                     
3644 ----------------------------------------------------------------------------------------------------------------------------------------------------
3645  Bitmap Heap Scan on ti1
3646    Recheck Cond: (c1 = 100)
3647    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3648    ->  Bitmap Index Scan on ti1_hash
3649          Index Cond: (c1 = 100)
3650 (5 rows)
3651
3652 -- No. S-3-4-14
3653 /*+BitmapScan(ti1 ti1_gist)*/
3654 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3655 LOG:  pg_hint_plan:
3656 used hint:
3657 BitmapScan(ti1 ti1_gist)
3658 not used hint:
3659 duplication hint:
3660 error hint:
3661
3662                                                                      QUERY PLAN                                                                     
3663 ----------------------------------------------------------------------------------------------------------------------------------------------------
3664  Bitmap Heap Scan on ti1
3665    Recheck Cond: (c1 < 100)
3666    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3667    ->  Bitmap Index Scan on ti1_gist
3668          Index Cond: (c1 < 100)
3669 (5 rows)
3670
3671 -- No. S-3-4-15
3672 /*+BitmapScan(ti1 ti1_gin)*/
3673 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3674 LOG:  pg_hint_plan:
3675 used hint:
3676 BitmapScan(ti1 ti1_gin)
3677 not used hint:
3678 duplication hint:
3679 error hint:
3680
3681                                                                      QUERY PLAN                                                                     
3682 ----------------------------------------------------------------------------------------------------------------------------------------------------
3683  Bitmap Heap Scan on ti1
3684    Recheck Cond: (c1 < 100)
3685    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3686    ->  Bitmap Index Scan on ti1_gin
3687          Index Cond: (c1 < 100)
3688 (5 rows)
3689
3690 -- No. S-3-4-16
3691 /*+BitmapScan(ti1 ti1_expr)*/
3692 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3693 LOG:  pg_hint_plan:
3694 used hint:
3695 BitmapScan(ti1 ti1_expr)
3696 not used hint:
3697 duplication hint:
3698 error hint:
3699
3700                                                                             QUERY PLAN                                                                             
3701 -------------------------------------------------------------------------------------------------------------------------------------------------------------------
3702  Bitmap Heap Scan on ti1
3703    Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3704    ->  Bitmap Index Scan on ti1_expr
3705          Index Cond: ((c1 < 100) = true)
3706 (4 rows)
3707
3708 -- No. S-3-4-17
3709 /*+BitmapScan(ti1 ti1_pred)*/
3710 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3711 LOG:  pg_hint_plan:
3712 used hint:
3713 BitmapScan(ti1 ti1_pred)
3714 not used hint:
3715 duplication hint:
3716 error hint:
3717
3718                                                               QUERY PLAN                                                               
3719 ---------------------------------------------------------------------------------------------------------------------------------------
3720  Bitmap Heap Scan on ti1
3721    Recheck Cond: (lower(c4) = '1'::text)
3722    Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
3723    ->  Bitmap Index Scan on ti1_pred
3724          Index Cond: (lower(c4) = '1'::text)
3725 (5 rows)
3726
3727 -- No. S-3-4-18
3728 /*+BitmapScan(ti1 ti1_uniq)*/
3729 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3730 LOG:  pg_hint_plan:
3731 used hint:
3732 BitmapScan(ti1 ti1_uniq)
3733 not used hint:
3734 duplication hint:
3735 error hint:
3736
3737                                                                      QUERY PLAN                                                                     
3738 ----------------------------------------------------------------------------------------------------------------------------------------------------
3739  Bitmap Heap Scan on ti1
3740    Recheck Cond: (c1 < 100)
3741    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3742    ->  Bitmap Index Scan on ti1_uniq
3743          Index Cond: (c1 < 100)
3744 (5 rows)
3745
3746 -- No. S-3-4-19
3747 /*+BitmapScan(ti1 ti1_multi)*/
3748 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3749 LOG:  pg_hint_plan:
3750 used hint:
3751 BitmapScan(ti1 ti1_multi)
3752 not used hint:
3753 duplication hint:
3754 error hint:
3755
3756                                                               QUERY PLAN                                                               
3757 ---------------------------------------------------------------------------------------------------------------------------------------
3758  Bitmap Heap Scan on ti1
3759    Recheck Cond: ((c1 < 100) AND (c2 = 1))
3760    Filter: ((ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3761    ->  Bitmap Index Scan on ti1_multi
3762          Index Cond: ((c1 < 100) AND (c2 = 1))
3763 (5 rows)
3764
3765 -- No. S-3-4-20
3766 /*+BitmapScan(ti1 ti1_ts)*/
3767 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3768 LOG:  pg_hint_plan:
3769 used hint:
3770 BitmapScan(ti1 ti1_ts)
3771 not used hint:
3772 duplication hint:
3773 error hint:
3774
3775                                         QUERY PLAN                                         
3776 -------------------------------------------------------------------------------------------
3777  Bitmap Heap Scan on ti1
3778    Recheck Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
3779    Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (lower(c4) = '1'::text))
3780    ->  Bitmap Index Scan on ti1_ts
3781          Index Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
3782 (5 rows)
3783
3784 -- No. S-3-4-10
3785 /*+BitmapScan(ti1 ti1_pkey)*/
3786 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3787 LOG:  pg_hint_plan:
3788 used hint:
3789 BitmapScan(ti1 ti1_pkey)
3790 not used hint:
3791 duplication hint:
3792 error hint:
3793
3794                                                                      QUERY PLAN                                                                     
3795 ----------------------------------------------------------------------------------------------------------------------------------------------------
3796  Bitmap Heap Scan on ti1
3797    Recheck Cond: (c1 < 100)
3798    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3799    ->  Bitmap Index Scan on ti1_pkey
3800          Index Cond: (c1 < 100)
3801 (5 rows)
3802
3803 -- No. S-3-4-11
3804 /*+BitmapScan(ti1 ti1_c2_key)*/
3805 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3806 LOG:  pg_hint_plan:
3807 used hint:
3808 BitmapScan(ti1 ti1_c2_key)
3809 not used hint:
3810 duplication hint:
3811 error hint:
3812
3813                                                                       QUERY PLAN                                                                      
3814 ------------------------------------------------------------------------------------------------------------------------------------------------------
3815  Bitmap Heap Scan on ti1
3816    Recheck Cond: (c2 = 1)
3817    Filter: ((c1 < 100) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3818    ->  Bitmap Index Scan on ti1_c2_key
3819          Index Cond: (c2 = 1)
3820 (5 rows)
3821
3822 ----
3823 ---- No. S-3-5 not used index
3824 ----
3825 -- No. S-3-5-1
3826 /*+IndexScan(ti1 ti1_pred)*/
3827 EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
3828 LOG:  pg_hint_plan:
3829 used hint:
3830 IndexScan(ti1 ti1_pred)
3831 not used hint:
3832 duplication hint:
3833 error hint:
3834
3835                                QUERY PLAN                               
3836 ------------------------------------------------------------------------
3837  Seq Scan on ti1  (cost=10000000000.00..10000000018.50 rows=1 width=15)
3838    Filter: (c1 = 100)
3839 (2 rows)
3840
3841 -- No. S-3-5-2
3842 /*+BitmapScan(ti1 ti1_pred)*/
3843 EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
3844 LOG:  pg_hint_plan:
3845 used hint:
3846 BitmapScan(ti1 ti1_pred)
3847 not used hint:
3848 duplication hint:
3849 error hint:
3850
3851                                QUERY PLAN                               
3852 ------------------------------------------------------------------------
3853  Seq Scan on ti1  (cost=10000000000.00..10000000018.50 rows=1 width=15)
3854    Filter: (c1 = 100)
3855 (2 rows)
3856
3857 ----
3858 ---- No. S-3-6 not exist index
3859 ----
3860 -- No. S-3-6-1
3861 /*+IndexScan(ti1 not_exist)*/
3862 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 100;
3863 LOG:  pg_hint_plan:
3864 used hint:
3865 IndexScan(ti1 not_exist)
3866 not used hint:
3867 duplication hint:
3868 error hint:
3869
3870       QUERY PLAN      
3871 ----------------------
3872  Seq Scan on ti1
3873    Filter: (c1 = 100)
3874 (2 rows)
3875
3876 -- No. S-3-6-2
3877 /*+BitmapScan(ti1 not_exist)*/
3878 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 100;
3879 LOG:  pg_hint_plan:
3880 used hint:
3881 BitmapScan(ti1 not_exist)
3882 not used hint:
3883 duplication hint:
3884 error hint:
3885
3886       QUERY PLAN      
3887 ----------------------
3888  Seq Scan on ti1
3889    Filter: (c1 = 100)
3890 (2 rows)
3891
3892 ----
3893 ---- No. S-3-7 query structure
3894 ----
3895 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
3896                   QUERY PLAN                   
3897 -----------------------------------------------
3898  Hash Join
3899    Hash Cond: (t2.c1 = t1.c1)
3900    ->  Seq Scan on t2
3901    ->  Hash
3902          ->  Tid Scan on t1
3903                TID Cond: (ctid = '(1,1)'::tid)
3904 (6 rows)
3905
3906 -- No. S-3-7-1
3907 /*+SeqScan(t1)*/
3908 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE c1 = 100;
3909 LOG:  pg_hint_plan:
3910 used hint:
3911 SeqScan(t1)
3912 not used hint:
3913 duplication hint:
3914 error hint:
3915
3916       QUERY PLAN      
3917 ----------------------
3918  Seq Scan on t1
3919    Filter: (c1 = 100)
3920 (2 rows)
3921
3922 -- No. S-3-7-2
3923 /*+SeqScan(t1)BitmapScan(t2)*/
3924 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
3925 LOG:  pg_hint_plan:
3926 used hint:
3927 SeqScan(t1)
3928 BitmapScan(t2)
3929 not used hint:
3930 duplication hint:
3931 error hint:
3932
3933                QUERY PLAN               
3934 ----------------------------------------
3935  Nested Loop
3936    ->  Seq Scan on t1
3937          Filter: (ctid = '(1,1)'::tid)
3938    ->  Bitmap Heap Scan on t2
3939          Recheck Cond: (c1 = t1.c1)
3940          ->  Bitmap Index Scan on t2_i1
3941                Index Cond: (c1 = t1.c1)
3942 (7 rows)
3943
3944 -- No. S-3-7-3
3945 /*+SeqScan(t1)*/
3946 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
3947 LOG:  pg_hint_plan:
3948 used hint:
3949 SeqScan(t1)
3950 not used hint:
3951 duplication hint:
3952 error hint:
3953
3954                  QUERY PLAN                  
3955 ---------------------------------------------
3956  Hash Join
3957    Hash Cond: (t2.c1 = t1.c1)
3958    ->  Seq Scan on t2
3959    ->  Hash
3960          ->  Seq Scan on t1
3961                Filter: (ctid = '(1,1)'::tid)
3962 (6 rows)
3963
3964 ----
3965 ---- No. S-3-8 query structure
3966 ----
3967 -- No. S-3-8-1
3968 EXPLAIN (COSTS false) 
3969 WITH c1 (c1) AS (
3970 SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.c1 = 1)
3971 SELECT max(b3t1.c1), (
3972 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
3973                   ) FROM s1.t1 b3t1 WHERE b3t1.c1 = (
3974 SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
3975                              QUERY PLAN                              
3976 ---------------------------------------------------------------------
3977  Result
3978    InitPlan 2 (returns $1)
3979      ->  Result
3980            InitPlan 1 (returns $0)
3981              ->  Limit
3982                    ->  Index Scan using t1_i1 on t1 b2t1
3983                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
3984    InitPlan 4 (returns $3)
3985      ->  Result
3986            InitPlan 3 (returns $2)
3987              ->  Limit
3988                    ->  Index Scan using t1_i1 on t1 b4t1
3989                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
3990    InitPlan 5 (returns $4)
3991      ->  Limit
3992            ->  Index Scan using t1_i1 on t1 b3t1
3993                  Index Cond: ((c1 IS NOT NULL) AND (c1 = $3))
3994 (17 rows)
3995
3996 /*+SeqScan(b1t1)IndexScan(b2t1 t1_pkey)BitmapScan(b3t1 t1_pkey)TidScan(b4t1)
3997 */
3998 EXPLAIN (COSTS false) 
3999 WITH c1 (c1) AS (
4000 SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.c1 = 1)
4001 SELECT max(b3t1.c1), (
4002 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
4003                   ) FROM s1.t1 b3t1 WHERE b3t1.c1 = (
4004 SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
4005 LOG:  pg_hint_plan:
4006 used hint:
4007 IndexScan(b2t1 t1_pkey)
4008 BitmapScan(b3t1 t1_pkey)
4009 TidScan(b4t1)
4010 not used hint:
4011 SeqScan(b1t1)
4012 duplication hint:
4013 error hint:
4014
4015                              QUERY PLAN                              
4016 ---------------------------------------------------------------------
4017  Result
4018    InitPlan 2 (returns $1)
4019      ->  Result
4020            InitPlan 1 (returns $0)
4021              ->  Limit
4022                    ->  Index Scan using t1_pkey on t1 b2t1
4023                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4024    InitPlan 4 (returns $3)
4025      ->  Result
4026            InitPlan 3 (returns $2)
4027              ->  Limit
4028                    ->  Seq Scan on t1 b4t1
4029                          Filter: ((c1 IS NOT NULL) AND (c1 = 1))
4030    InitPlan 5 (returns $4)
4031      ->  Limit
4032            ->  Bitmap Heap Scan on t1 b3t1
4033                  Recheck Cond: ((c1 IS NOT NULL) AND (c1 = $3))
4034                  ->  Bitmap Index Scan on t1_pkey
4035                        Index Cond: ((c1 IS NOT NULL) AND (c1 = $3))
4036 (19 rows)
4037
4038 -- No. S-3-8-2
4039 EXPLAIN (COSTS false) 
4040 WITH cte1 (c1) AS (
4041 SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
4042 SELECT max(b3t1.c1), (
4043 SELECT max(b2t1.c1) FROM s1.t1 b2t1 JOIN s1.t2 b2t2 ON(b2t1.c1 = b2t2.c1) WHERE b2t1.c1 = 1
4044                   ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
4045 SELECT max(b4t1.c1) FROM s1.t1 b4t1 JOIN s1.t2 b4t2 ON(b4t1.c1 = b4t2.c1) WHERE b4t1.c1 = 1);
4046                       QUERY PLAN                       
4047 -------------------------------------------------------
4048  Aggregate
4049    CTE cte1
4050      ->  Aggregate
4051            ->  Nested Loop
4052                  ->  Index Scan using t1_i1 on t1 b1t1
4053                        Index Cond: (c1 = 1)
4054                  ->  Seq Scan on t2 b1t2
4055                        Filter: (c1 = 1)
4056    InitPlan 2 (returns $1)
4057      ->  Aggregate
4058            ->  Nested Loop
4059                  ->  Index Scan using t1_i1 on t1 b2t1
4060                        Index Cond: (c1 = 1)
4061                  ->  Seq Scan on t2 b2t2
4062                        Filter: (c1 = 1)
4063    InitPlan 3 (returns $2)
4064      ->  Aggregate
4065            ->  Nested Loop
4066                  ->  Index Scan using t1_i1 on t1 b4t1
4067                        Index Cond: (c1 = 1)
4068                  ->  Seq Scan on t2 b4t2
4069                        Filter: (c1 = 1)
4070    ->  Nested Loop
4071          ->  Nested Loop
4072                ->  Index Scan using t1_i1 on t1 b3t1
4073                      Index Cond: (c1 = $2)
4074                ->  Seq Scan on t2 b3t2
4075                      Filter: (c1 = $2)
4076          ->  CTE Scan on cte1
4077                Filter: (c1 = $2)
4078 (30 rows)
4079
4080 /*+SeqScan(b1t1)IndexScan(b2t1 t1_pkey)BitmapScan(b3t1 t1_pkey)TidScan(b4t1)
4081 TidScan(b1t2)SeqScan(b2t2)IndexScan(b3t2 t2_pkey)BitmapScan(b4t2 t2_pkey)
4082 */
4083 EXPLAIN (COSTS false) 
4084 WITH cte1 (c1) AS (
4085 SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
4086 SELECT max(b3t1.c1), (
4087 SELECT max(b2t1.c1) FROM s1.t1 b2t1 JOIN s1.t2 b2t2 ON(b2t1.c1 = b2t2.c1) WHERE b2t1.c1 = 1
4088                   ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
4089 SELECT max(b4t1.c1) FROM s1.t1 b4t1 JOIN s1.t2 b4t2 ON(b4t1.c1 = b4t2.c1) WHERE b4t1.c1 = 1);
4090 LOG:  pg_hint_plan:
4091 used hint:
4092 SeqScan(b1t1)
4093 TidScan(b1t2)
4094 IndexScan(b2t1 t1_pkey)
4095 SeqScan(b2t2)
4096 BitmapScan(b3t1 t1_pkey)
4097 IndexScan(b3t2 t2_pkey)
4098 TidScan(b4t1)
4099 BitmapScan(b4t2 t2_pkey)
4100 not used hint:
4101 duplication hint:
4102 error hint:
4103
4104                        QUERY PLAN                        
4105 ---------------------------------------------------------
4106  Aggregate
4107    CTE cte1
4108      ->  Aggregate
4109            ->  Nested Loop
4110                  ->  Seq Scan on t1 b1t1
4111                        Filter: (c1 = 1)
4112                  ->  Seq Scan on t2 b1t2
4113                        Filter: (c1 = 1)
4114    InitPlan 2 (returns $1)
4115      ->  Aggregate
4116            ->  Nested Loop
4117                  ->  Index Scan using t1_pkey on t1 b2t1
4118                        Index Cond: (c1 = 1)
4119                  ->  Seq Scan on t2 b2t2
4120                        Filter: (c1 = 1)
4121    InitPlan 3 (returns $2)
4122      ->  Aggregate
4123            ->  Nested Loop
4124                  ->  Seq Scan on t1 b4t1
4125                        Filter: (c1 = 1)
4126                  ->  Bitmap Heap Scan on t2 b4t2
4127                        Recheck Cond: (c1 = 1)
4128                        ->  Bitmap Index Scan on t2_pkey
4129                              Index Cond: (c1 = 1)
4130    ->  Nested Loop
4131          ->  Nested Loop
4132                ->  Bitmap Heap Scan on t1 b3t1
4133                      Recheck Cond: (c1 = $2)
4134                      ->  Bitmap Index Scan on t1_pkey
4135                            Index Cond: (c1 = $2)
4136                ->  CTE Scan on cte1
4137                      Filter: (c1 = $2)
4138          ->  Index Scan using t2_pkey on t2 b3t2
4139                Index Cond: (c1 = $2)
4140 (34 rows)
4141
4142 -- No. S-3-8-3
4143 EXPLAIN (COSTS false) 
4144 WITH cte1 (c1) AS (
4145 SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
4146 SELECT max(b3t1.c1), (
4147 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
4148                   ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
4149 SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
4150                              QUERY PLAN                              
4151 ---------------------------------------------------------------------
4152  Aggregate
4153    CTE cte1
4154      ->  Aggregate
4155            ->  Nested Loop
4156                  ->  Index Scan using t1_i1 on t1 b1t1
4157                        Index Cond: (c1 = 1)
4158                  ->  Seq Scan on t2 b1t2
4159                        Filter: (c1 = 1)
4160    InitPlan 3 (returns $2)
4161      ->  Result
4162            InitPlan 2 (returns $1)
4163              ->  Limit
4164                    ->  Index Scan using t1_i1 on t1 b2t1
4165                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4166    InitPlan 5 (returns $4)
4167      ->  Result
4168            InitPlan 4 (returns $3)
4169              ->  Limit
4170                    ->  Index Scan using t1_i1 on t1 b4t1
4171                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4172    ->  Nested Loop
4173          ->  Nested Loop
4174                ->  Index Scan using t1_i1 on t1 b3t1
4175                      Index Cond: (c1 = $4)
4176                ->  Seq Scan on t2 b3t2
4177                      Filter: (c1 = $4)
4178          ->  CTE Scan on cte1
4179                Filter: (c1 = $4)
4180 (28 rows)
4181
4182 /*+SeqScan(b1t1)IndexScan(b2t1 t1_pkey)BitmapScan(b3t1 t1_pkey)TidScan(b4t1)
4183 TidScan(b1t2)IndexScan(b3t2 t2_pkey)
4184 */
4185 EXPLAIN (COSTS false) 
4186 WITH cte1 (c1) AS (
4187 SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
4188 SELECT max(b3t1.c1), (
4189 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
4190                   ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
4191 SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
4192 LOG:  pg_hint_plan:
4193 used hint:
4194 SeqScan(b1t1)
4195 TidScan(b1t2)
4196 IndexScan(b2t1 t1_pkey)
4197 BitmapScan(b3t1 t1_pkey)
4198 IndexScan(b3t2 t2_pkey)
4199 TidScan(b4t1)
4200 not used hint:
4201 duplication hint:
4202 error hint:
4203
4204                              QUERY PLAN                              
4205 ---------------------------------------------------------------------
4206  Aggregate
4207    CTE cte1
4208      ->  Aggregate
4209            ->  Nested Loop
4210                  ->  Seq Scan on t1 b1t1
4211                        Filter: (c1 = 1)
4212                  ->  Seq Scan on t2 b1t2
4213                        Filter: (c1 = 1)
4214    InitPlan 3 (returns $2)
4215      ->  Result
4216            InitPlan 2 (returns $1)
4217              ->  Limit
4218                    ->  Index Scan using t1_pkey on t1 b2t1
4219                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4220    InitPlan 5 (returns $4)
4221      ->  Result
4222            InitPlan 4 (returns $3)
4223              ->  Limit
4224                    ->  Seq Scan on t1 b4t1
4225                          Filter: ((c1 IS NOT NULL) AND (c1 = 1))
4226    ->  Nested Loop
4227          ->  Nested Loop
4228                ->  Bitmap Heap Scan on t1 b3t1
4229                      Recheck Cond: (c1 = $4)
4230                      ->  Bitmap Index Scan on t1_pkey
4231                            Index Cond: (c1 = $4)
4232                ->  CTE Scan on cte1
4233                      Filter: (c1 = $4)
4234          ->  Index Scan using t2_pkey on t2 b3t2
4235                Index Cond: (c1 = $4)
4236 (30 rows)
4237
4238 ----
4239 ---- No. S-3-9 inheritance table select type
4240 ----
4241 -- No. S-3-9-1
4242 EXPLAIN (COSTS false) SELECT * FROM ONLY s1.p1 WHERE c1 = 1;
4243      QUERY PLAN     
4244 --------------------
4245  Seq Scan on p1
4246    Filter: (c1 = 1)
4247 (2 rows)
4248
4249 /*+IndexScan(p1)*/
4250 EXPLAIN (COSTS false) SELECT * FROM ONLY s1.p1 WHERE c1 = 1;
4251 LOG:  pg_hint_plan:
4252 used hint:
4253 IndexScan(p1)
4254 not used hint:
4255 duplication hint:
4256 error hint:
4257
4258          QUERY PLAN          
4259 -----------------------------
4260  Index Scan using p1_i on p1
4261    Index Cond: (c1 = 1)
4262 (2 rows)
4263
4264 -- No. S-3-9-2
4265 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
4266            QUERY PLAN            
4267 ---------------------------------
4268  Result
4269    ->  Append
4270          ->  Seq Scan on p1
4271                Filter: (c1 = 1)
4272          ->  Seq Scan on p1c1 p1
4273                Filter: (c1 = 1)
4274 (6 rows)
4275
4276 /*+IndexScan(p1)*/
4277 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
4278 LOG:  pg_hint_plan:
4279 used hint:
4280 IndexScan(p1)
4281 not used hint:
4282 duplication hint:
4283 error hint:
4284
4285                    QUERY PLAN                   
4286 ------------------------------------------------
4287  Result
4288    ->  Append
4289          ->  Index Scan using p1_i on p1
4290                Index Cond: (c1 = 1)
4291          ->  Index Scan using p1c1_i on p1c1 p1
4292                Index Cond: (c1 = 1)
4293 (6 rows)
4294
4295 ----
4296 ---- No. S-3-10 inheritance table number
4297 ----
4298 -- No. S-3-10-1
4299 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
4300            QUERY PLAN            
4301 ---------------------------------
4302  Result
4303    ->  Append
4304          ->  Seq Scan on p1
4305                Filter: (c1 = 1)
4306          ->  Seq Scan on p1c1 p1
4307                Filter: (c1 = 1)
4308 (6 rows)
4309
4310 /*+IndexScan(p1)*/
4311 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
4312 LOG:  pg_hint_plan:
4313 used hint:
4314 IndexScan(p1)
4315 not used hint:
4316 duplication hint:
4317 error hint:
4318
4319                    QUERY PLAN                   
4320 ------------------------------------------------
4321  Result
4322    ->  Append
4323          ->  Index Scan using p1_i on p1
4324                Index Cond: (c1 = 1)
4325          ->  Index Scan using p1c1_i on p1c1 p1
4326                Index Cond: (c1 = 1)
4327 (6 rows)
4328
4329 -- No. S-3-10-2
4330 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4331             QUERY PLAN             
4332 -----------------------------------
4333  Result
4334    ->  Append
4335          ->  Seq Scan on p2
4336                Filter: (c1 = 1)
4337          ->  Seq Scan on p2c1 p2
4338                Filter: (c1 = 1)
4339          ->  Seq Scan on p2c1c1 p2
4340                Filter: (c1 = 1)
4341 (8 rows)
4342
4343 /*+IndexScan(p2)*/
4344 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4345 LOG:  pg_hint_plan:
4346 used hint:
4347 IndexScan(p2)
4348 not used hint:
4349 duplication hint:
4350 error hint:
4351
4352                      QUERY PLAN                     
4353 ----------------------------------------------------
4354  Result
4355    ->  Append
4356          ->  Index Scan using p2_i on p2
4357                Index Cond: (c1 = 1)
4358          ->  Index Scan using p2c1_i on p2c1 p2
4359                Index Cond: (c1 = 1)
4360          ->  Index Scan using p2c1c1_i on p2c1c1 p2
4361                Index Cond: (c1 = 1)
4362 (8 rows)
4363
4364 ----
4365 ---- No. S-3-11 inheritance table specified table
4366 ----
4367 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4368             QUERY PLAN             
4369 -----------------------------------
4370  Result
4371    ->  Append
4372          ->  Seq Scan on p2
4373                Filter: (c1 = 1)
4374          ->  Seq Scan on p2c1 p2
4375                Filter: (c1 = 1)
4376          ->  Seq Scan on p2c1c1 p2
4377                Filter: (c1 = 1)
4378 (8 rows)
4379
4380 -- No. S-3-11-1
4381 /*+IndexScan(p2)*/
4382 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4383 LOG:  pg_hint_plan:
4384 used hint:
4385 IndexScan(p2)
4386 not used hint:
4387 duplication hint:
4388 error hint:
4389
4390                      QUERY PLAN                     
4391 ----------------------------------------------------
4392  Result
4393    ->  Append
4394          ->  Index Scan using p2_i on p2
4395                Index Cond: (c1 = 1)
4396          ->  Index Scan using p2c1_i on p2c1 p2
4397                Index Cond: (c1 = 1)
4398          ->  Index Scan using p2c1c1_i on p2c1c1 p2
4399                Index Cond: (c1 = 1)
4400 (8 rows)
4401
4402 -- No. S-3-11-2
4403 /*+IndexScan(p2c1)*/
4404 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4405 LOG:  pg_hint_plan:
4406 used hint:
4407 not used hint:
4408 IndexScan(p2c1)
4409 duplication hint:
4410 error hint:
4411
4412             QUERY PLAN             
4413 -----------------------------------
4414  Result
4415    ->  Append
4416          ->  Seq Scan on p2
4417                Filter: (c1 = 1)
4418          ->  Seq Scan on p2c1 p2
4419                Filter: (c1 = 1)
4420          ->  Seq Scan on p2c1c1 p2
4421                Filter: (c1 = 1)
4422 (8 rows)
4423
4424 -- No. S-3-11-3
4425 /*+IndexScan(p2 p2_pkey p2c1_pkey p2c1c1_pkey)*/
4426 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4427 LOG:  pg_hint_plan:
4428 used hint:
4429 IndexScan(p2 p2_pkey p2c1_pkey p2c1c1_pkey)
4430 not used hint:
4431 duplication hint:
4432 error hint:
4433
4434                       QUERY PLAN                       
4435 -------------------------------------------------------
4436  Result
4437    ->  Append
4438          ->  Index Scan using p2_pkey on p2
4439                Index Cond: (c1 = 1)
4440          ->  Index Scan using p2c1_pkey on p2c1 p2
4441                Index Cond: (c1 = 1)
4442          ->  Index Scan using p2c1c1_pkey on p2c1c1 p2
4443                Index Cond: (c1 = 1)
4444 (8 rows)
4445
4446 -- No. S-3-11-4
4447 /*+IndexScan(p2 p2c1_pkey)*/
4448 EXPLAIN (COSTS true) SELECT * FROM s1.p2 WHERE c1 = 1;
4449 LOG:  pg_hint_plan:
4450 used hint:
4451 IndexScan(p2 p2c1_pkey)
4452 not used hint:
4453 duplication hint:
4454 error hint:
4455
4456                                         QUERY PLAN                                        
4457 ------------------------------------------------------------------------------------------
4458  Result  (cost=10000000000.00..20000000009.89 rows=3 width=34)
4459    ->  Append  (cost=10000000000.00..20000000009.89 rows=3 width=34)
4460          ->  Seq Scan on p2  (cost=10000000000.00..10000000000.00 rows=1 width=44)
4461                Filter: (c1 = 1)
4462          ->  Index Scan using p2c1_pkey on p2c1 p2  (cost=0.00..8.27 rows=1 width=44)
4463                Index Cond: (c1 = 1)
4464          ->  Seq Scan on p2c1c1 p2  (cost=10000000000.00..10000000001.62 rows=1 width=14)
4465                Filter: (c1 = 1)
4466 (8 rows)
4467
4468 ----
4469 ---- No. S-3-12 specified same table
4470 ----
4471 -- No. S-3-12-1
4472 /*+IndexScan(ti1) BitmapScan(ti1)*/
4473 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4474 INFO:  hint syntax error at or near "IndexScan(ti1) BitmapScan(ti1)"
4475 DETAIL:  Conflict scan method hint.
4476 LOG:  pg_hint_plan:
4477 used hint:
4478 BitmapScan(ti1)
4479 not used hint:
4480 duplication hint:
4481 IndexScan(ti1)
4482 error hint:
4483
4484              QUERY PLAN              
4485 -------------------------------------
4486  Bitmap Heap Scan on ti1
4487    Recheck Cond: (c1 = 1)
4488    Filter: (ctid = '(1,1)'::tid)
4489    ->  Bitmap Index Scan on ti1_uniq
4490          Index Cond: (c1 = 1)
4491 (5 rows)
4492
4493 -- No. S-3-12-2
4494 /*+IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)*/
4495 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4496 INFO:  hint syntax error at or near "IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
4497 DETAIL:  Conflict scan method hint.
4498 LOG:  pg_hint_plan:
4499 used hint:
4500 BitmapScan(ti1 ti1_btree)
4501 not used hint:
4502 duplication hint:
4503 IndexScan(ti1 ti1_pkey)
4504 error hint:
4505
4506               QUERY PLAN              
4507 --------------------------------------
4508  Bitmap Heap Scan on ti1
4509    Recheck Cond: (c1 = 1)
4510    Filter: (ctid = '(1,1)'::tid)
4511    ->  Bitmap Index Scan on ti1_btree
4512          Index Cond: (c1 = 1)
4513 (5 rows)
4514
4515 -- No. S-3-12-3
4516 /*+BitmapScan(ti1) IndexScan(ti1) BitmapScan(ti1)*/
4517 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4518 INFO:  hint syntax error at or near "BitmapScan(ti1) IndexScan(ti1) BitmapScan(ti1)"
4519 DETAIL:  Conflict scan method hint.
4520 INFO:  hint syntax error at or near "IndexScan(ti1) BitmapScan(ti1)"
4521 DETAIL:  Conflict scan method hint.
4522 LOG:  pg_hint_plan:
4523 used hint:
4524 BitmapScan(ti1)
4525 not used hint:
4526 duplication hint:
4527 BitmapScan(ti1)
4528 IndexScan(ti1)
4529 error hint:
4530
4531              QUERY PLAN              
4532 -------------------------------------
4533  Bitmap Heap Scan on ti1
4534    Recheck Cond: (c1 = 1)
4535    Filter: (ctid = '(1,1)'::tid)
4536    ->  Bitmap Index Scan on ti1_uniq
4537          Index Cond: (c1 = 1)
4538 (5 rows)
4539
4540 -- No. S-3-12-4
4541 /*+BitmapScan(ti1 ti1_hash) IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)*/
4542 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4543 INFO:  hint syntax error at or near "BitmapScan(ti1 ti1_hash) IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
4544 DETAIL:  Conflict scan method hint.
4545 INFO:  hint syntax error at or near "IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
4546 DETAIL:  Conflict scan method hint.
4547 LOG:  pg_hint_plan:
4548 used hint:
4549 BitmapScan(ti1 ti1_btree)
4550 not used hint:
4551 duplication hint:
4552 BitmapScan(ti1 ti1_hash)
4553 IndexScan(ti1 ti1_pkey)
4554 error hint:
4555
4556               QUERY PLAN              
4557 --------------------------------------
4558  Bitmap Heap Scan on ti1
4559    Recheck Cond: (c1 = 1)
4560    Filter: (ctid = '(1,1)'::tid)
4561    ->  Bitmap Index Scan on ti1_btree
4562          Index Cond: (c1 = 1)
4563 (5 rows)
4564
4565 ----
4566 ---- No. S-3-13 message output
4567 ----
4568 -- No. S-3-13-1
4569 /*+SeqScan(ti1)*/
4570 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4571 LOG:  pg_hint_plan:
4572 used hint:
4573 SeqScan(ti1)
4574 not used hint:
4575 duplication hint:
4576 error hint:
4577
4578                    QUERY PLAN                   
4579 ------------------------------------------------
4580  Seq Scan on ti1
4581    Filter: ((c1 = 1) AND (ctid = '(1,1)'::tid))
4582 (2 rows)
4583
4584 -- No. S-3-13-2
4585 /*+SeqScan(ti1 ti1_pkey)*/
4586 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4587 INFO:  hint syntax error at or near "ti1_pkey)"
4588 DETAIL:  Closing parenthesis is necessary.
4589             QUERY PLAN             
4590 -----------------------------------
4591  Tid Scan on ti1
4592    TID Cond: (ctid = '(1,1)'::tid)
4593    Filter: (c1 = 1)
4594 (3 rows)
4595
4596 -- No. S-3-13-3
4597 /*+SeqScan(ti1 ti1_pkey ti1_btree)*/
4598 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4599 INFO:  hint syntax error at or near "ti1_pkey ti1_btree)"
4600 DETAIL:  Closing parenthesis is necessary.
4601             QUERY PLAN             
4602 -----------------------------------
4603  Tid Scan on ti1
4604    TID Cond: (ctid = '(1,1)'::tid)
4605    Filter: (c1 = 1)
4606 (3 rows)
4607
4608 -- No. S-3-13-4
4609 /*+IndexScan(ti1)*/
4610 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4611 LOG:  pg_hint_plan:
4612 used hint:
4613 IndexScan(ti1)
4614 not used hint:
4615 duplication hint:
4616 error hint:
4617
4618             QUERY PLAN            
4619 ----------------------------------
4620  Index Scan using ti1_uniq on ti1
4621    Index Cond: (c1 = 1)
4622    Filter: (ctid = '(1,1)'::tid)
4623 (3 rows)
4624
4625 -- No. S-3-13-5
4626 /*+IndexScan(ti1 ti1_pkey)*/
4627 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4628 LOG:  pg_hint_plan:
4629 used hint:
4630 IndexScan(ti1 ti1_pkey)
4631 not used hint:
4632 duplication hint:
4633 error hint:
4634
4635             QUERY PLAN            
4636 ----------------------------------
4637  Index Scan using ti1_pkey on ti1
4638    Index Cond: (c1 = 1)
4639    Filter: (ctid = '(1,1)'::tid)
4640 (3 rows)
4641
4642 -- No. S-3-13-6
4643 /*+IndexScan(ti1 ti1_pkey ti1_btree)*/
4644 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4645 LOG:  pg_hint_plan:
4646 used hint:
4647 IndexScan(ti1 ti1_pkey ti1_btree)
4648 not used hint:
4649 duplication hint:
4650 error hint:
4651
4652             QUERY PLAN             
4653 -----------------------------------
4654  Index Scan using ti1_btree on ti1
4655    Index Cond: (c1 = 1)
4656    Filter: (ctid = '(1,1)'::tid)
4657 (3 rows)
4658
4659 -- No. S-3-13-7
4660 /*+BitmapScan(ti1)*/
4661 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4662 LOG:  pg_hint_plan:
4663 used hint:
4664 BitmapScan(ti1)
4665 not used hint:
4666 duplication hint:
4667 error hint:
4668
4669              QUERY PLAN              
4670 -------------------------------------
4671  Bitmap Heap Scan on ti1
4672    Recheck Cond: (c1 = 1)
4673    Filter: (ctid = '(1,1)'::tid)
4674    ->  Bitmap Index Scan on ti1_uniq
4675          Index Cond: (c1 = 1)
4676 (5 rows)
4677
4678 -- No. S-3-13-8
4679 /*+BitmapScan(ti1 ti1_pkey)*/
4680 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4681 LOG:  pg_hint_plan:
4682 used hint:
4683 BitmapScan(ti1 ti1_pkey)
4684 not used hint:
4685 duplication hint:
4686 error hint:
4687
4688              QUERY PLAN              
4689 -------------------------------------
4690  Bitmap Heap Scan on ti1
4691    Recheck Cond: (c1 = 1)
4692    Filter: (ctid = '(1,1)'::tid)
4693    ->  Bitmap Index Scan on ti1_pkey
4694          Index Cond: (c1 = 1)
4695 (5 rows)
4696
4697 -- No. S-3-13-9
4698 /*+BitmapScan(ti1 ti1_pkey ti1_btree)*/
4699 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4700 LOG:  pg_hint_plan:
4701 used hint:
4702 BitmapScan(ti1 ti1_pkey ti1_btree)
4703 not used hint:
4704 duplication hint:
4705 error hint:
4706
4707               QUERY PLAN              
4708 --------------------------------------
4709  Bitmap Heap Scan on ti1
4710    Recheck Cond: (c1 = 1)
4711    Filter: (ctid = '(1,1)'::tid)
4712    ->  Bitmap Index Scan on ti1_btree
4713          Index Cond: (c1 = 1)
4714 (5 rows)
4715
4716 -- No. S-3-13-10
4717 /*+TidScan(ti1)*/
4718 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4719 LOG:  pg_hint_plan:
4720 used hint:
4721 TidScan(ti1)
4722 not used hint:
4723 duplication hint:
4724 error hint:
4725
4726             QUERY PLAN             
4727 -----------------------------------
4728  Tid Scan on ti1
4729    TID Cond: (ctid = '(1,1)'::tid)
4730    Filter: (c1 = 1)
4731 (3 rows)
4732
4733 -- No. S-3-13-11
4734 /*+TidScan(ti1 ti1_pkey)*/
4735 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4736 INFO:  hint syntax error at or near "ti1_pkey)"
4737 DETAIL:  Closing parenthesis is necessary.
4738             QUERY PLAN             
4739 -----------------------------------
4740  Tid Scan on ti1
4741    TID Cond: (ctid = '(1,1)'::tid)
4742    Filter: (c1 = 1)
4743 (3 rows)
4744
4745 -- No. S-3-13-12
4746 /*+TidScan(ti1 ti1_pkey ti1_btree)*/
4747 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4748 INFO:  hint syntax error at or near "ti1_pkey ti1_btree)"
4749 DETAIL:  Closing parenthesis is necessary.
4750             QUERY PLAN             
4751 -----------------------------------
4752  Tid Scan on ti1
4753    TID Cond: (ctid = '(1,1)'::tid)
4754    Filter: (c1 = 1)
4755 (3 rows)
4756
4757 -- No. S-3-13-13
4758 /*+NoSeqScan(ti1)*/
4759 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4760 LOG:  pg_hint_plan:
4761 used hint:
4762 NoSeqScan(ti1)
4763 not used hint:
4764 duplication hint:
4765 error hint:
4766
4767             QUERY PLAN             
4768 -----------------------------------
4769  Tid Scan on ti1
4770    TID Cond: (ctid = '(1,1)'::tid)
4771    Filter: (c1 = 1)
4772 (3 rows)
4773
4774 -- No. S-3-13-14
4775 /*+NoSeqScan(ti1 ti1_pkey)*/
4776 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4777 INFO:  hint syntax error at or near "ti1_pkey)"
4778 DETAIL:  Closing parenthesis is necessary.
4779             QUERY PLAN             
4780 -----------------------------------
4781  Tid Scan on ti1
4782    TID Cond: (ctid = '(1,1)'::tid)
4783    Filter: (c1 = 1)
4784 (3 rows)
4785
4786 -- No. S-3-13-15
4787 /*+NoSeqScan(ti1 ti1_pkey ti1_btree)*/
4788 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4789 INFO:  hint syntax error at or near "ti1_pkey ti1_btree)"
4790 DETAIL:  Closing parenthesis is necessary.
4791             QUERY PLAN             
4792 -----------------------------------
4793  Tid Scan on ti1
4794    TID Cond: (ctid = '(1,1)'::tid)
4795    Filter: (c1 = 1)
4796 (3 rows)
4797
4798 -- No. S-3-13-16
4799 /*+NoIndexScan(ti1)*/
4800 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4801 LOG:  pg_hint_plan:
4802 used hint:
4803 NoIndexScan(ti1)
4804 not used hint:
4805 duplication hint:
4806 error hint:
4807
4808             QUERY PLAN             
4809 -----------------------------------
4810  Tid Scan on ti1
4811    TID Cond: (ctid = '(1,1)'::tid)
4812    Filter: (c1 = 1)
4813 (3 rows)
4814
4815 -- No. S-3-13-17
4816 /*+NoIndexScan(ti1 ti1_pkey)*/
4817 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4818 INFO:  hint syntax error at or near "ti1_pkey)"
4819 DETAIL:  Closing parenthesis is necessary.
4820             QUERY PLAN             
4821 -----------------------------------
4822  Tid Scan on ti1
4823    TID Cond: (ctid = '(1,1)'::tid)
4824    Filter: (c1 = 1)
4825 (3 rows)
4826
4827 -- No. S-3-13-18
4828 /*+NoIndexScan(ti1 ti1_pkey ti1_btree)*/
4829 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4830 INFO:  hint syntax error at or near "ti1_pkey ti1_btree)"
4831 DETAIL:  Closing parenthesis is necessary.
4832             QUERY PLAN             
4833 -----------------------------------
4834  Tid Scan on ti1
4835    TID Cond: (ctid = '(1,1)'::tid)
4836    Filter: (c1 = 1)
4837 (3 rows)
4838
4839 -- No. S-3-13-19
4840 /*+NoBitmapScan(ti1)*/
4841 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4842 LOG:  pg_hint_plan:
4843 used hint:
4844 NoBitmapScan(ti1)
4845 not used hint:
4846 duplication hint:
4847 error hint:
4848
4849             QUERY PLAN             
4850 -----------------------------------
4851  Tid Scan on ti1
4852    TID Cond: (ctid = '(1,1)'::tid)
4853    Filter: (c1 = 1)
4854 (3 rows)
4855
4856 -- No. S-3-13-20
4857 /*+NoBitmapScan(ti1 ti1_pkey)*/
4858 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4859 INFO:  hint syntax error at or near "ti1_pkey)"
4860 DETAIL:  Closing parenthesis is necessary.
4861             QUERY PLAN             
4862 -----------------------------------
4863  Tid Scan on ti1
4864    TID Cond: (ctid = '(1,1)'::tid)
4865    Filter: (c1 = 1)
4866 (3 rows)
4867
4868 -- No. S-3-13-21
4869 /*+NoBitmapScan(ti1 ti1_pkey ti1_btree)*/
4870 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4871 INFO:  hint syntax error at or near "ti1_pkey ti1_btree)"
4872 DETAIL:  Closing parenthesis is necessary.
4873             QUERY PLAN             
4874 -----------------------------------
4875  Tid Scan on ti1
4876    TID Cond: (ctid = '(1,1)'::tid)
4877    Filter: (c1 = 1)
4878 (3 rows)
4879
4880 -- No. S-3-13-22
4881 /*+NoTidScan(ti1)*/
4882 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4883 LOG:  pg_hint_plan:
4884 used hint:
4885 NoTidScan(ti1)
4886 not used hint:
4887 duplication hint:
4888 error hint:
4889
4890             QUERY PLAN            
4891 ----------------------------------
4892  Index Scan using ti1_uniq on ti1
4893    Index Cond: (c1 = 1)
4894    Filter: (ctid = '(1,1)'::tid)
4895 (3 rows)
4896
4897 -- No. S-3-13-23
4898 /*+NoTidScan(ti1 ti1_pkey)*/
4899 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4900 INFO:  hint syntax error at or near "ti1_pkey)"
4901 DETAIL:  Closing parenthesis is necessary.
4902             QUERY PLAN             
4903 -----------------------------------
4904  Tid Scan on ti1
4905    TID Cond: (ctid = '(1,1)'::tid)
4906    Filter: (c1 = 1)
4907 (3 rows)
4908
4909 -- No. S-3-13-24
4910 /*+NoTidScan(ti1 ti1_pkey ti1_btree)*/
4911 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4912 INFO:  hint syntax error at or near "ti1_pkey ti1_btree)"
4913 DETAIL:  Closing parenthesis is necessary.
4914             QUERY PLAN             
4915 -----------------------------------
4916  Tid Scan on ti1
4917    TID Cond: (ctid = '(1,1)'::tid)
4918    Filter: (c1 = 1)
4919 (3 rows)
4920