OSDN Git Service

デバッグログメッセージの修正に伴い、リグレッションテストの予想結果を修正した
[pghintplan/pg_hint_plan.git] / expected / ut-S-9.2.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 Only 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 Only 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 Only 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 Only 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 ut-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 Only 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 Only 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 Only Scan using t1_i1 on t1 b1t1
643                              ->  Index Only Scan using t3_i1 on t3 b1t3
644                        ->  Index Only 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 Only Scan using t1_i1 on t1 bmt1
655                      ->  Index Only Scan using t3_i1 on t3 bmt3
656                ->  Index Only 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:  candidate index for "b1t3": t3_pkey
672 LOG:  candidate index for "b1t4": t4_pkey
673 LOG:  candidate index for "bmt2": t2_pkey
674 LOG:  candidate index for "bmt3": t3_pkey
675 LOG:  pg_hint_plan:
676 used hint:
677 TidScan(b1t1)
678 SeqScan(b1t2)
679 IndexScan(b1t3 t3_pkey)
680 BitmapScan(b1t4 t4_pkey)
681 SeqScan(bmt1)
682 IndexScan(bmt2 t2_pkey)
683 BitmapScan(bmt3 t3_pkey)
684 TidScan(bmt4)
685 not used hint:
686 duplication hint:
687 error hint:
688
689                              QUERY PLAN                             
690 --------------------------------------------------------------------
691  Aggregate
692    InitPlan 1 (returns $2)
693      ->  Aggregate
694            ->  Hash Join
695                  Hash Cond: (b1t2.c1 = b1t1.c1)
696                  ->  Nested Loop
697                        Join Filter: (b1t2.c1 = b1t3.c1)
698                        ->  Nested Loop
699                              ->  Seq Scan on t2 b1t2
700                              ->  Bitmap Heap Scan on t4 b1t4
701                                    Recheck Cond: (c1 = b1t2.c1)
702                                    ->  Bitmap Index Scan on t4_pkey
703                                          Index Cond: (c1 = b1t2.c1)
704                        ->  Index Scan using t3_pkey on t3 b1t3
705                              Index Cond: (c1 = b1t4.c1)
706                  ->  Hash
707                        ->  Seq Scan on t1 b1t1
708    ->  Hash Join
709          Hash Cond: (bmt1.c1 = bmt4.c1)
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          ->  Hash
721                ->  Seq Scan on t4 bmt4
722 (31 rows)
723
724 -- No. S-2-1-2
725 EXPLAIN (COSTS false)
726 SELECT max(bmt1.c1), (
727 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
728 ), (
729 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
730 )
731                     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
732 ;
733                                QUERY PLAN                               
734 ------------------------------------------------------------------------
735  Aggregate
736    InitPlan 1 (returns $0)
737      ->  Aggregate
738            ->  Merge Join
739                  Merge Cond: (b1t1.c1 = b1t2.c1)
740                  ->  Merge Join
741                        Merge Cond: (b1t1.c1 = b1t4.c1)
742                        ->  Merge Join
743                              Merge Cond: (b1t1.c1 = b1t3.c1)
744                              ->  Index Only Scan using t1_i1 on t1 b1t1
745                              ->  Index Only Scan using t3_i1 on t3 b1t3
746                        ->  Index Only Scan using t4_i1 on t4 b1t4
747                  ->  Sort
748                        Sort Key: b1t2.c1
749                        ->  Seq Scan on t2 b1t2
750    InitPlan 2 (returns $1)
751      ->  Aggregate
752            ->  Merge Join
753                  Merge Cond: (b2t1.c1 = b2t2.c1)
754                  ->  Merge Join
755                        Merge Cond: (b2t1.c1 = b2t4.c1)
756                        ->  Merge Join
757                              Merge Cond: (b2t1.c1 = b2t3.c1)
758                              ->  Index Only Scan using t1_i1 on t1 b2t1
759                              ->  Index Only Scan using t3_i1 on t3 b2t3
760                        ->  Index Only Scan using t4_i1 on t4 b2t4
761                  ->  Sort
762                        Sort Key: b2t2.c1
763                        ->  Seq Scan on t2 b2t2
764    ->  Merge Join
765          Merge Cond: (bmt1.c1 = bmt2.c1)
766          ->  Merge Join
767                Merge Cond: (bmt1.c1 = bmt4.c1)
768                ->  Merge Join
769                      Merge Cond: (bmt1.c1 = bmt3.c1)
770                      ->  Index Only Scan using t1_i1 on t1 bmt1
771                      ->  Index Only Scan using t3_i1 on t3 bmt3
772                ->  Index Only Scan using t4_i1 on t4 bmt4
773          ->  Sort
774                Sort Key: bmt2.c1
775                ->  Seq Scan on t2 bmt2
776 (41 rows)
777
778 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
779 TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
780 BitmapScan(b2t1 t1_pkey)TidScan(b2t2)SeqScan(b2t3)IndexScan(b2t4 t4_pkey)
781 */
782 EXPLAIN (COSTS false)
783 SELECT max(bmt1.c1), (
784 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
785 ), (
786 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
787 )
788                     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
789 ;
790 LOG:  candidate index for "b1t3": t3_pkey
791 LOG:  candidate index for "b1t4": t4_pkey
792 LOG:  candidate index for "b2t1": t1_pkey
793 LOG:  candidate index for "b2t4": t4_pkey
794 LOG:  candidate index for "bmt2": t2_pkey
795 LOG:  candidate index for "bmt3": t3_pkey
796 LOG:  pg_hint_plan:
797 used hint:
798 TidScan(b1t1)
799 SeqScan(b1t2)
800 IndexScan(b1t3 t3_pkey)
801 BitmapScan(b1t4 t4_pkey)
802 BitmapScan(b2t1 t1_pkey)
803 TidScan(b2t2)
804 SeqScan(b2t3)
805 IndexScan(b2t4 t4_pkey)
806 SeqScan(bmt1)
807 IndexScan(bmt2 t2_pkey)
808 BitmapScan(bmt3 t3_pkey)
809 TidScan(bmt4)
810 not used hint:
811 duplication hint:
812 error hint:
813
814                              QUERY PLAN                              
815 ---------------------------------------------------------------------
816  Aggregate
817    InitPlan 1 (returns $2)
818      ->  Aggregate
819            ->  Hash Join
820                  Hash Cond: (b1t2.c1 = b1t1.c1)
821                  ->  Nested Loop
822                        Join Filter: (b1t2.c1 = b1t3.c1)
823                        ->  Nested Loop
824                              ->  Seq Scan on t2 b1t2
825                              ->  Bitmap Heap Scan on t4 b1t4
826                                    Recheck Cond: (c1 = b1t2.c1)
827                                    ->  Bitmap Index Scan on t4_pkey
828                                          Index Cond: (c1 = b1t2.c1)
829                        ->  Index Scan using t3_pkey on t3 b1t3
830                              Index Cond: (c1 = b1t4.c1)
831                  ->  Hash
832                        ->  Seq Scan on t1 b1t1
833    InitPlan 2 (returns $4)
834      ->  Aggregate
835            ->  Hash Join
836                  Hash Cond: (b2t1.c1 = b2t3.c1)
837                  ->  Merge Join
838                        Merge Cond: (b2t1.c1 = b2t2.c1)
839                        ->  Nested Loop
840                              ->  Index Scan using t4_pkey on t4 b2t4
841                              ->  Bitmap Heap Scan on t1 b2t1
842                                    Recheck Cond: (c1 = b2t4.c1)
843                                    ->  Bitmap Index Scan on t1_pkey
844                                          Index Cond: (c1 = b2t4.c1)
845                        ->  Sort
846                              Sort Key: b2t2.c1
847                              ->  Seq Scan on t2 b2t2
848                  ->  Hash
849                        ->  Seq Scan on t3 b2t3
850    ->  Hash Join
851          Hash Cond: (bmt1.c1 = bmt4.c1)
852          ->  Nested Loop
853                ->  Hash Join
854                      Hash Cond: (bmt1.c1 = bmt2.c1)
855                      ->  Seq Scan on t1 bmt1
856                      ->  Hash
857                            ->  Index Scan using t2_pkey on t2 bmt2
858                ->  Bitmap Heap Scan on t3 bmt3
859                      Recheck Cond: (c1 = bmt1.c1)
860                      ->  Bitmap Index Scan on t3_pkey
861                            Index Cond: (c1 = bmt1.c1)
862          ->  Hash
863                ->  Seq Scan on t4 bmt4
864 (48 rows)
865
866 -- No. S-2-1-3
867 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;
868                            QUERY PLAN                           
869 ----------------------------------------------------------------
870  Aggregate
871    ->  Merge Join
872          Merge Cond: (bmt1.c1 = bmt2.c1)
873          ->  Merge Join
874                Merge Cond: (bmt1.c1 = bmt4.c1)
875                ->  Merge Join
876                      Merge Cond: (bmt1.c1 = bmt3.c1)
877                      ->  Index Only Scan using t1_i1 on t1 bmt1
878                      ->  Index Only Scan using t3_i1 on t3 bmt3
879                ->  Index Only Scan using t4_i1 on t4 bmt4
880          ->  Sort
881                Sort Key: bmt2.c1
882                ->  Seq Scan on t2 bmt2
883 (13 rows)
884
885 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
886 */
887 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;
888 LOG:  candidate index for "bmt2": t2_pkey
889 LOG:  candidate index for "bmt3": t3_pkey
890 LOG:  pg_hint_plan:
891 used hint:
892 SeqScan(bmt1)
893 IndexScan(bmt2 t2_pkey)
894 BitmapScan(bmt3 t3_pkey)
895 TidScan(bmt4)
896 not used hint:
897 duplication hint:
898 error hint:
899
900                             QUERY PLAN                             
901 -------------------------------------------------------------------
902  Aggregate
903    ->  Hash Join
904          Hash Cond: (bmt1.c1 = bmt4.c1)
905          ->  Nested Loop
906                ->  Hash Join
907                      Hash Cond: (bmt1.c1 = bmt2.c1)
908                      ->  Seq Scan on t1 bmt1
909                      ->  Hash
910                            ->  Index Scan using t2_pkey on t2 bmt2
911                ->  Bitmap Heap Scan on t3 bmt3
912                      Recheck Cond: (c1 = bmt1.c1)
913                      ->  Bitmap Index Scan on t3_pkey
914                            Index Cond: (c1 = bmt1.c1)
915          ->  Hash
916                ->  Seq Scan on t4 bmt4
917 (15 rows)
918
919 -- No. S-2-1-4
920 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;
921                            QUERY PLAN                           
922 ----------------------------------------------------------------
923  Aggregate
924    ->  Merge Join
925          Merge Cond: (bmt1.c1 = bmt2.c1)
926          ->  Merge Join
927                Merge Cond: (bmt1.c1 = bmt4.c1)
928                ->  Merge Join
929                      Merge Cond: (bmt1.c1 = bmt3.c1)
930                      ->  Index Only Scan using t1_i1 on t1 bmt1
931                      ->  Index Only Scan using t3_i1 on t3 bmt3
932                ->  Index Only Scan using t4_i1 on t4 bmt4
933          ->  Sort
934                Sort Key: bmt2.c1
935                ->  Seq Scan on t2 bmt2
936 (13 rows)
937
938 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
939 */
940 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;
941 LOG:  candidate index for "bmt2": t2_pkey
942 LOG:  candidate index for "bmt3": t3_pkey
943 LOG:  pg_hint_plan:
944 used hint:
945 SeqScan(bmt1)
946 IndexScan(bmt2 t2_pkey)
947 BitmapScan(bmt3 t3_pkey)
948 TidScan(bmt4)
949 not used hint:
950 duplication hint:
951 error hint:
952
953                             QUERY PLAN                             
954 -------------------------------------------------------------------
955  Aggregate
956    ->  Hash Join
957          Hash Cond: (bmt1.c1 = bmt4.c1)
958          ->  Nested Loop
959                ->  Hash Join
960                      Hash Cond: (bmt1.c1 = bmt2.c1)
961                      ->  Seq Scan on t1 bmt1
962                      ->  Hash
963                            ->  Index Scan using t2_pkey on t2 bmt2
964                ->  Bitmap Heap Scan on t3 bmt3
965                      Recheck Cond: (c1 = bmt1.c1)
966                      ->  Bitmap Index Scan on t3_pkey
967                            Index Cond: (c1 = bmt1.c1)
968          ->  Hash
969                ->  Seq Scan on t4 bmt4
970 (15 rows)
971
972 -- No. S-2-1-5
973 EXPLAIN (COSTS false)
974 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
975   AND bmt1.c1 <> (
976 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
977 )
978 ;
979                                QUERY PLAN                               
980 ------------------------------------------------------------------------
981  Aggregate
982    InitPlan 1 (returns $0)
983      ->  Aggregate
984            ->  Merge Join
985                  Merge Cond: (b1t1.c1 = b1t2.c1)
986                  ->  Merge Join
987                        Merge Cond: (b1t1.c1 = b1t4.c1)
988                        ->  Merge Join
989                              Merge Cond: (b1t1.c1 = b1t3.c1)
990                              ->  Index Only Scan using t1_i1 on t1 b1t1
991                              ->  Index Only Scan using t3_i1 on t3 b1t3
992                        ->  Index Only Scan using t4_i1 on t4 b1t4
993                  ->  Sort
994                        Sort Key: b1t2.c1
995                        ->  Seq Scan on t2 b1t2
996    ->  Merge Join
997          Merge Cond: (bmt1.c1 = bmt2.c1)
998          ->  Merge Join
999                Merge Cond: (bmt1.c1 = bmt4.c1)
1000                ->  Merge Join
1001                      Merge Cond: (bmt1.c1 = bmt3.c1)
1002                      ->  Index Only Scan using t1_i1 on t1 bmt1
1003                            Filter: (c1 <> $0)
1004                      ->  Index Only Scan using t3_i1 on t3 bmt3
1005                ->  Index Only Scan using t4_i1 on t4 bmt4
1006          ->  Sort
1007                Sort Key: bmt2.c1
1008                ->  Seq Scan on t2 bmt2
1009 (28 rows)
1010
1011 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
1012 TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
1013 */
1014 EXPLAIN (COSTS false)
1015 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
1016   AND bmt1.c1 <> (
1017 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
1018 )
1019 ;
1020 LOG:  candidate index for "b1t3": t3_pkey
1021 LOG:  candidate index for "b1t4": t4_pkey
1022 LOG:  candidate index for "bmt2": t2_pkey
1023 LOG:  candidate index for "bmt3": t3_pkey
1024 LOG:  pg_hint_plan:
1025 used hint:
1026 TidScan(b1t1)
1027 SeqScan(b1t2)
1028 IndexScan(b1t3 t3_pkey)
1029 BitmapScan(b1t4 t4_pkey)
1030 SeqScan(bmt1)
1031 IndexScan(bmt2 t2_pkey)
1032 BitmapScan(bmt3 t3_pkey)
1033 TidScan(bmt4)
1034 not used hint:
1035 duplication hint:
1036 error hint:
1037
1038                              QUERY PLAN                             
1039 --------------------------------------------------------------------
1040  Aggregate
1041    InitPlan 1 (returns $2)
1042      ->  Aggregate
1043            ->  Hash Join
1044                  Hash Cond: (b1t2.c1 = b1t1.c1)
1045                  ->  Nested Loop
1046                        Join Filter: (b1t2.c1 = b1t3.c1)
1047                        ->  Nested Loop
1048                              ->  Seq Scan on t2 b1t2
1049                              ->  Bitmap Heap Scan on t4 b1t4
1050                                    Recheck Cond: (c1 = b1t2.c1)
1051                                    ->  Bitmap Index Scan on t4_pkey
1052                                          Index Cond: (c1 = b1t2.c1)
1053                        ->  Index Scan using t3_pkey on t3 b1t3
1054                              Index Cond: (c1 = b1t4.c1)
1055                  ->  Hash
1056                        ->  Seq Scan on t1 b1t1
1057    ->  Hash Join
1058          Hash Cond: (bmt1.c1 = bmt4.c1)
1059          ->  Nested Loop
1060                ->  Hash Join
1061                      Hash Cond: (bmt1.c1 = bmt2.c1)
1062                      ->  Seq Scan on t1 bmt1
1063                            Filter: (c1 <> $2)
1064                      ->  Hash
1065                            ->  Index Scan using t2_pkey on t2 bmt2
1066                ->  Bitmap Heap Scan on t3 bmt3
1067                      Recheck Cond: (c1 = bmt1.c1)
1068                      ->  Bitmap Index Scan on t3_pkey
1069                            Index Cond: (c1 = bmt1.c1)
1070          ->  Hash
1071                ->  Seq Scan on t4 bmt4
1072 (32 rows)
1073
1074 -- No. S-2-1-6
1075 EXPLAIN (COSTS false)
1076 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
1077   AND bmt1.c1 <> (
1078 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
1079 ) AND bmt1.c1 <> (
1080 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
1081 )
1082 ;
1083                                QUERY PLAN                               
1084 ------------------------------------------------------------------------
1085  Aggregate
1086    InitPlan 1 (returns $0)
1087      ->  Aggregate
1088            ->  Merge Join
1089                  Merge Cond: (b1t1.c1 = b1t2.c1)
1090                  ->  Merge Join
1091                        Merge Cond: (b1t1.c1 = b1t4.c1)
1092                        ->  Merge Join
1093                              Merge Cond: (b1t1.c1 = b1t3.c1)
1094                              ->  Index Only Scan using t1_i1 on t1 b1t1
1095                              ->  Index Only Scan using t3_i1 on t3 b1t3
1096                        ->  Index Only Scan using t4_i1 on t4 b1t4
1097                  ->  Sort
1098                        Sort Key: b1t2.c1
1099                        ->  Seq Scan on t2 b1t2
1100    InitPlan 2 (returns $1)
1101      ->  Aggregate
1102            ->  Merge Join
1103                  Merge Cond: (b2t1.c1 = b2t2.c1)
1104                  ->  Merge Join
1105                        Merge Cond: (b2t1.c1 = b2t4.c1)
1106                        ->  Merge Join
1107                              Merge Cond: (b2t1.c1 = b2t3.c1)
1108                              ->  Index Only Scan using t1_i1 on t1 b2t1
1109                              ->  Index Only Scan using t3_i1 on t3 b2t3
1110                        ->  Index Only Scan using t4_i1 on t4 b2t4
1111                  ->  Sort
1112                        Sort Key: b2t2.c1
1113                        ->  Seq Scan on t2 b2t2
1114    ->  Merge Join
1115          Merge Cond: (bmt1.c1 = bmt2.c1)
1116          ->  Merge Join
1117                Merge Cond: (bmt1.c1 = bmt4.c1)
1118                ->  Merge Join
1119                      Merge Cond: (bmt1.c1 = bmt3.c1)
1120                      ->  Index Only Scan using t1_i1 on t1 bmt1
1121                            Filter: ((c1 <> $0) AND (c1 <> $1))
1122                      ->  Index Only Scan using t3_i1 on t3 bmt3
1123                ->  Index Only Scan using t4_i1 on t4 bmt4
1124          ->  Sort
1125                Sort Key: bmt2.c1
1126                ->  Seq Scan on t2 bmt2
1127 (42 rows)
1128
1129 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
1130 TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
1131 BitmapScan(b2t1 t1_pkey)TidScan(b2t2)SeqScan(b2t3)IndexScan(b2t4 t4_pkey)
1132 */
1133 EXPLAIN (COSTS false)
1134 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
1135   AND bmt1.c1 <> (
1136 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
1137 ) AND bmt1.c1 <> (
1138 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
1139 )
1140 ;
1141 LOG:  candidate index for "b1t3": t3_pkey
1142 LOG:  candidate index for "b1t4": t4_pkey
1143 LOG:  candidate index for "b2t1": t1_pkey
1144 LOG:  candidate index for "b2t4": t4_pkey
1145 LOG:  candidate index for "bmt2": t2_pkey
1146 LOG:  candidate index for "bmt3": t3_pkey
1147 LOG:  pg_hint_plan:
1148 used hint:
1149 TidScan(b1t1)
1150 SeqScan(b1t2)
1151 IndexScan(b1t3 t3_pkey)
1152 BitmapScan(b1t4 t4_pkey)
1153 BitmapScan(b2t1 t1_pkey)
1154 TidScan(b2t2)
1155 SeqScan(b2t3)
1156 IndexScan(b2t4 t4_pkey)
1157 SeqScan(bmt1)
1158 IndexScan(bmt2 t2_pkey)
1159 BitmapScan(bmt3 t3_pkey)
1160 TidScan(bmt4)
1161 not used hint:
1162 duplication hint:
1163 error hint:
1164
1165                              QUERY PLAN                              
1166 ---------------------------------------------------------------------
1167  Aggregate
1168    InitPlan 1 (returns $2)
1169      ->  Aggregate
1170            ->  Hash Join
1171                  Hash Cond: (b1t2.c1 = b1t1.c1)
1172                  ->  Nested Loop
1173                        Join Filter: (b1t2.c1 = b1t3.c1)
1174                        ->  Nested Loop
1175                              ->  Seq Scan on t2 b1t2
1176                              ->  Bitmap Heap Scan on t4 b1t4
1177                                    Recheck Cond: (c1 = b1t2.c1)
1178                                    ->  Bitmap Index Scan on t4_pkey
1179                                          Index Cond: (c1 = b1t2.c1)
1180                        ->  Index Scan using t3_pkey on t3 b1t3
1181                              Index Cond: (c1 = b1t4.c1)
1182                  ->  Hash
1183                        ->  Seq Scan on t1 b1t1
1184    InitPlan 2 (returns $4)
1185      ->  Aggregate
1186            ->  Hash Join
1187                  Hash Cond: (b2t1.c1 = b2t3.c1)
1188                  ->  Merge Join
1189                        Merge Cond: (b2t1.c1 = b2t2.c1)
1190                        ->  Nested Loop
1191                              ->  Index Scan using t4_pkey on t4 b2t4
1192                              ->  Bitmap Heap Scan on t1 b2t1
1193                                    Recheck Cond: (c1 = b2t4.c1)
1194                                    ->  Bitmap Index Scan on t1_pkey
1195                                          Index Cond: (c1 = b2t4.c1)
1196                        ->  Sort
1197                              Sort Key: b2t2.c1
1198                              ->  Seq Scan on t2 b2t2
1199                  ->  Hash
1200                        ->  Seq Scan on t3 b2t3
1201    ->  Hash Join
1202          Hash Cond: (bmt1.c1 = bmt4.c1)
1203          ->  Nested Loop
1204                ->  Hash Join
1205                      Hash Cond: (bmt1.c1 = bmt2.c1)
1206                      ->  Seq Scan on t1 bmt1
1207                            Filter: ((c1 <> $2) AND (c1 <> $4))
1208                      ->  Hash
1209                            ->  Index Scan using t2_pkey on t2 bmt2
1210                ->  Bitmap Heap Scan on t3 bmt3
1211                      Recheck Cond: (c1 = bmt1.c1)
1212                      ->  Bitmap Index Scan on t3_pkey
1213                            Index Cond: (c1 = bmt1.c1)
1214          ->  Hash
1215                ->  Seq Scan on t4 bmt4
1216 (49 rows)
1217
1218 -- No. S-2-1-7
1219 EXPLAIN (COSTS false)
1220 WITH c1 (c1) AS (
1221 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
1222 )
1223 SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
1224 , c1
1225                                                                         WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
1226 AND bmt1.c1 = c1.c1
1227 ;
1228                                QUERY PLAN                               
1229 ------------------------------------------------------------------------
1230  Aggregate
1231    CTE c1
1232      ->  Aggregate
1233            ->  Merge Join
1234                  Merge Cond: (b1t1.c1 = b1t2.c1)
1235                  ->  Merge Join
1236                        Merge Cond: (b1t1.c1 = b1t4.c1)
1237                        ->  Merge Join
1238                              Merge Cond: (b1t1.c1 = b1t3.c1)
1239                              ->  Index Only Scan using t1_i1 on t1 b1t1
1240                              ->  Index Only Scan using t3_i1 on t3 b1t3
1241                        ->  Index Only Scan using t4_i1 on t4 b1t4
1242                  ->  Sort
1243                        Sort Key: b1t2.c1
1244                        ->  Seq Scan on t2 b1t2
1245    ->  Nested Loop
1246          Join Filter: (bmt1.c1 = bmt4.c1)
1247          ->  Nested Loop
1248                Join Filter: (bmt2.c1 = bmt1.c1)
1249                ->  Nested Loop
1250                      ->  Hash Join
1251                            Hash Cond: (bmt2.c1 = c1.c1)
1252                            ->  Seq Scan on t2 bmt2
1253                            ->  Hash
1254                                  ->  CTE Scan on c1
1255                      ->  Index Only Scan using t3_i1 on t3 bmt3
1256                            Index Cond: (c1 = bmt2.c1)
1257                ->  Index Only Scan using t1_i1 on t1 bmt1
1258                      Index Cond: (c1 = bmt3.c1)
1259          ->  Index Only Scan using t4_i1 on t4 bmt4
1260                Index Cond: (c1 = bmt3.c1)
1261 (31 rows)
1262
1263 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
1264 TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
1265 */
1266 EXPLAIN (COSTS false)
1267 WITH c1 (c1) AS (
1268 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
1269 )
1270 SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
1271 , c1
1272                                                                         WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
1273 AND bmt1.c1 = c1.c1
1274 ;
1275 LOG:  candidate index for "b1t3": t3_pkey
1276 LOG:  candidate index for "b1t4": t4_pkey
1277 LOG:  candidate index for "bmt2": t2_pkey
1278 LOG:  candidate index for "bmt3": t3_pkey
1279 LOG:  pg_hint_plan:
1280 used hint:
1281 TidScan(b1t1)
1282 SeqScan(b1t2)
1283 IndexScan(b1t3 t3_pkey)
1284 BitmapScan(b1t4 t4_pkey)
1285 SeqScan(bmt1)
1286 IndexScan(bmt2 t2_pkey)
1287 BitmapScan(bmt3 t3_pkey)
1288 TidScan(bmt4)
1289 not used hint:
1290 duplication hint:
1291 error hint:
1292
1293                              QUERY PLAN                             
1294 --------------------------------------------------------------------
1295  Aggregate
1296    CTE c1
1297      ->  Aggregate
1298            ->  Hash Join
1299                  Hash Cond: (b1t2.c1 = b1t1.c1)
1300                  ->  Nested Loop
1301                        Join Filter: (b1t2.c1 = b1t3.c1)
1302                        ->  Nested Loop
1303                              ->  Seq Scan on t2 b1t2
1304                              ->  Bitmap Heap Scan on t4 b1t4
1305                                    Recheck Cond: (c1 = b1t2.c1)
1306                                    ->  Bitmap Index Scan on t4_pkey
1307                                          Index Cond: (c1 = b1t2.c1)
1308                        ->  Index Scan using t3_pkey on t3 b1t3
1309                              Index Cond: (c1 = b1t4.c1)
1310                  ->  Hash
1311                        ->  Seq Scan on t1 b1t1
1312    ->  Nested Loop
1313          Join Filter: (bmt1.c1 = bmt4.c1)
1314          ->  Nested Loop
1315                ->  Nested Loop
1316                      ->  Hash Join
1317                            Hash Cond: (bmt1.c1 = c1.c1)
1318                            ->  Seq Scan on t1 bmt1
1319                            ->  Hash
1320                                  ->  CTE Scan on c1
1321                      ->  Index Scan using t2_pkey on t2 bmt2
1322                            Index Cond: (c1 = bmt1.c1)
1323                ->  Bitmap Heap Scan on t3 bmt3
1324                      Recheck Cond: (c1 = bmt1.c1)
1325                      ->  Bitmap Index Scan on t3_pkey
1326                            Index Cond: (c1 = bmt1.c1)
1327          ->  Seq Scan on t4 bmt4
1328 (33 rows)
1329
1330 -- No. S-2-1-8
1331 EXPLAIN (COSTS false)
1332 WITH c1 (c1) AS (
1333 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
1334 )
1335 , c2 (c1) AS (
1336 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
1337 )
1338 SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
1339 , c1, c2
1340                                                                         WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
1341 AND bmt1.c1 = c1.c1
1342 AND bmt1.c1 = c2.c1
1343 ;
1344                                QUERY PLAN                               
1345 ------------------------------------------------------------------------
1346  Aggregate
1347    CTE c1
1348      ->  Aggregate
1349            ->  Merge Join
1350                  Merge Cond: (b1t1.c1 = b1t2.c1)
1351                  ->  Merge Join
1352                        Merge Cond: (b1t1.c1 = b1t4.c1)
1353                        ->  Merge Join
1354                              Merge Cond: (b1t1.c1 = b1t3.c1)
1355                              ->  Index Only Scan using t1_i1 on t1 b1t1
1356                              ->  Index Only Scan using t3_i1 on t3 b1t3
1357                        ->  Index Only Scan using t4_i1 on t4 b1t4
1358                  ->  Sort
1359                        Sort Key: b1t2.c1
1360                        ->  Seq Scan on t2 b1t2
1361    CTE c2
1362      ->  Aggregate
1363            ->  Merge Join
1364                  Merge Cond: (b2t1.c1 = b2t2.c1)
1365                  ->  Merge Join
1366                        Merge Cond: (b2t1.c1 = b2t4.c1)
1367                        ->  Merge Join
1368                              Merge Cond: (b2t1.c1 = b2t3.c1)
1369                              ->  Index Only Scan using t1_i1 on t1 b2t1
1370                              ->  Index Only Scan using t3_i1 on t3 b2t3
1371                        ->  Index Only Scan using t4_i1 on t4 b2t4
1372                  ->  Sort
1373                        Sort Key: b2t2.c1
1374                        ->  Seq Scan on t2 b2t2
1375    ->  Nested Loop
1376          Join Filter: (bmt1.c1 = c2.c1)
1377          ->  Nested Loop
1378                Join Filter: (bmt1.c1 = bmt4.c1)
1379                ->  Nested Loop
1380                      Join Filter: (bmt2.c1 = bmt1.c1)
1381                      ->  Nested Loop
1382                            ->  Hash Join
1383                                  Hash Cond: (bmt2.c1 = c1.c1)
1384                                  ->  Seq Scan on t2 bmt2
1385                                  ->  Hash
1386                                        ->  CTE Scan on c1
1387                            ->  Index Only Scan using t3_i1 on t3 bmt3
1388                                  Index Cond: (c1 = bmt2.c1)
1389                      ->  Index Only Scan using t1_i1 on t1 bmt1
1390                            Index Cond: (c1 = bmt3.c1)
1391                ->  Index Only Scan using t4_i1 on t4 bmt4
1392                      Index Cond: (c1 = bmt3.c1)
1393          ->  CTE Scan on c2
1394 (48 rows)
1395
1396 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
1397 TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
1398 BitmapScan(b2t1 t1_pkey)TidScan(b2t2)SeqScan(b2t3)IndexScan(b2t4 t4_pkey)
1399 */
1400 EXPLAIN (COSTS false)
1401 WITH c1 (c1) AS (
1402 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
1403 )
1404 , c2 (c1) AS (
1405 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
1406 )
1407 SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
1408 , c1, c2
1409                                                                         WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
1410 AND bmt1.c1 = c1.c1
1411 AND bmt1.c1 = c2.c1
1412 ;
1413 LOG:  candidate index for "b1t3": t3_pkey
1414 LOG:  candidate index for "b1t4": t4_pkey
1415 LOG:  candidate index for "b2t1": t1_pkey
1416 LOG:  candidate index for "b2t4": t4_pkey
1417 LOG:  candidate index for "bmt2": t2_pkey
1418 LOG:  candidate index for "bmt3": t3_pkey
1419 LOG:  pg_hint_plan:
1420 used hint:
1421 TidScan(b1t1)
1422 SeqScan(b1t2)
1423 IndexScan(b1t3 t3_pkey)
1424 BitmapScan(b1t4 t4_pkey)
1425 BitmapScan(b2t1 t1_pkey)
1426 TidScan(b2t2)
1427 SeqScan(b2t3)
1428 IndexScan(b2t4 t4_pkey)
1429 SeqScan(bmt1)
1430 IndexScan(bmt2 t2_pkey)
1431 BitmapScan(bmt3 t3_pkey)
1432 TidScan(bmt4)
1433 not used hint:
1434 duplication hint:
1435 error hint:
1436
1437                              QUERY PLAN                              
1438 ---------------------------------------------------------------------
1439  Aggregate
1440    CTE c1
1441      ->  Aggregate
1442            ->  Hash Join
1443                  Hash Cond: (b1t2.c1 = b1t1.c1)
1444                  ->  Nested Loop
1445                        Join Filter: (b1t2.c1 = b1t3.c1)
1446                        ->  Nested Loop
1447                              ->  Seq Scan on t2 b1t2
1448                              ->  Bitmap Heap Scan on t4 b1t4
1449                                    Recheck Cond: (c1 = b1t2.c1)
1450                                    ->  Bitmap Index Scan on t4_pkey
1451                                          Index Cond: (c1 = b1t2.c1)
1452                        ->  Index Scan using t3_pkey on t3 b1t3
1453                              Index Cond: (c1 = b1t4.c1)
1454                  ->  Hash
1455                        ->  Seq Scan on t1 b1t1
1456    CTE c2
1457      ->  Aggregate
1458            ->  Hash Join
1459                  Hash Cond: (b2t1.c1 = b2t3.c1)
1460                  ->  Merge Join
1461                        Merge Cond: (b2t1.c1 = b2t2.c1)
1462                        ->  Nested Loop
1463                              ->  Index Scan using t4_pkey on t4 b2t4
1464                              ->  Bitmap Heap Scan on t1 b2t1
1465                                    Recheck Cond: (c1 = b2t4.c1)
1466                                    ->  Bitmap Index Scan on t1_pkey
1467                                          Index Cond: (c1 = b2t4.c1)
1468                        ->  Sort
1469                              Sort Key: b2t2.c1
1470                              ->  Seq Scan on t2 b2t2
1471                  ->  Hash
1472                        ->  Seq Scan on t3 b2t3
1473    ->  Nested Loop
1474          Join Filter: (bmt1.c1 = bmt4.c1)
1475          ->  Nested Loop
1476                Join Filter: (bmt1.c1 = c2.c1)
1477                ->  Nested Loop
1478                      ->  Nested Loop
1479                            ->  Hash Join
1480                                  Hash Cond: (bmt1.c1 = c1.c1)
1481                                  ->  Seq Scan on t1 bmt1
1482                                  ->  Hash
1483                                        ->  CTE Scan on c1
1484                            ->  Index Scan using t2_pkey on t2 bmt2
1485                                  Index Cond: (c1 = bmt1.c1)
1486                      ->  Bitmap Heap Scan on t3 bmt3
1487                            Recheck Cond: (c1 = bmt1.c1)
1488                            ->  Bitmap Index Scan on t3_pkey
1489                                  Index Cond: (c1 = bmt1.c1)
1490                ->  CTE Scan on c2
1491          ->  Seq Scan on t4 bmt4
1492 (53 rows)
1493
1494 ----
1495 ---- No. S-2-2 the number of the tables per quiry block
1496 ----
1497 -- No. S-2-2-1
1498 EXPLAIN (COSTS false)
1499 WITH c1 (c1) AS (
1500 SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = 1
1501 )
1502 SELECT max(bmt1.c1), (
1503 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
1504 )
1505                     FROM s1.t1 bmt1, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = 1
1506 AND bmt1.c1 <> (
1507 SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = 1
1508 )
1509 ;
1510                            QUERY PLAN                            
1511 -----------------------------------------------------------------
1512  Aggregate
1513    CTE c1
1514      ->  Result
1515            InitPlan 1 (returns $0)
1516              ->  Limit
1517                    ->  Tid Scan on t1 b1t1
1518                          TID Cond: (ctid = '(1,1)'::tid)
1519                          Filter: ((c1 IS NOT NULL) AND (c1 = 1))
1520    InitPlan 4 (returns $3)
1521      ->  Result
1522            InitPlan 3 (returns $2)
1523              ->  Limit
1524                    ->  Tid Scan on t1 b2t1
1525                          TID Cond: (ctid = '(1,1)'::tid)
1526                          Filter: ((c1 IS NOT NULL) AND (c1 = 1))
1527    InitPlan 6 (returns $5)
1528      ->  Result
1529            InitPlan 5 (returns $4)
1530              ->  Limit
1531                    ->  Tid Scan on t1 b3t1
1532                          TID Cond: (ctid = '(1,1)'::tid)
1533                          Filter: ((c1 IS NOT NULL) AND (c1 = 1))
1534    ->  Nested Loop
1535          ->  Tid Scan on t1 bmt1
1536                TID Cond: (ctid = '(1,1)'::tid)
1537                Filter: ((c1 <> $5) AND (c1 = 1))
1538          ->  CTE Scan on c1
1539 (27 rows)
1540
1541 /*+SeqScan(bmt1)
1542 TidScan(b1t1)
1543 BitmapScan(b2t1 t1_pkey)
1544 IndexScan(b3t1 t1_pkey)
1545 */
1546 EXPLAIN (COSTS false)
1547 WITH c1 (c1) AS (
1548 SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = 1
1549 )
1550 SELECT max(bmt1.c1), (
1551 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
1552 )
1553                     FROM s1.t1 bmt1, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = 1
1554 AND bmt1.c1 <> (
1555 SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = 1
1556 )
1557 ;
1558 LOG:  candidate index for "b2t1": t1_pkey
1559 LOG:  candidate index for "b2t1": t1_pkey
1560 LOG:  candidate index for "b3t1": t1_pkey
1561 LOG:  candidate index for "b3t1": t1_pkey
1562 LOG:  pg_hint_plan:
1563 used hint:
1564 TidScan(b1t1)
1565 BitmapScan(b2t1 t1_pkey)
1566 IndexScan(b3t1 t1_pkey)
1567 SeqScan(bmt1)
1568 not used hint:
1569 duplication hint:
1570 error hint:
1571
1572                                 QUERY PLAN                                 
1573 ---------------------------------------------------------------------------
1574  Aggregate
1575    CTE c1
1576      ->  Result
1577            InitPlan 1 (returns $0)
1578              ->  Limit
1579                    ->  Tid Scan on t1 b1t1
1580                          TID Cond: (ctid = '(1,1)'::tid)
1581                          Filter: ((c1 IS NOT NULL) AND (c1 = 1))
1582    InitPlan 4 (returns $3)
1583      ->  Result
1584            InitPlan 3 (returns $2)
1585              ->  Limit
1586                    ->  Bitmap Heap Scan on t1 b2t1
1587                          Recheck Cond: ((c1 IS NOT NULL) AND (c1 = 1))
1588                          Filter: (ctid = '(1,1)'::tid)
1589                          ->  Bitmap Index Scan on t1_pkey
1590                                Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
1591    InitPlan 6 (returns $5)
1592      ->  Result
1593            InitPlan 5 (returns $4)
1594              ->  Limit
1595                    ->  Index Scan using t1_pkey on t1 b3t1
1596                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
1597                          Filter: (ctid = '(1,1)'::tid)
1598    ->  Nested Loop
1599          ->  Seq Scan on t1 bmt1
1600                Filter: ((c1 <> $5) AND (ctid = '(1,1)'::tid) AND (c1 = 1))
1601          ->  CTE Scan on c1
1602 (28 rows)
1603
1604 -- No. S-2-2-2
1605 EXPLAIN (COSTS false)
1606 WITH c1 (c1) AS (
1607 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)'
1608 )
1609 SELECT max(bmt1.c1), (
1610 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)'
1611 )
1612                     FROM s1.t1 bmt1, s1.t2 bmt2, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)'
1613 AND bmt1.c1 <> (
1614 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)'
1615 )
1616 ;
1617                       QUERY PLAN                       
1618 -------------------------------------------------------
1619  Aggregate
1620    CTE c1
1621      ->  Aggregate
1622            ->  Nested Loop
1623                  Join Filter: (b1t1.c1 = b1t2.c1)
1624                  ->  Tid Scan on t1 b1t1
1625                        TID Cond: (ctid = '(1,1)'::tid)
1626                  ->  Seq Scan on t2 b1t2
1627                        Filter: (ctid = '(1,1)'::tid)
1628    InitPlan 2 (returns $1)
1629      ->  Aggregate
1630            ->  Nested Loop
1631                  Join Filter: (b2t1.c1 = b2t2.c1)
1632                  ->  Tid Scan on t1 b2t1
1633                        TID Cond: (ctid = '(1,1)'::tid)
1634                  ->  Seq Scan on t2 b2t2
1635                        Filter: (ctid = '(1,1)'::tid)
1636    InitPlan 3 (returns $2)
1637      ->  Aggregate
1638            ->  Nested Loop
1639                  Join Filter: (b3t1.c1 = b3t2.c1)
1640                  ->  Tid Scan on t1 b3t1
1641                        TID Cond: (ctid = '(1,1)'::tid)
1642                  ->  Seq Scan on t2 b3t2
1643                        Filter: (ctid = '(1,1)'::tid)
1644    ->  Nested Loop
1645          ->  Nested Loop
1646                Join Filter: (bmt1.c1 = bmt2.c1)
1647                ->  Tid Scan on t1 bmt1
1648                      TID Cond: (ctid = '(1,1)'::tid)
1649                      Filter: (c1 <> $2)
1650                ->  Seq Scan on t2 bmt2
1651                      Filter: (ctid = '(1,1)'::tid)
1652          ->  CTE Scan on c1
1653 (34 rows)
1654
1655 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)
1656 TidScan(b1t1)SeqScan(b1t2)
1657 BitmapScan(b2t1 t1_pkey)TidScan(b2t2)
1658 IndexScan(b3t1 t1_pkey)BitmapScan(b3t2 t2_pkey)
1659 */
1660 EXPLAIN (COSTS false)
1661 WITH c1 (c1) AS (
1662 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)'
1663 )
1664 SELECT max(bmt1.c1), (
1665 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)'
1666 )
1667                     FROM s1.t1 bmt1, s1.t2 bmt2, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)'
1668 AND bmt1.c1 <> (
1669 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)'
1670 )
1671 ;
1672 LOG:  candidate index for "b2t1": t1_pkey
1673 LOG:  candidate index for "b3t1": t1_pkey
1674 LOG:  candidate index for "b3t2": t2_pkey
1675 LOG:  candidate index for "bmt2": t2_pkey
1676 LOG:  pg_hint_plan:
1677 used hint:
1678 TidScan(b1t1)
1679 SeqScan(b1t2)
1680 BitmapScan(b2t1 t1_pkey)
1681 TidScan(b2t2)
1682 IndexScan(b3t1 t1_pkey)
1683 BitmapScan(b3t2 t2_pkey)
1684 SeqScan(bmt1)
1685 IndexScan(bmt2 t2_pkey)
1686 not used hint:
1687 duplication hint:
1688 error hint:
1689
1690                              QUERY PLAN                             
1691 --------------------------------------------------------------------
1692  Aggregate
1693    CTE c1
1694      ->  Aggregate
1695            ->  Nested Loop
1696                  Join Filter: (b1t1.c1 = b1t2.c1)
1697                  ->  Tid Scan on t1 b1t1
1698                        TID Cond: (ctid = '(1,1)'::tid)
1699                  ->  Seq Scan on t2 b1t2
1700                        Filter: (ctid = '(1,1)'::tid)
1701    InitPlan 2 (returns $2)
1702      ->  Aggregate
1703            ->  Nested Loop
1704                  ->  Tid Scan on t2 b2t2
1705                        TID Cond: (ctid = '(1,1)'::tid)
1706                  ->  Bitmap Heap Scan on t1 b2t1
1707                        Recheck Cond: (c1 = b2t2.c1)
1708                        Filter: (ctid = '(1,1)'::tid)
1709                        ->  Bitmap Index Scan on t1_pkey
1710                              Index Cond: (c1 = b2t2.c1)
1711    InitPlan 3 (returns $4)
1712      ->  Aggregate
1713            ->  Nested Loop
1714                  ->  Index Scan using t1_pkey on t1 b3t1
1715                        Filter: (ctid = '(1,1)'::tid)
1716                  ->  Bitmap Heap Scan on t2 b3t2
1717                        Recheck Cond: (c1 = b3t1.c1)
1718                        Filter: (ctid = '(1,1)'::tid)
1719                        ->  Bitmap Index Scan on t2_pkey
1720                              Index Cond: (c1 = b3t1.c1)
1721    ->  Nested Loop
1722          ->  Nested Loop
1723                ->  Seq Scan on t1 bmt1
1724                      Filter: ((c1 <> $4) AND (ctid = '(1,1)'::tid))
1725                ->  Index Scan using t2_pkey on t2 bmt2
1726                      Index Cond: (c1 = bmt1.c1)
1727                      Filter: (ctid = '(1,1)'::tid)
1728          ->  CTE Scan on c1
1729 (37 rows)
1730
1731 -- No. S-2-2-3
1732 EXPLAIN (COSTS false)
1733 WITH c1 (c1) AS (
1734 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)'
1735 )
1736 SELECT max(bmt1.c1), (
1737 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)'
1738 )
1739                     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
1740 AND bmt1.c1 <> (
1741 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)'
1742 )
1743 ;
1744                             QUERY PLAN                             
1745 -------------------------------------------------------------------
1746  Aggregate
1747    CTE c1
1748      ->  Aggregate
1749            ->  Nested Loop
1750                  Join Filter: (b1t1.c1 = b1t4.c1)
1751                  ->  Nested Loop
1752                        Join Filter: (b1t1.c1 = b1t3.c1)
1753                        ->  Nested Loop
1754                              Join Filter: (b1t1.c1 = b1t2.c1)
1755                              ->  Tid Scan on t1 b1t1
1756                                    TID Cond: (ctid = '(1,1)'::tid)
1757                              ->  Seq Scan on t2 b1t2
1758                                    Filter: (ctid = '(1,1)'::tid)
1759                        ->  Tid Scan on t3 b1t3
1760                              TID Cond: (ctid = '(1,1)'::tid)
1761                  ->  Tid Scan on t4 b1t4
1762                        TID Cond: (ctid = '(1,1)'::tid)
1763    InitPlan 2 (returns $1)
1764      ->  Aggregate
1765            ->  Nested Loop
1766                  Join Filter: (b2t1.c1 = b2t4.c1)
1767                  ->  Nested Loop
1768                        Join Filter: (b2t1.c1 = b2t3.c1)
1769                        ->  Nested Loop
1770                              Join Filter: (b2t1.c1 = b2t2.c1)
1771                              ->  Tid Scan on t1 b2t1
1772                                    TID Cond: (ctid = '(1,1)'::tid)
1773                              ->  Seq Scan on t2 b2t2
1774                                    Filter: (ctid = '(1,1)'::tid)
1775                        ->  Tid Scan on t3 b2t3
1776                              TID Cond: (ctid = '(1,1)'::tid)
1777                  ->  Tid Scan on t4 b2t4
1778                        TID Cond: (ctid = '(1,1)'::tid)
1779    InitPlan 3 (returns $2)
1780      ->  Aggregate
1781            ->  Nested Loop
1782                  Join Filter: (b3t1.c1 = b3t4.c1)
1783                  ->  Nested Loop
1784                        Join Filter: (b3t1.c1 = b3t3.c1)
1785                        ->  Nested Loop
1786                              Join Filter: (b3t1.c1 = b3t2.c1)
1787                              ->  Tid Scan on t1 b3t1
1788                                    TID Cond: (ctid = '(1,1)'::tid)
1789                              ->  Seq Scan on t2 b3t2
1790                                    Filter: (ctid = '(1,1)'::tid)
1791                        ->  Tid Scan on t3 b3t3
1792                              TID Cond: (ctid = '(1,1)'::tid)
1793                  ->  Tid Scan on t4 b3t4
1794                        TID Cond: (ctid = '(1,1)'::tid)
1795    ->  Nested Loop
1796          Join Filter: (bmt1.c1 = c1.c1)
1797          ->  Nested Loop
1798                Join Filter: (bmt1.c1 = bmt4.c1)
1799                ->  Nested Loop
1800                      Join Filter: (bmt1.c1 = bmt3.c1)
1801                      ->  Nested Loop
1802                            Join Filter: (bmt1.c1 = bmt2.c1)
1803                            ->  Tid Scan on t1 bmt1
1804                                  TID Cond: (ctid = '(1,1)'::tid)
1805                                  Filter: (c1 <> $2)
1806                            ->  Seq Scan on t2 bmt2
1807                                  Filter: (ctid = '(1,1)'::tid)
1808                      ->  Tid Scan on t3 bmt3
1809                            TID Cond: (ctid = '(1,1)'::tid)
1810                ->  Tid Scan on t4 bmt4
1811                      TID Cond: (ctid = '(1,1)'::tid)
1812          ->  CTE Scan on c1
1813 (67 rows)
1814
1815 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
1816 TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
1817 BitmapScan(b2t1 t1_pkey)TidScan(b2t2)SeqScan(b2t3)IndexScan(b2t4 t4_pkey)
1818 IndexScan(b3t1 t1_pkey)BitmapScan(b3t2 t2_pkey)TidScan(b3t3)SeqScan(b3t4)
1819 */
1820 EXPLAIN (COSTS false)
1821 WITH c1 (c1) AS (
1822 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)'
1823 )
1824 SELECT max(bmt1.c1), (
1825 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)'
1826 )
1827                     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
1828 AND bmt1.c1 <> (
1829 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)'
1830 )
1831 ;
1832 LOG:  candidate index for "b1t3": t3_pkey
1833 LOG:  candidate index for "b1t4": t4_pkey
1834 LOG:  candidate index for "b2t1": t1_pkey
1835 LOG:  candidate index for "b2t4": t4_pkey
1836 LOG:  candidate index for "b3t1": t1_pkey
1837 LOG:  candidate index for "b3t2": t2_pkey
1838 LOG:  candidate index for "bmt2": t2_pkey
1839 LOG:  candidate index for "bmt3": t3_pkey
1840 LOG:  pg_hint_plan:
1841 used hint:
1842 TidScan(b1t1)
1843 SeqScan(b1t2)
1844 IndexScan(b1t3 t3_pkey)
1845 BitmapScan(b1t4 t4_pkey)
1846 BitmapScan(b2t1 t1_pkey)
1847 TidScan(b2t2)
1848 SeqScan(b2t3)
1849 IndexScan(b2t4 t4_pkey)
1850 IndexScan(b3t1 t1_pkey)
1851 BitmapScan(b3t2 t2_pkey)
1852 TidScan(b3t3)
1853 SeqScan(b3t4)
1854 SeqScan(bmt1)
1855 IndexScan(bmt2 t2_pkey)
1856 BitmapScan(bmt3 t3_pkey)
1857 TidScan(bmt4)
1858 not used hint:
1859 duplication hint:
1860 error hint:
1861
1862                                    QUERY PLAN                                   
1863 --------------------------------------------------------------------------------
1864  Aggregate
1865    CTE c1
1866      ->  Aggregate
1867            ->  Nested Loop
1868                  ->  Nested Loop
1869                        ->  Nested Loop
1870                              Join Filter: (b1t1.c1 = b1t2.c1)
1871                              ->  Tid Scan on t1 b1t1
1872                                    TID Cond: (ctid = '(1,1)'::tid)
1873                              ->  Seq Scan on t2 b1t2
1874                                    Filter: (ctid = '(1,1)'::tid)
1875                        ->  Index Scan using t3_pkey on t3 b1t3
1876                              Index Cond: (c1 = b1t1.c1)
1877                              Filter: (ctid = '(1,1)'::tid)
1878                  ->  Bitmap Heap Scan on t4 b1t4
1879                        Recheck Cond: (c1 = b1t1.c1)
1880                        Filter: (ctid = '(1,1)'::tid)
1881                        ->  Bitmap Index Scan on t4_pkey
1882                              Index Cond: (c1 = b1t1.c1)
1883    InitPlan 2 (returns $4)
1884      ->  Aggregate
1885            ->  Nested Loop
1886                  ->  Nested Loop
1887                        Join Filter: (b2t1.c1 = b2t3.c1)
1888                        ->  Nested Loop
1889                              ->  Tid Scan on t2 b2t2
1890                                    TID Cond: (ctid = '(1,1)'::tid)
1891                              ->  Bitmap Heap Scan on t1 b2t1
1892                                    Recheck Cond: (c1 = b2t2.c1)
1893                                    Filter: (ctid = '(1,1)'::tid)
1894                                    ->  Bitmap Index Scan on t1_pkey
1895                                          Index Cond: (c1 = b2t2.c1)
1896                        ->  Seq Scan on t3 b2t3
1897                              Filter: (ctid = '(1,1)'::tid)
1898                  ->  Index Scan using t4_pkey on t4 b2t4
1899                        Index Cond: (c1 = b2t1.c1)
1900                        Filter: (ctid = '(1,1)'::tid)
1901    InitPlan 3 (returns $7)
1902      ->  Aggregate
1903            ->  Nested Loop
1904                  Join Filter: (b3t1.c1 = b3t4.c1)
1905                  ->  Nested Loop
1906                        ->  Nested Loop
1907                              ->  Tid Scan on t3 b3t3
1908                                    TID Cond: (ctid = '(1,1)'::tid)
1909                              ->  Index Scan using t1_pkey on t1 b3t1
1910                                    Index Cond: (c1 = b3t3.c1)
1911                                    Filter: (ctid = '(1,1)'::tid)
1912                        ->  Bitmap Heap Scan on t2 b3t2
1913                              Recheck Cond: (c1 = b3t1.c1)
1914                              Filter: (ctid = '(1,1)'::tid)
1915                              ->  Bitmap Index Scan on t2_pkey
1916                                    Index Cond: (c1 = b3t1.c1)
1917                  ->  Seq Scan on t4 b3t4
1918                        Filter: (ctid = '(1,1)'::tid)
1919    ->  Nested Loop
1920          Join Filter: (bmt1.c1 = c1.c1)
1921          ->  Nested Loop
1922                Join Filter: (bmt1.c1 = bmt4.c1)
1923                ->  Nested Loop
1924                      ->  Nested Loop
1925                            ->  Seq Scan on t1 bmt1
1926                                  Filter: ((c1 <> $7) AND (ctid = '(1,1)'::tid))
1927                            ->  Index Scan using t2_pkey on t2 bmt2
1928                                  Index Cond: (c1 = bmt1.c1)
1929                                  Filter: (ctid = '(1,1)'::tid)
1930                      ->  Bitmap Heap Scan on t3 bmt3
1931                            Recheck Cond: (c1 = bmt1.c1)
1932                            Filter: (ctid = '(1,1)'::tid)
1933                            ->  Bitmap Index Scan on t3_pkey
1934                                  Index Cond: (c1 = bmt1.c1)
1935                ->  Tid Scan on t4 bmt4
1936                      TID Cond: (ctid = '(1,1)'::tid)
1937          ->  CTE Scan on c1
1938 (74 rows)
1939
1940 -- No. S-2-2-4
1941 EXPLAIN (COSTS false)
1942 WITH c1 (c1) AS (
1943 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)'
1944 )
1945 SELECT max(bmt1.c1), (
1946 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
1947 )
1948                     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
1949 AND bmt1.c1 <> (
1950 SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)'
1951 )
1952 ;
1953                             QUERY PLAN                             
1954 -------------------------------------------------------------------
1955  Aggregate
1956    CTE c1
1957      ->  Aggregate
1958            ->  Nested Loop
1959                  Join Filter: (b1t1.c1 = b1t4.c1)
1960                  ->  Nested Loop
1961                        Join Filter: (b1t1.c1 = b1t3.c1)
1962                        ->  Nested Loop
1963                              Join Filter: (b1t1.c1 = b1t2.c1)
1964                              ->  Tid Scan on t1 b1t1
1965                                    TID Cond: (ctid = '(1,1)'::tid)
1966                              ->  Seq Scan on t2 b1t2
1967                                    Filter: (ctid = '(1,1)'::tid)
1968                        ->  Tid Scan on t3 b1t3
1969                              TID Cond: (ctid = '(1,1)'::tid)
1970                  ->  Tid Scan on t4 b1t4
1971                        TID Cond: (ctid = '(1,1)'::tid)
1972    InitPlan 3 (returns $2)
1973      ->  Result
1974            InitPlan 2 (returns $1)
1975              ->  Limit
1976                    ->  Tid Scan on t1 b2t1
1977                          TID Cond: (ctid = '(1,1)'::tid)
1978                          Filter: ((c1 IS NOT NULL) AND (c1 = 1))
1979    InitPlan 4 (returns $3)
1980      ->  Aggregate
1981            ->  Tid Scan on t1 b3t1
1982                  TID Cond: (ctid = '(1,1)'::tid)
1983    ->  Nested Loop
1984          Join Filter: (bmt1.c1 = c1.c1)
1985          ->  Nested Loop
1986                Join Filter: (bmt1.c1 = bmt4.c1)
1987                ->  Nested Loop
1988                      Join Filter: (bmt1.c1 = bmt3.c1)
1989                      ->  Nested Loop
1990                            Join Filter: (bmt1.c1 = bmt2.c1)
1991                            ->  Tid Scan on t1 bmt1
1992                                  TID Cond: (ctid = '(1,1)'::tid)
1993                                  Filter: (c1 <> $3)
1994                            ->  Seq Scan on t2 bmt2
1995                                  Filter: (ctid = '(1,1)'::tid)
1996                      ->  Tid Scan on t3 bmt3
1997                            TID Cond: (ctid = '(1,1)'::tid)
1998                ->  Tid Scan on t4 bmt4
1999                      TID Cond: (ctid = '(1,1)'::tid)
2000          ->  CTE Scan on c1
2001 (46 rows)
2002
2003 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
2004 TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
2005 BitmapScan(b2t1 t1_pkey)
2006 IndexScan(b3t1 t1_pkey)
2007 */
2008 EXPLAIN (COSTS false)
2009 WITH c1 (c1) AS (
2010 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)'
2011 )
2012 SELECT max(bmt1.c1), (
2013 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
2014 )
2015                     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
2016 AND bmt1.c1 <> (
2017 SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)'
2018 )
2019 ;
2020 LOG:  candidate index for "b1t3": t3_pkey
2021 LOG:  candidate index for "b1t4": t4_pkey
2022 LOG:  candidate index for "b2t1": t1_pkey
2023 LOG:  candidate index for "b2t1": t1_pkey
2024 LOG:  candidate index for "b3t1": t1_pkey
2025 LOG:  candidate index for "b3t1": t1_pkey
2026 LOG:  candidate index for "bmt2": t2_pkey
2027 LOG:  candidate index for "bmt3": t3_pkey
2028 LOG:  pg_hint_plan:
2029 used hint:
2030 TidScan(b1t1)
2031 SeqScan(b1t2)
2032 IndexScan(b1t3 t3_pkey)
2033 BitmapScan(b1t4 t4_pkey)
2034 BitmapScan(b2t1 t1_pkey)
2035 IndexScan(b3t1 t1_pkey)
2036 SeqScan(bmt1)
2037 IndexScan(bmt2 t2_pkey)
2038 BitmapScan(bmt3 t3_pkey)
2039 TidScan(bmt4)
2040 not used hint:
2041 duplication hint:
2042 error hint:
2043
2044                                    QUERY PLAN                                   
2045 --------------------------------------------------------------------------------
2046  Aggregate
2047    CTE c1
2048      ->  Aggregate
2049            ->  Nested Loop
2050                  ->  Nested Loop
2051                        ->  Nested Loop
2052                              Join Filter: (b1t1.c1 = b1t2.c1)
2053                              ->  Tid Scan on t1 b1t1
2054                                    TID Cond: (ctid = '(1,1)'::tid)
2055                              ->  Seq Scan on t2 b1t2
2056                                    Filter: (ctid = '(1,1)'::tid)
2057                        ->  Index Scan using t3_pkey on t3 b1t3
2058                              Index Cond: (c1 = b1t1.c1)
2059                              Filter: (ctid = '(1,1)'::tid)
2060                  ->  Bitmap Heap Scan on t4 b1t4
2061                        Recheck Cond: (c1 = b1t1.c1)
2062                        Filter: (ctid = '(1,1)'::tid)
2063                        ->  Bitmap Index Scan on t4_pkey
2064                              Index Cond: (c1 = b1t1.c1)
2065    InitPlan 3 (returns $3)
2066      ->  Result
2067            InitPlan 2 (returns $2)
2068              ->  Limit
2069                    ->  Bitmap Heap Scan on t1 b2t1
2070                          Recheck Cond: ((c1 IS NOT NULL) AND (c1 = 1))
2071                          Filter: (ctid = '(1,1)'::tid)
2072                          ->  Bitmap Index Scan on t1_pkey
2073                                Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
2074    InitPlan 5 (returns $5)
2075      ->  Result
2076            InitPlan 4 (returns $4)
2077              ->  Limit
2078                    ->  Index Scan Backward using t1_pkey on t1 b3t1
2079                          Index Cond: (c1 IS NOT NULL)
2080                          Filter: (ctid = '(1,1)'::tid)
2081    ->  Nested Loop
2082          Join Filter: (bmt1.c1 = c1.c1)
2083          ->  Nested Loop
2084                Join Filter: (bmt1.c1 = bmt4.c1)
2085                ->  Nested Loop
2086                      ->  Nested Loop
2087                            ->  Seq Scan on t1 bmt1
2088                                  Filter: ((c1 <> $5) AND (ctid = '(1,1)'::tid))
2089                            ->  Index Scan using t2_pkey on t2 bmt2
2090                                  Index Cond: (c1 = bmt1.c1)
2091                                  Filter: (ctid = '(1,1)'::tid)
2092                      ->  Bitmap Heap Scan on t3 bmt3
2093                            Recheck Cond: (c1 = bmt1.c1)
2094                            Filter: (ctid = '(1,1)'::tid)
2095                            ->  Bitmap Index Scan on t3_pkey
2096                                  Index Cond: (c1 = bmt1.c1)
2097                ->  Tid Scan on t4 bmt4
2098                      TID Cond: (ctid = '(1,1)'::tid)
2099          ->  CTE Scan on c1
2100 (54 rows)
2101
2102 ----
2103 ---- No. S-2-3 RULE definition table
2104 ----
2105 -- No. S-2-3-1
2106 EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2107                            QUERY PLAN                            
2108 -----------------------------------------------------------------
2109  Aggregate
2110    ->  Nested Loop
2111          Join Filter: (t1.c1 = t4.c1)
2112          ->  Nested Loop
2113                Join Filter: (t1.c1 = t3.c1)
2114                ->  Nested Loop
2115                      Join Filter: (t1.c1 = t2.c1)
2116                      ->  Nested Loop
2117                            ->  Tid Scan on r1
2118                                  TID Cond: (ctid = '(1,1)'::tid)
2119                                  Filter: (c1 = 1)
2120                            ->  Tid Scan on t1
2121                                  TID Cond: (ctid = '(1,1)'::tid)
2122                      ->  Seq Scan on t2
2123                            Filter: (ctid = '(1,1)'::tid)
2124                ->  Tid Scan on t3
2125                      TID Cond: (ctid = '(1,1)'::tid)
2126          ->  Tid Scan on t4
2127                TID Cond: (ctid = '(1,1)'::tid)
2128 (19 rows)
2129
2130 /*+TidScan(t1)SeqScan(t2)IndexScan(t3 t3_pkey)BitmapScan(t4 t4_pkey)
2131 SeqScan(r1)*/
2132 EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2133 LOG:  candidate index for "t3": t3_pkey
2134 LOG:  candidate index for "t4": t4_pkey
2135 LOG:  pg_hint_plan:
2136 used hint:
2137 SeqScan(r1)
2138 TidScan(t1)
2139 SeqScan(t2)
2140 IndexScan(t3 t3_pkey)
2141 BitmapScan(t4 t4_pkey)
2142 not used hint:
2143 duplication hint:
2144 error hint:
2145
2146                                   QUERY PLAN                                  
2147 ------------------------------------------------------------------------------
2148  Aggregate
2149    ->  Nested Loop
2150          ->  Nested Loop
2151                ->  Nested Loop
2152                      Join Filter: (t1.c1 = t2.c1)
2153                      ->  Nested Loop
2154                            ->  Seq Scan on r1
2155                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2156                            ->  Tid Scan on t1
2157                                  TID Cond: (ctid = '(1,1)'::tid)
2158                      ->  Seq Scan on t2
2159                            Filter: (ctid = '(1,1)'::tid)
2160                ->  Index Scan using t3_pkey on t3
2161                      Index Cond: (c1 = t1.c1)
2162                      Filter: (ctid = '(1,1)'::tid)
2163          ->  Bitmap Heap Scan on t4
2164                Recheck Cond: (c1 = t1.c1)
2165                Filter: (ctid = '(1,1)'::tid)
2166                ->  Bitmap Index Scan on t4_pkey
2167                      Index Cond: (c1 = t1.c1)
2168 (20 rows)
2169
2170 EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2171                            QUERY PLAN                            
2172 -----------------------------------------------------------------
2173  Aggregate
2174    ->  Nested Loop
2175          Join Filter: (b1t1.c1 = b1t4.c1)
2176          ->  Nested Loop
2177                Join Filter: (b1t1.c1 = b1t3.c1)
2178                ->  Nested Loop
2179                      Join Filter: (b1t1.c1 = b1t2.c1)
2180                      ->  Nested Loop
2181                            ->  Tid Scan on r1_
2182                                  TID Cond: (ctid = '(1,1)'::tid)
2183                                  Filter: (c1 = 1)
2184                            ->  Tid Scan on t1 b1t1
2185                                  TID Cond: (ctid = '(1,1)'::tid)
2186                      ->  Seq Scan on t2 b1t2
2187                            Filter: (ctid = '(1,1)'::tid)
2188                ->  Tid Scan on t3 b1t3
2189                      TID Cond: (ctid = '(1,1)'::tid)
2190          ->  Tid Scan on t4 b1t4
2191                TID Cond: (ctid = '(1,1)'::tid)
2192 (19 rows)
2193
2194 /*+TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
2195 SeqScan(r1_)*/
2196 EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2197 LOG:  candidate index for "b1t3": t3_pkey
2198 LOG:  candidate index for "b1t4": t4_pkey
2199 LOG:  pg_hint_plan:
2200 used hint:
2201 TidScan(b1t1)
2202 SeqScan(b1t2)
2203 IndexScan(b1t3 t3_pkey)
2204 BitmapScan(b1t4 t4_pkey)
2205 SeqScan(r1_)
2206 not used hint:
2207 duplication hint:
2208 error hint:
2209
2210                                   QUERY PLAN                                  
2211 ------------------------------------------------------------------------------
2212  Aggregate
2213    ->  Nested Loop
2214          ->  Nested Loop
2215                ->  Nested Loop
2216                      Join Filter: (b1t1.c1 = b1t2.c1)
2217                      ->  Nested Loop
2218                            ->  Seq Scan on r1_
2219                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2220                            ->  Tid Scan on t1 b1t1
2221                                  TID Cond: (ctid = '(1,1)'::tid)
2222                      ->  Seq Scan on t2 b1t2
2223                            Filter: (ctid = '(1,1)'::tid)
2224                ->  Index Scan using t3_pkey on t3 b1t3
2225                      Index Cond: (c1 = b1t1.c1)
2226                      Filter: (ctid = '(1,1)'::tid)
2227          ->  Bitmap Heap Scan on t4 b1t4
2228                Recheck Cond: (c1 = b1t1.c1)
2229                Filter: (ctid = '(1,1)'::tid)
2230                ->  Bitmap Index Scan on t4_pkey
2231                      Index Cond: (c1 = b1t1.c1)
2232 (20 rows)
2233
2234 -- No. S-2-3-2
2235 EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2236                            QUERY PLAN                            
2237 -----------------------------------------------------------------
2238  Aggregate
2239    ->  Nested Loop
2240          Join Filter: (t1.c1 = t4.c1)
2241          ->  Nested Loop
2242                Join Filter: (t1.c1 = t3.c1)
2243                ->  Nested Loop
2244                      Join Filter: (t1.c1 = t2.c1)
2245                      ->  Nested Loop
2246                            ->  Tid Scan on r2
2247                                  TID Cond: (ctid = '(1,1)'::tid)
2248                                  Filter: (c1 = 1)
2249                            ->  Tid Scan on t1
2250                                  TID Cond: (ctid = '(1,1)'::tid)
2251                      ->  Seq Scan on t2
2252                            Filter: (ctid = '(1,1)'::tid)
2253                ->  Tid Scan on t3
2254                      TID Cond: (ctid = '(1,1)'::tid)
2255          ->  Tid Scan on t4
2256                TID Cond: (ctid = '(1,1)'::tid)
2257  
2258  Aggregate
2259    ->  Nested Loop
2260          Join Filter: (t1.c1 = t4.c1)
2261          ->  Nested Loop
2262                Join Filter: (t1.c1 = t3.c1)
2263                ->  Nested Loop
2264                      Join Filter: (t1.c1 = t2.c1)
2265                      ->  Nested Loop
2266                            ->  Tid Scan on r2
2267                                  TID Cond: (ctid = '(1,1)'::tid)
2268                                  Filter: (c1 = 1)
2269                            ->  Tid Scan on t1
2270                                  TID Cond: (ctid = '(1,1)'::tid)
2271                      ->  Seq Scan on t2
2272                            Filter: (ctid = '(1,1)'::tid)
2273                ->  Tid Scan on t3
2274                      TID Cond: (ctid = '(1,1)'::tid)
2275          ->  Tid Scan on t4
2276                TID Cond: (ctid = '(1,1)'::tid)
2277 (39 rows)
2278
2279 /*+TidScan(t1)SeqScan(t2)IndexScan(t3 t3_pkey)BitmapScan(t4 t4_pkey)
2280 SeqScan(r2)*/
2281 EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2282 LOG:  candidate index for "t3": t3_pkey
2283 LOG:  candidate index for "t4": t4_pkey
2284 LOG:  pg_hint_plan:
2285 used hint:
2286 SeqScan(r2)
2287 TidScan(t1)
2288 SeqScan(t2)
2289 IndexScan(t3 t3_pkey)
2290 BitmapScan(t4 t4_pkey)
2291 not used hint:
2292 duplication hint:
2293 error hint:
2294
2295 LOG:  candidate index for "t3": t3_pkey
2296 LOG:  candidate index for "t4": t4_pkey
2297 LOG:  pg_hint_plan:
2298 used hint:
2299 SeqScan(r2)
2300 TidScan(t1)
2301 SeqScan(t2)
2302 IndexScan(t3 t3_pkey)
2303 BitmapScan(t4 t4_pkey)
2304 not used hint:
2305 duplication hint:
2306 error hint:
2307
2308                                   QUERY PLAN                                  
2309 ------------------------------------------------------------------------------
2310  Aggregate
2311    ->  Nested Loop
2312          ->  Nested Loop
2313                ->  Nested Loop
2314                      Join Filter: (t1.c1 = t2.c1)
2315                      ->  Nested Loop
2316                            ->  Seq Scan on r2
2317                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2318                            ->  Tid Scan on t1
2319                                  TID Cond: (ctid = '(1,1)'::tid)
2320                      ->  Seq Scan on t2
2321                            Filter: (ctid = '(1,1)'::tid)
2322                ->  Index Scan using t3_pkey on t3
2323                      Index Cond: (c1 = t1.c1)
2324                      Filter: (ctid = '(1,1)'::tid)
2325          ->  Bitmap Heap Scan on t4
2326                Recheck Cond: (c1 = t1.c1)
2327                Filter: (ctid = '(1,1)'::tid)
2328                ->  Bitmap Index Scan on t4_pkey
2329                      Index Cond: (c1 = t1.c1)
2330  
2331  Aggregate
2332    ->  Nested Loop
2333          ->  Nested Loop
2334                ->  Nested Loop
2335                      Join Filter: (t1.c1 = t2.c1)
2336                      ->  Nested Loop
2337                            ->  Seq Scan on r2
2338                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2339                            ->  Tid Scan on t1
2340                                  TID Cond: (ctid = '(1,1)'::tid)
2341                      ->  Seq Scan on t2
2342                            Filter: (ctid = '(1,1)'::tid)
2343                ->  Index Scan using t3_pkey on t3
2344                      Index Cond: (c1 = t1.c1)
2345                      Filter: (ctid = '(1,1)'::tid)
2346          ->  Bitmap Heap Scan on t4
2347                Recheck Cond: (c1 = t1.c1)
2348                Filter: (ctid = '(1,1)'::tid)
2349                ->  Bitmap Index Scan on t4_pkey
2350                      Index Cond: (c1 = t1.c1)
2351 (41 rows)
2352
2353 EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2354                            QUERY PLAN                            
2355 -----------------------------------------------------------------
2356  Aggregate
2357    ->  Nested Loop
2358          Join Filter: (b1t1.c1 = b1t4.c1)
2359          ->  Nested Loop
2360                Join Filter: (b1t1.c1 = b1t3.c1)
2361                ->  Nested Loop
2362                      Join Filter: (b1t1.c1 = b1t2.c1)
2363                      ->  Nested Loop
2364                            ->  Tid Scan on r2_
2365                                  TID Cond: (ctid = '(1,1)'::tid)
2366                                  Filter: (c1 = 1)
2367                            ->  Tid Scan on t1 b1t1
2368                                  TID Cond: (ctid = '(1,1)'::tid)
2369                      ->  Seq Scan on t2 b1t2
2370                            Filter: (ctid = '(1,1)'::tid)
2371                ->  Tid Scan on t3 b1t3
2372                      TID Cond: (ctid = '(1,1)'::tid)
2373          ->  Tid Scan on t4 b1t4
2374                TID Cond: (ctid = '(1,1)'::tid)
2375  
2376  Aggregate
2377    ->  Nested Loop
2378          Join Filter: (b2t1.c1 = b2t4.c1)
2379          ->  Nested Loop
2380                Join Filter: (b2t1.c1 = b2t3.c1)
2381                ->  Nested Loop
2382                      Join Filter: (b2t1.c1 = b2t2.c1)
2383                      ->  Nested Loop
2384                            ->  Tid Scan on r2_
2385                                  TID Cond: (ctid = '(1,1)'::tid)
2386                                  Filter: (c1 = 1)
2387                            ->  Tid Scan on t1 b2t1
2388                                  TID Cond: (ctid = '(1,1)'::tid)
2389                      ->  Seq Scan on t2 b2t2
2390                            Filter: (ctid = '(1,1)'::tid)
2391                ->  Tid Scan on t3 b2t3
2392                      TID Cond: (ctid = '(1,1)'::tid)
2393          ->  Tid Scan on t4 b2t4
2394                TID Cond: (ctid = '(1,1)'::tid)
2395 (39 rows)
2396
2397 /*+TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
2398 BitmapScan(b2t1 t1_pkey)TidScan(b2t2)SeqScan(b2t3)IndexScan(b2t4 t4_pkey)
2399 SeqScan(r2_)*/
2400 EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2401 LOG:  candidate index for "b1t3": t3_pkey
2402 LOG:  candidate index for "b1t4": t4_pkey
2403 LOG:  pg_hint_plan:
2404 used hint:
2405 TidScan(b1t1)
2406 SeqScan(b1t2)
2407 IndexScan(b1t3 t3_pkey)
2408 BitmapScan(b1t4 t4_pkey)
2409 SeqScan(r2_)
2410 not used hint:
2411 BitmapScan(b2t1 t1_pkey)
2412 TidScan(b2t2)
2413 SeqScan(b2t3)
2414 IndexScan(b2t4 t4_pkey)
2415 duplication hint:
2416 error hint:
2417
2418 LOG:  candidate index for "b2t1": t1_pkey
2419 LOG:  candidate index for "b2t4": t4_pkey
2420 LOG:  pg_hint_plan:
2421 used hint:
2422 BitmapScan(b2t1 t1_pkey)
2423 TidScan(b2t2)
2424 SeqScan(b2t3)
2425 IndexScan(b2t4 t4_pkey)
2426 SeqScan(r2_)
2427 not used hint:
2428 TidScan(b1t1)
2429 SeqScan(b1t2)
2430 IndexScan(b1t3 t3_pkey)
2431 BitmapScan(b1t4 t4_pkey)
2432 duplication hint:
2433 error hint:
2434
2435                                   QUERY PLAN                                  
2436 ------------------------------------------------------------------------------
2437  Aggregate
2438    ->  Nested Loop
2439          ->  Nested Loop
2440                ->  Nested Loop
2441                      Join Filter: (b1t1.c1 = b1t2.c1)
2442                      ->  Nested Loop
2443                            ->  Seq Scan on r2_
2444                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2445                            ->  Tid Scan on t1 b1t1
2446                                  TID Cond: (ctid = '(1,1)'::tid)
2447                      ->  Seq Scan on t2 b1t2
2448                            Filter: (ctid = '(1,1)'::tid)
2449                ->  Index Scan using t3_pkey on t3 b1t3
2450                      Index Cond: (c1 = b1t1.c1)
2451                      Filter: (ctid = '(1,1)'::tid)
2452          ->  Bitmap Heap Scan on t4 b1t4
2453                Recheck Cond: (c1 = b1t1.c1)
2454                Filter: (ctid = '(1,1)'::tid)
2455                ->  Bitmap Index Scan on t4_pkey
2456                      Index Cond: (c1 = b1t1.c1)
2457  
2458  Aggregate
2459    ->  Nested Loop
2460          ->  Nested Loop
2461                Join Filter: (b2t1.c1 = b2t3.c1)
2462                ->  Nested Loop
2463                      ->  Nested Loop
2464                            ->  Seq Scan on r2_
2465                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2466                            ->  Tid Scan on t2 b2t2
2467                                  TID Cond: (ctid = '(1,1)'::tid)
2468                      ->  Bitmap Heap Scan on t1 b2t1
2469                            Recheck Cond: (c1 = b2t2.c1)
2470                            Filter: (ctid = '(1,1)'::tid)
2471                            ->  Bitmap Index Scan on t1_pkey
2472                                  Index Cond: (c1 = b2t2.c1)
2473                ->  Seq Scan on t3 b2t3
2474                      Filter: (ctid = '(1,1)'::tid)
2475          ->  Index Scan using t4_pkey on t4 b2t4
2476                Index Cond: (c1 = b2t1.c1)
2477                Filter: (ctid = '(1,1)'::tid)
2478 (41 rows)
2479
2480 -- No. S-2-3-3
2481 EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2482                            QUERY PLAN                            
2483 -----------------------------------------------------------------
2484  Aggregate
2485    ->  Nested Loop
2486          Join Filter: (t1.c1 = t4.c1)
2487          ->  Nested Loop
2488                Join Filter: (t1.c1 = t3.c1)
2489                ->  Nested Loop
2490                      Join Filter: (t1.c1 = t2.c1)
2491                      ->  Nested Loop
2492                            ->  Tid Scan on r3
2493                                  TID Cond: (ctid = '(1,1)'::tid)
2494                                  Filter: (c1 = 1)
2495                            ->  Tid Scan on t1
2496                                  TID Cond: (ctid = '(1,1)'::tid)
2497                      ->  Seq Scan on t2
2498                            Filter: (ctid = '(1,1)'::tid)
2499                ->  Tid Scan on t3
2500                      TID Cond: (ctid = '(1,1)'::tid)
2501          ->  Tid Scan on t4
2502                TID Cond: (ctid = '(1,1)'::tid)
2503  
2504  Aggregate
2505    ->  Nested Loop
2506          Join Filter: (t1.c1 = t4.c1)
2507          ->  Nested Loop
2508                Join Filter: (t1.c1 = t3.c1)
2509                ->  Nested Loop
2510                      Join Filter: (t1.c1 = t2.c1)
2511                      ->  Nested Loop
2512                            ->  Tid Scan on r3
2513                                  TID Cond: (ctid = '(1,1)'::tid)
2514                                  Filter: (c1 = 1)
2515                            ->  Tid Scan on t1
2516                                  TID Cond: (ctid = '(1,1)'::tid)
2517                      ->  Seq Scan on t2
2518                            Filter: (ctid = '(1,1)'::tid)
2519                ->  Tid Scan on t3
2520                      TID Cond: (ctid = '(1,1)'::tid)
2521          ->  Tid Scan on t4
2522                TID Cond: (ctid = '(1,1)'::tid)
2523  
2524  Aggregate
2525    ->  Nested Loop
2526          Join Filter: (t1.c1 = t4.c1)
2527          ->  Nested Loop
2528                Join Filter: (t1.c1 = t3.c1)
2529                ->  Nested Loop
2530                      Join Filter: (t1.c1 = t2.c1)
2531                      ->  Nested Loop
2532                            ->  Tid Scan on r3
2533                                  TID Cond: (ctid = '(1,1)'::tid)
2534                                  Filter: (c1 = 1)
2535                            ->  Tid Scan on t1
2536                                  TID Cond: (ctid = '(1,1)'::tid)
2537                      ->  Seq Scan on t2
2538                            Filter: (ctid = '(1,1)'::tid)
2539                ->  Tid Scan on t3
2540                      TID Cond: (ctid = '(1,1)'::tid)
2541          ->  Tid Scan on t4
2542                TID Cond: (ctid = '(1,1)'::tid)
2543 (59 rows)
2544
2545 /*+TidScan(t1)SeqScan(t2)IndexScan(t3 t3_pkey)BitmapScan(t4 t4_pkey)
2546 SeqScan(r3)*/
2547 EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2548 LOG:  candidate index for "t3": t3_pkey
2549 LOG:  candidate index for "t4": t4_pkey
2550 LOG:  pg_hint_plan:
2551 used hint:
2552 SeqScan(r3)
2553 TidScan(t1)
2554 SeqScan(t2)
2555 IndexScan(t3 t3_pkey)
2556 BitmapScan(t4 t4_pkey)
2557 not used hint:
2558 duplication hint:
2559 error hint:
2560
2561 LOG:  candidate index for "t3": t3_pkey
2562 LOG:  candidate index for "t4": t4_pkey
2563 LOG:  pg_hint_plan:
2564 used hint:
2565 SeqScan(r3)
2566 TidScan(t1)
2567 SeqScan(t2)
2568 IndexScan(t3 t3_pkey)
2569 BitmapScan(t4 t4_pkey)
2570 not used hint:
2571 duplication hint:
2572 error hint:
2573
2574 LOG:  candidate index for "t3": t3_pkey
2575 LOG:  candidate index for "t4": t4_pkey
2576 LOG:  pg_hint_plan:
2577 used hint:
2578 SeqScan(r3)
2579 TidScan(t1)
2580 SeqScan(t2)
2581 IndexScan(t3 t3_pkey)
2582 BitmapScan(t4 t4_pkey)
2583 not used hint:
2584 duplication hint:
2585 error hint:
2586
2587                                   QUERY PLAN                                  
2588 ------------------------------------------------------------------------------
2589  Aggregate
2590    ->  Nested Loop
2591          ->  Nested Loop
2592                ->  Nested Loop
2593                      Join Filter: (t1.c1 = t2.c1)
2594                      ->  Nested Loop
2595                            ->  Seq Scan on r3
2596                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2597                            ->  Tid Scan on t1
2598                                  TID Cond: (ctid = '(1,1)'::tid)
2599                      ->  Seq Scan on t2
2600                            Filter: (ctid = '(1,1)'::tid)
2601                ->  Index Scan using t3_pkey on t3
2602                      Index Cond: (c1 = t1.c1)
2603                      Filter: (ctid = '(1,1)'::tid)
2604          ->  Bitmap Heap Scan on t4
2605                Recheck Cond: (c1 = t1.c1)
2606                Filter: (ctid = '(1,1)'::tid)
2607                ->  Bitmap Index Scan on t4_pkey
2608                      Index Cond: (c1 = t1.c1)
2609  
2610  Aggregate
2611    ->  Nested Loop
2612          ->  Nested Loop
2613                ->  Nested Loop
2614                      Join Filter: (t1.c1 = t2.c1)
2615                      ->  Nested Loop
2616                            ->  Seq Scan on r3
2617                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2618                            ->  Tid Scan on t1
2619                                  TID Cond: (ctid = '(1,1)'::tid)
2620                      ->  Seq Scan on t2
2621                            Filter: (ctid = '(1,1)'::tid)
2622                ->  Index Scan using t3_pkey on t3
2623                      Index Cond: (c1 = t1.c1)
2624                      Filter: (ctid = '(1,1)'::tid)
2625          ->  Bitmap Heap Scan on t4
2626                Recheck Cond: (c1 = t1.c1)
2627                Filter: (ctid = '(1,1)'::tid)
2628                ->  Bitmap Index Scan on t4_pkey
2629                      Index Cond: (c1 = t1.c1)
2630  
2631  Aggregate
2632    ->  Nested Loop
2633          ->  Nested Loop
2634                ->  Nested Loop
2635                      Join Filter: (t1.c1 = t2.c1)
2636                      ->  Nested Loop
2637                            ->  Seq Scan on r3
2638                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2639                            ->  Tid Scan on t1
2640                                  TID Cond: (ctid = '(1,1)'::tid)
2641                      ->  Seq Scan on t2
2642                            Filter: (ctid = '(1,1)'::tid)
2643                ->  Index Scan using t3_pkey on t3
2644                      Index Cond: (c1 = t1.c1)
2645                      Filter: (ctid = '(1,1)'::tid)
2646          ->  Bitmap Heap Scan on t4
2647                Recheck Cond: (c1 = t1.c1)
2648                Filter: (ctid = '(1,1)'::tid)
2649                ->  Bitmap Index Scan on t4_pkey
2650                      Index Cond: (c1 = t1.c1)
2651 (62 rows)
2652
2653 EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2654                            QUERY PLAN                            
2655 -----------------------------------------------------------------
2656  Aggregate
2657    ->  Nested Loop
2658          Join Filter: (b1t1.c1 = b1t4.c1)
2659          ->  Nested Loop
2660                Join Filter: (b1t1.c1 = b1t3.c1)
2661                ->  Nested Loop
2662                      Join Filter: (b1t1.c1 = b1t2.c1)
2663                      ->  Nested Loop
2664                            ->  Tid Scan on r3_
2665                                  TID Cond: (ctid = '(1,1)'::tid)
2666                                  Filter: (c1 = 1)
2667                            ->  Tid Scan on t1 b1t1
2668                                  TID Cond: (ctid = '(1,1)'::tid)
2669                      ->  Seq Scan on t2 b1t2
2670                            Filter: (ctid = '(1,1)'::tid)
2671                ->  Tid Scan on t3 b1t3
2672                      TID Cond: (ctid = '(1,1)'::tid)
2673          ->  Tid Scan on t4 b1t4
2674                TID Cond: (ctid = '(1,1)'::tid)
2675  
2676  Aggregate
2677    ->  Nested Loop
2678          Join Filter: (b2t1.c1 = b2t4.c1)
2679          ->  Nested Loop
2680                Join Filter: (b2t1.c1 = b2t3.c1)
2681                ->  Nested Loop
2682                      Join Filter: (b2t1.c1 = b2t2.c1)
2683                      ->  Nested Loop
2684                            ->  Tid Scan on r3_
2685                                  TID Cond: (ctid = '(1,1)'::tid)
2686                                  Filter: (c1 = 1)
2687                            ->  Tid Scan on t1 b2t1
2688                                  TID Cond: (ctid = '(1,1)'::tid)
2689                      ->  Seq Scan on t2 b2t2
2690                            Filter: (ctid = '(1,1)'::tid)
2691                ->  Tid Scan on t3 b2t3
2692                      TID Cond: (ctid = '(1,1)'::tid)
2693          ->  Tid Scan on t4 b2t4
2694                TID Cond: (ctid = '(1,1)'::tid)
2695  
2696  Aggregate
2697    ->  Nested Loop
2698          Join Filter: (b3t1.c1 = b3t4.c1)
2699          ->  Nested Loop
2700                Join Filter: (b3t1.c1 = b3t3.c1)
2701                ->  Nested Loop
2702                      Join Filter: (b3t1.c1 = b3t2.c1)
2703                      ->  Nested Loop
2704                            ->  Tid Scan on r3_
2705                                  TID Cond: (ctid = '(1,1)'::tid)
2706                                  Filter: (c1 = 1)
2707                            ->  Tid Scan on t1 b3t1
2708                                  TID Cond: (ctid = '(1,1)'::tid)
2709                      ->  Seq Scan on t2 b3t2
2710                            Filter: (ctid = '(1,1)'::tid)
2711                ->  Tid Scan on t3 b3t3
2712                      TID Cond: (ctid = '(1,1)'::tid)
2713          ->  Tid Scan on t4 b3t4
2714                TID Cond: (ctid = '(1,1)'::tid)
2715 (59 rows)
2716
2717 /*+TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
2718 BitmapScan(b2t1 t1_pkey)TidScan(b2t2)SeqScan(b2t3)IndexScan(b2t4 t4_pkey)
2719 IndexScan(b3t1 t1_pkey)BitmapScan(b3t2 t2_pkey)TidScan(b3t3)SeqScan(b3t4)
2720 SeqScan(r3_)*/
2721 EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2722 LOG:  candidate index for "b1t3": t3_pkey
2723 LOG:  candidate index for "b1t4": t4_pkey
2724 LOG:  pg_hint_plan:
2725 used hint:
2726 TidScan(b1t1)
2727 SeqScan(b1t2)
2728 IndexScan(b1t3 t3_pkey)
2729 BitmapScan(b1t4 t4_pkey)
2730 SeqScan(r3_)
2731 not used hint:
2732 BitmapScan(b2t1 t1_pkey)
2733 TidScan(b2t2)
2734 SeqScan(b2t3)
2735 IndexScan(b2t4 t4_pkey)
2736 IndexScan(b3t1 t1_pkey)
2737 BitmapScan(b3t2 t2_pkey)
2738 TidScan(b3t3)
2739 SeqScan(b3t4)
2740 duplication hint:
2741 error hint:
2742
2743 LOG:  candidate index for "b2t1": t1_pkey
2744 LOG:  candidate index for "b2t4": t4_pkey
2745 LOG:  pg_hint_plan:
2746 used hint:
2747 BitmapScan(b2t1 t1_pkey)
2748 TidScan(b2t2)
2749 SeqScan(b2t3)
2750 IndexScan(b2t4 t4_pkey)
2751 SeqScan(r3_)
2752 not used hint:
2753 TidScan(b1t1)
2754 SeqScan(b1t2)
2755 IndexScan(b1t3 t3_pkey)
2756 BitmapScan(b1t4 t4_pkey)
2757 IndexScan(b3t1 t1_pkey)
2758 BitmapScan(b3t2 t2_pkey)
2759 TidScan(b3t3)
2760 SeqScan(b3t4)
2761 duplication hint:
2762 error hint:
2763
2764 LOG:  candidate index for "b3t1": t1_pkey
2765 LOG:  candidate index for "b3t2": t2_pkey
2766 LOG:  pg_hint_plan:
2767 used hint:
2768 IndexScan(b3t1 t1_pkey)
2769 BitmapScan(b3t2 t2_pkey)
2770 TidScan(b3t3)
2771 SeqScan(b3t4)
2772 SeqScan(r3_)
2773 not used hint:
2774 TidScan(b1t1)
2775 SeqScan(b1t2)
2776 IndexScan(b1t3 t3_pkey)
2777 BitmapScan(b1t4 t4_pkey)
2778 BitmapScan(b2t1 t1_pkey)
2779 TidScan(b2t2)
2780 SeqScan(b2t3)
2781 IndexScan(b2t4 t4_pkey)
2782 duplication hint:
2783 error hint:
2784
2785                                   QUERY PLAN                                  
2786 ------------------------------------------------------------------------------
2787  Aggregate
2788    ->  Nested Loop
2789          ->  Nested Loop
2790                ->  Nested Loop
2791                      Join Filter: (b1t1.c1 = b1t2.c1)
2792                      ->  Nested Loop
2793                            ->  Seq Scan on r3_
2794                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2795                            ->  Tid Scan on t1 b1t1
2796                                  TID Cond: (ctid = '(1,1)'::tid)
2797                      ->  Seq Scan on t2 b1t2
2798                            Filter: (ctid = '(1,1)'::tid)
2799                ->  Index Scan using t3_pkey on t3 b1t3
2800                      Index Cond: (c1 = b1t1.c1)
2801                      Filter: (ctid = '(1,1)'::tid)
2802          ->  Bitmap Heap Scan on t4 b1t4
2803                Recheck Cond: (c1 = b1t1.c1)
2804                Filter: (ctid = '(1,1)'::tid)
2805                ->  Bitmap Index Scan on t4_pkey
2806                      Index Cond: (c1 = b1t1.c1)
2807  
2808  Aggregate
2809    ->  Nested Loop
2810          ->  Nested Loop
2811                Join Filter: (b2t1.c1 = b2t3.c1)
2812                ->  Nested Loop
2813                      ->  Nested Loop
2814                            ->  Seq Scan on r3_
2815                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2816                            ->  Tid Scan on t2 b2t2
2817                                  TID Cond: (ctid = '(1,1)'::tid)
2818                      ->  Bitmap Heap Scan on t1 b2t1
2819                            Recheck Cond: (c1 = b2t2.c1)
2820                            Filter: (ctid = '(1,1)'::tid)
2821                            ->  Bitmap Index Scan on t1_pkey
2822                                  Index Cond: (c1 = b2t2.c1)
2823                ->  Seq Scan on t3 b2t3
2824                      Filter: (ctid = '(1,1)'::tid)
2825          ->  Index Scan using t4_pkey on t4 b2t4
2826                Index Cond: (c1 = b2t1.c1)
2827                Filter: (ctid = '(1,1)'::tid)
2828  
2829  Aggregate
2830    ->  Nested Loop
2831          Join Filter: (b3t1.c1 = b3t4.c1)
2832          ->  Nested Loop
2833                ->  Nested Loop
2834                      ->  Nested Loop
2835                            ->  Seq Scan on r3_
2836                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2837                            ->  Tid Scan on t3 b3t3
2838                                  TID Cond: (ctid = '(1,1)'::tid)
2839                      ->  Index Scan using t1_pkey on t1 b3t1
2840                            Index Cond: (c1 = b3t3.c1)
2841                            Filter: (ctid = '(1,1)'::tid)
2842                ->  Bitmap Heap Scan on t2 b3t2
2843                      Recheck Cond: (c1 = b3t1.c1)
2844                      Filter: (ctid = '(1,1)'::tid)
2845                      ->  Bitmap Index Scan on t2_pkey
2846                            Index Cond: (c1 = b3t1.c1)
2847          ->  Seq Scan on t4 b3t4
2848                Filter: (ctid = '(1,1)'::tid)
2849 (62 rows)
2850
2851 ----
2852 ---- No. S-2-4 VALUES clause
2853 ----
2854 -- No. S-2-4-1
2855 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1) WHERE t1.c1 = 1;
2856         QUERY PLAN         
2857 ---------------------------
2858  Values Scan on "*VALUES*"
2859    Filter: (column1 = 1)
2860 (2 rows)
2861
2862 /*+SeqScan(t1)*/
2863 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1) WHERE t1.c1 = 1;
2864 LOG:  pg_hint_plan:
2865 used hint:
2866 not used hint:
2867 SeqScan(t1)
2868 duplication hint:
2869 error hint:
2870
2871         QUERY PLAN         
2872 ---------------------------
2873  Values Scan on "*VALUES*"
2874    Filter: (column1 = 1)
2875 (2 rows)
2876
2877 /*+SeqScan(*VALUES*)*/
2878 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1) WHERE t1.c1 = 1;
2879 LOG:  pg_hint_plan:
2880 used hint:
2881 not used hint:
2882 SeqScan(*VALUES*)
2883 duplication hint:
2884 error hint:
2885
2886         QUERY PLAN         
2887 ---------------------------
2888  Values Scan on "*VALUES*"
2889    Filter: (column1 = 1)
2890 (2 rows)
2891
2892 -- No. S-2-4-2
2893 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;
2894                         QUERY PLAN                        
2895 ----------------------------------------------------------
2896  Nested Loop
2897    Join Filter: ("*VALUES*".column1 = "*VALUES*".column1)
2898    ->  Values Scan on "*VALUES*"
2899    ->  Values Scan on "*VALUES*"
2900 (4 rows)
2901
2902 /*+SeqScan(t1 t2)*/
2903 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;
2904 INFO:  hint syntax error at or near ""
2905 DETAIL:  SeqScan hint accepts only one relation.
2906 LOG:  pg_hint_plan:
2907 used hint:
2908 not used hint:
2909 duplication hint:
2910 error hint:
2911 SeqScan(t1 t2)
2912
2913                         QUERY PLAN                        
2914 ----------------------------------------------------------
2915  Nested Loop
2916    Join Filter: ("*VALUES*".column1 = "*VALUES*".column1)
2917    ->  Values Scan on "*VALUES*"
2918    ->  Values Scan on "*VALUES*"
2919 (4 rows)
2920
2921 /*+SeqScan(*VALUES*)*/
2922 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;
2923 LOG:  pg_hint_plan:
2924 used hint:
2925 not used hint:
2926 SeqScan(*VALUES*)
2927 duplication hint:
2928 error hint:
2929
2930                         QUERY PLAN                        
2931 ----------------------------------------------------------
2932  Nested Loop
2933    Join Filter: ("*VALUES*".column1 = "*VALUES*".column1)
2934    ->  Values Scan on "*VALUES*"
2935    ->  Values Scan on "*VALUES*"
2936 (4 rows)
2937
2938 ----
2939 ---- No. S-3-1 scan method hint
2940 ----
2941 -- No. S-3-1-1
2942 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
2943      QUERY PLAN      
2944 ---------------------
2945  Seq Scan on t1
2946    Filter: (c1 >= 1)
2947 (2 rows)
2948
2949 /*+SeqScan(t1)*/
2950 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
2951 LOG:  pg_hint_plan:
2952 used hint:
2953 SeqScan(t1)
2954 not used hint:
2955 duplication hint:
2956 error hint:
2957
2958      QUERY PLAN      
2959 ---------------------
2960  Seq Scan on t1
2961    Filter: (c1 >= 1)
2962 (2 rows)
2963
2964 -- No. S-3-1-2
2965 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2966           QUERY PLAN          
2967 ------------------------------
2968  Index Scan using t1_i1 on t1
2969    Index Cond: (c1 = 1)
2970 (2 rows)
2971
2972 /*+SeqScan(t1)*/
2973 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2974 LOG:  pg_hint_plan:
2975 used hint:
2976 SeqScan(t1)
2977 not used hint:
2978 duplication hint:
2979 error hint:
2980
2981      QUERY PLAN     
2982 --------------------
2983  Seq Scan on t1
2984    Filter: (c1 = 1)
2985 (2 rows)
2986
2987 -- No. S-3-1-3
2988 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2989           QUERY PLAN          
2990 ------------------------------
2991  Index Scan using t1_i1 on t1
2992    Index Cond: (c1 = 1)
2993 (2 rows)
2994
2995 /*+IndexScan(t1)*/
2996 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2997 LOG:  pg_hint_plan:
2998 used hint:
2999 IndexScan(t1)
3000 not used hint:
3001 duplication hint:
3002 error hint:
3003
3004           QUERY PLAN          
3005 ------------------------------
3006  Index Scan using t1_i1 on t1
3007    Index Cond: (c1 = 1)
3008 (2 rows)
3009
3010 -- No. S-3-1-4
3011 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3012      QUERY PLAN      
3013 ---------------------
3014  Seq Scan on t1
3015    Filter: (c1 >= 1)
3016 (2 rows)
3017
3018 /*+IndexScan(t1)*/
3019 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3020 LOG:  pg_hint_plan:
3021 used hint:
3022 IndexScan(t1)
3023 not used hint:
3024 duplication hint:
3025 error hint:
3026
3027           QUERY PLAN          
3028 ------------------------------
3029  Index Scan using t1_i1 on t1
3030    Index Cond: (c1 >= 1)
3031 (2 rows)
3032
3033 -- No. S-3-1-5
3034 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
3035            QUERY PLAN            
3036 ---------------------------------
3037  Bitmap Heap Scan on t1
3038    Recheck Cond: (c3 < 10)
3039    ->  Bitmap Index Scan on t1_i
3040          Index Cond: (c3 < 10)
3041 (4 rows)
3042
3043 /*+BitmapScan(t1)*/
3044 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
3045 LOG:  pg_hint_plan:
3046 used hint:
3047 BitmapScan(t1)
3048 not used hint:
3049 duplication hint:
3050 error hint:
3051
3052            QUERY PLAN            
3053 ---------------------------------
3054  Bitmap Heap Scan on t1
3055    Recheck Cond: (c3 < 10)
3056    ->  Bitmap Index Scan on t1_i
3057          Index Cond: (c3 < 10)
3058 (4 rows)
3059
3060 -- No. S-3-1-6
3061 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3062           QUERY PLAN          
3063 ------------------------------
3064  Index Scan using t1_i1 on t1
3065    Index Cond: (c1 = 1)
3066 (2 rows)
3067
3068 /*+BitmapScan(t1)*/
3069 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3070 LOG:  pg_hint_plan:
3071 used hint:
3072 BitmapScan(t1)
3073 not used hint:
3074 duplication hint:
3075 error hint:
3076
3077             QUERY PLAN            
3078 ----------------------------------
3079  Bitmap Heap Scan on t1
3080    Recheck Cond: (c1 = 1)
3081    ->  Bitmap Index Scan on t1_i1
3082          Index Cond: (c1 = 1)
3083 (4 rows)
3084
3085 -- No. S-3-1-7
3086 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3087             QUERY PLAN             
3088 -----------------------------------
3089  Tid Scan on t1
3090    TID Cond: (ctid = '(1,1)'::tid)
3091    Filter: (c1 = 1)
3092 (3 rows)
3093
3094 /*+TidScan(t1)*/
3095 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3096 LOG:  pg_hint_plan:
3097 used hint:
3098 TidScan(t1)
3099 not used hint:
3100 duplication hint:
3101 error hint:
3102
3103             QUERY PLAN             
3104 -----------------------------------
3105  Tid Scan on t1
3106    TID Cond: (ctid = '(1,1)'::tid)
3107    Filter: (c1 = 1)
3108 (3 rows)
3109
3110 -- No. S-3-1-8
3111 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid IN ('(1,1)', '(2,2)', '(3,3)');
3112                          QUERY PLAN                          
3113 -------------------------------------------------------------
3114  Index Scan using t1_i1 on t1
3115    Index Cond: (c1 = 1)
3116    Filter: (ctid = ANY ('{"(1,1)","(2,2)","(3,3)"}'::tid[]))
3117 (3 rows)
3118
3119 /*+TidScan(t1)*/
3120 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid IN ('(1,1)', '(2,2)', '(3,3)');
3121 LOG:  pg_hint_plan:
3122 used hint:
3123 TidScan(t1)
3124 not used hint:
3125 duplication hint:
3126 error hint:
3127
3128                           QUERY PLAN                           
3129 ---------------------------------------------------------------
3130  Tid Scan on t1
3131    TID Cond: (ctid = ANY ('{"(1,1)","(2,2)","(3,3)"}'::tid[]))
3132    Filter: (c1 = 1)
3133 (3 rows)
3134
3135 -- No. S-3-1-9
3136 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3137      QUERY PLAN      
3138 ---------------------
3139  Seq Scan on t1
3140    Filter: (c1 >= 1)
3141 (2 rows)
3142
3143 /*+NoSeqScan(t1)*/
3144 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3145 LOG:  pg_hint_plan:
3146 used hint:
3147 NoSeqScan(t1)
3148 not used hint:
3149 duplication hint:
3150 error hint:
3151
3152           QUERY PLAN          
3153 ------------------------------
3154  Index Scan using t1_i1 on t1
3155    Index Cond: (c1 >= 1)
3156 (2 rows)
3157
3158 -- No. S-3-1-10
3159 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3160           QUERY PLAN          
3161 ------------------------------
3162  Index Scan using t1_i1 on t1
3163    Index Cond: (c1 = 1)
3164 (2 rows)
3165
3166 /*+NoSeqScan(t1)*/
3167 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3168 LOG:  pg_hint_plan:
3169 used hint:
3170 NoSeqScan(t1)
3171 not used hint:
3172 duplication hint:
3173 error hint:
3174
3175           QUERY PLAN          
3176 ------------------------------
3177  Index Scan using t1_i1 on t1
3178    Index Cond: (c1 = 1)
3179 (2 rows)
3180
3181 -- No. S-3-1-11
3182 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3183           QUERY PLAN          
3184 ------------------------------
3185  Index Scan using t1_i1 on t1
3186    Index Cond: (c1 = 1)
3187 (2 rows)
3188
3189 /*+NoIndexScan(t1)*/
3190 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3191 LOG:  pg_hint_plan:
3192 used hint:
3193 NoIndexScan(t1)
3194 not used hint:
3195 duplication hint:
3196 error hint:
3197
3198             QUERY PLAN            
3199 ----------------------------------
3200  Bitmap Heap Scan on t1
3201    Recheck Cond: (c1 = 1)
3202    ->  Bitmap Index Scan on t1_i1
3203          Index Cond: (c1 = 1)
3204 (4 rows)
3205
3206 -- No. S-3-1-12
3207 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3208      QUERY PLAN      
3209 ---------------------
3210  Seq Scan on t1
3211    Filter: (c1 >= 1)
3212 (2 rows)
3213
3214 /*+NoIndexScan(t1)*/
3215 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3216 LOG:  pg_hint_plan:
3217 used hint:
3218 NoIndexScan(t1)
3219 not used hint:
3220 duplication hint:
3221 error hint:
3222
3223      QUERY PLAN      
3224 ---------------------
3225  Seq Scan on t1
3226    Filter: (c1 >= 1)
3227 (2 rows)
3228
3229 -- No. S-3-1-13
3230 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
3231            QUERY PLAN            
3232 ---------------------------------
3233  Bitmap Heap Scan on t1
3234    Recheck Cond: (c3 < 10)
3235    ->  Bitmap Index Scan on t1_i
3236          Index Cond: (c3 < 10)
3237 (4 rows)
3238
3239 /*+NoBitmapScan(t1)*/
3240 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
3241 LOG:  pg_hint_plan:
3242 used hint:
3243 NoBitmapScan(t1)
3244 not used hint:
3245 duplication hint:
3246 error hint:
3247
3248      QUERY PLAN      
3249 ---------------------
3250  Seq Scan on t1
3251    Filter: (c3 < 10)
3252 (2 rows)
3253
3254 -- No. S-3-1-14
3255 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3256           QUERY PLAN          
3257 ------------------------------
3258  Index Scan using t1_i1 on t1
3259    Index Cond: (c1 = 1)
3260 (2 rows)
3261
3262 /*+NoBitmapScan(t1)*/
3263 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3264 LOG:  pg_hint_plan:
3265 used hint:
3266 NoBitmapScan(t1)
3267 not used hint:
3268 duplication hint:
3269 error hint:
3270
3271           QUERY PLAN          
3272 ------------------------------
3273  Index Scan using t1_i1 on t1
3274    Index Cond: (c1 = 1)
3275 (2 rows)
3276
3277 -- No. S-3-1-15
3278 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3279             QUERY PLAN             
3280 -----------------------------------
3281  Tid Scan on t1
3282    TID Cond: (ctid = '(1,1)'::tid)
3283    Filter: (c1 = 1)
3284 (3 rows)
3285
3286 /*+NoTidScan(t1)*/
3287 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3288 LOG:  pg_hint_plan:
3289 used hint:
3290 NoTidScan(t1)
3291 not used hint:
3292 duplication hint:
3293 error hint:
3294
3295            QUERY PLAN            
3296 ---------------------------------
3297  Index Scan using t1_i1 on t1
3298    Index Cond: (c1 = 1)
3299    Filter: (ctid = '(1,1)'::tid)
3300 (3 rows)
3301
3302 -- No. S-3-1-16
3303 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3304           QUERY PLAN          
3305 ------------------------------
3306  Index Scan using t1_i1 on t1
3307    Index Cond: (c1 = 1)
3308 (2 rows)
3309
3310 /*+NoTidScan(t1)*/
3311 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3312 LOG:  pg_hint_plan:
3313 used hint:
3314 NoTidScan(t1)
3315 not used hint:
3316 duplication hint:
3317 error hint:
3318
3319           QUERY PLAN          
3320 ------------------------------
3321  Index Scan using t1_i1 on t1
3322    Index Cond: (c1 = 1)
3323 (2 rows)
3324
3325 -- No. S-3-1-17
3326 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
3327             QUERY PLAN             
3328 -----------------------------------
3329  Index Only Scan using t1_i1 on t1
3330    Index Cond: (c1 = 1)
3331 (2 rows)
3332
3333 /*+IndexOnlyScan(t1)*/
3334 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
3335 LOG:  pg_hint_plan:
3336 used hint:
3337 IndexOnlyScan(t1)
3338 not used hint:
3339 duplication hint:
3340 error hint:
3341
3342             QUERY PLAN             
3343 -----------------------------------
3344  Index Only Scan using t1_i1 on t1
3345    Index Cond: (c1 = 1)
3346 (2 rows)
3347
3348 -- No. S-3-1-18
3349 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 >= 1;
3350      QUERY PLAN      
3351 ---------------------
3352  Seq Scan on t1
3353    Filter: (c1 >= 1)
3354 (2 rows)
3355
3356 /*+IndexOnlyScan(t1)*/
3357 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 >= 1;
3358 LOG:  pg_hint_plan:
3359 used hint:
3360 IndexOnlyScan(t1)
3361 not used hint:
3362 duplication hint:
3363 error hint:
3364
3365             QUERY PLAN             
3366 -----------------------------------
3367  Index Only Scan using t1_i1 on t1
3368    Index Cond: (c1 >= 1)
3369 (2 rows)
3370
3371 -- No. S-3-1-19
3372 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
3373             QUERY PLAN             
3374 -----------------------------------
3375  Index Only Scan using t1_i1 on t1
3376    Index Cond: (c1 = 1)
3377 (2 rows)
3378
3379 /*+NoIndexOnlyScan(t1)*/
3380 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
3381 LOG:  pg_hint_plan:
3382 used hint:
3383 NoIndexOnlyScan(t1)
3384 not used hint:
3385 duplication hint:
3386 error hint:
3387
3388           QUERY PLAN          
3389 ------------------------------
3390  Index Scan using t1_i1 on t1
3391    Index Cond: (c1 = 1)
3392 (2 rows)
3393
3394 -- No. S-3-1-20
3395 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 >= 1;
3396      QUERY PLAN      
3397 ---------------------
3398  Seq Scan on t1
3399    Filter: (c1 >= 1)
3400 (2 rows)
3401
3402 /*+NoIndexOnlyScan(t1)*/
3403 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 >= 1;
3404 LOG:  pg_hint_plan:
3405 used hint:
3406 NoIndexOnlyScan(t1)
3407 not used hint:
3408 duplication hint:
3409 error hint:
3410
3411      QUERY PLAN      
3412 ---------------------
3413  Seq Scan on t1
3414    Filter: (c1 >= 1)
3415 (2 rows)
3416
3417 ----
3418 ---- No. S-3-3 index name specified
3419 ----
3420 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3421             QUERY PLAN             
3422 -----------------------------------
3423  Tid Scan on ti1
3424    TID Cond: (ctid = '(1,1)'::tid)
3425    Filter: (c2 = 1)
3426 (3 rows)
3427
3428 SET enable_tidscan TO off;
3429 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3430            QUERY PLAN            
3431 ---------------------------------
3432  Index Scan using ti1_i2 on ti1
3433    Index Cond: (c2 = 1)
3434    Filter: (ctid = '(1,1)'::tid)
3435 (3 rows)
3436
3437 SET enable_indexscan TO off;
3438 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3439             QUERY PLAN             
3440 -----------------------------------
3441  Bitmap Heap Scan on ti1
3442    Recheck Cond: (c2 = 1)
3443    Filter: (ctid = '(1,1)'::tid)
3444    ->  Bitmap Index Scan on ti1_i2
3445          Index Cond: (c2 = 1)
3446 (5 rows)
3447
3448 RESET enable_tidscan;
3449 RESET enable_indexscan;
3450 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE ti1.c2 >= 1;
3451      QUERY PLAN      
3452 ---------------------
3453  Seq Scan on ti1
3454    Filter: (c2 >= 1)
3455 (2 rows)
3456
3457 -- No. S-3-3-1
3458 /*+IndexScan(ti1 ti1_i3)*/
3459 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3460 LOG:  candidate index for "ti1": ti1_i3
3461 LOG:  pg_hint_plan:
3462 used hint:
3463 IndexScan(ti1 ti1_i3)
3464 not used hint:
3465 duplication hint:
3466 error hint:
3467
3468            QUERY PLAN            
3469 ---------------------------------
3470  Index Scan using ti1_i3 on ti1
3471    Index Cond: (c2 = 1)
3472    Filter: (ctid = '(1,1)'::tid)
3473 (3 rows)
3474
3475 -- No. S-3-3-2
3476 /*+IndexScan(ti1 ti1_i3 ti1_i2)*/
3477 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3478 LOG:  candidate index for "ti1": ti1_i3 ti1_i2
3479 LOG:  pg_hint_plan:
3480 used hint:
3481 IndexScan(ti1 ti1_i3 ti1_i2)
3482 not used hint:
3483 duplication hint:
3484 error hint:
3485
3486            QUERY PLAN            
3487 ---------------------------------
3488  Index Scan using ti1_i2 on ti1
3489    Index Cond: (c2 = 1)
3490    Filter: (ctid = '(1,1)'::tid)
3491 (3 rows)
3492
3493 -- No. S-3-3-3
3494 /*+IndexScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)*/
3495 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3496 LOG:  candidate index for "ti1": ti1_i4 ti1_i3 ti1_i2 ti1_i1
3497 LOG:  pg_hint_plan:
3498 used hint:
3499 IndexScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)
3500 not used hint:
3501 duplication hint:
3502 error hint:
3503
3504            QUERY PLAN            
3505 ---------------------------------
3506  Index Scan using ti1_i2 on ti1
3507    Index Cond: (c2 = 1)
3508    Filter: (ctid = '(1,1)'::tid)
3509 (3 rows)
3510
3511 -- No. S-3-3-4
3512 /*+BitmapScan(ti1 ti1_i3)*/
3513 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3514 LOG:  candidate index for "ti1": ti1_i3
3515 LOG:  pg_hint_plan:
3516 used hint:
3517 BitmapScan(ti1 ti1_i3)
3518 not used hint:
3519 duplication hint:
3520 error hint:
3521
3522             QUERY PLAN             
3523 -----------------------------------
3524  Bitmap Heap Scan on ti1
3525    Recheck Cond: (c2 = 1)
3526    Filter: (ctid = '(1,1)'::tid)
3527    ->  Bitmap Index Scan on ti1_i3
3528          Index Cond: (c2 = 1)
3529 (5 rows)
3530
3531 -- No. S-3-3-5
3532 /*+BitmapScan(ti1 ti1_i3 ti1_i2)*/
3533 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3534 LOG:  candidate index for "ti1": ti1_i3 ti1_i2
3535 LOG:  pg_hint_plan:
3536 used hint:
3537 BitmapScan(ti1 ti1_i3 ti1_i2)
3538 not used hint:
3539 duplication hint:
3540 error hint:
3541
3542             QUERY PLAN             
3543 -----------------------------------
3544  Bitmap Heap Scan on ti1
3545    Recheck Cond: (c2 = 1)
3546    Filter: (ctid = '(1,1)'::tid)
3547    ->  Bitmap Index Scan on ti1_i2
3548          Index Cond: (c2 = 1)
3549 (5 rows)
3550
3551 -- No. S-3-3-6
3552 /*+BitmapScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)*/
3553 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3554 LOG:  candidate index for "ti1": ti1_i4 ti1_i3 ti1_i2 ti1_i1
3555 LOG:  pg_hint_plan:
3556 used hint:
3557 BitmapScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)
3558 not used hint:
3559 duplication hint:
3560 error hint:
3561
3562             QUERY PLAN             
3563 -----------------------------------
3564  Bitmap Heap Scan on ti1
3565    Recheck Cond: (c2 = 1)
3566    Filter: (ctid = '(1,1)'::tid)
3567    ->  Bitmap Index Scan on ti1_i2
3568          Index Cond: (c2 = 1)
3569 (5 rows)
3570
3571 -- No. S-3-3-7
3572 /*+IndexOnlyScan(ti1 ti1_i3)*/
3573 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE ti1.c2 >= 1;
3574 LOG:  candidate index for "ti1": ti1_i3
3575 LOG:  pg_hint_plan:
3576 used hint:
3577 IndexOnlyScan(ti1 ti1_i3)
3578 not used hint:
3579 duplication hint:
3580 error hint:
3581
3582              QUERY PLAN              
3583 -------------------------------------
3584  Index Only Scan using ti1_i3 on ti1
3585    Index Cond: (c2 >= 1)
3586 (2 rows)
3587
3588 -- No. S-3-3-8
3589 /*+IndexOnlyScan(ti1 ti1_i3 ti1_i2)*/
3590 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE ti1.c2 >= 1;
3591 LOG:  candidate index for "ti1": ti1_i3 ti1_i2
3592 LOG:  pg_hint_plan:
3593 used hint:
3594 IndexOnlyScan(ti1 ti1_i3 ti1_i2)
3595 not used hint:
3596 duplication hint:
3597 error hint:
3598
3599              QUERY PLAN              
3600 -------------------------------------
3601  Index Only Scan using ti1_i2 on ti1
3602    Index Cond: (c2 >= 1)
3603 (2 rows)
3604
3605 -- No. S-3-3-9
3606 /*+IndexOnlyScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)*/
3607 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE ti1.c2 >= 1;
3608 LOG:  candidate index for "ti1": ti1_i4 ti1_i3 ti1_i2 ti1_i1
3609 LOG:  pg_hint_plan:
3610 used hint:
3611 IndexOnlyScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)
3612 not used hint:
3613 duplication hint:
3614 error hint:
3615
3616              QUERY PLAN              
3617 -------------------------------------
3618  Index Only Scan using ti1_i1 on ti1
3619    Index Cond: (c2 >= 1)
3620 (2 rows)
3621
3622 ----
3623 ---- No. S-3-4 index type
3624 ----
3625 \d s1.ti1
3626         Table "s1.ti1"
3627  Column |  Type   | Modifiers 
3628 --------+---------+-----------
3629  c1     | integer | not null
3630  c2     | integer | 
3631  c3     | integer | 
3632  c4     | text    | 
3633 Indexes:
3634     "ti1_pkey" PRIMARY KEY, btree (c1)
3635     "ti1_c2_key" UNIQUE CONSTRAINT, btree (c2)
3636     "ti1_uniq" UNIQUE, btree (c1)
3637     "ti1_btree" btree (c1)
3638     "ti1_expr" btree ((c1 < 100))
3639     "ti1_gin" gin (c1)
3640     "ti1_gist" gist (c1)
3641     "ti1_hash" hash (c1)
3642     "ti1_i1" btree (c2)
3643     "ti1_i2" btree (c2, c4)
3644     "ti1_i3" btree (c2, c4, c4)
3645     "ti1_i4" btree (c2, c4, c4, c4)
3646     "ti1_multi" btree (c1, c2, c3, c4)
3647     "ti1_pred" btree (lower(c4))
3648     "ti1_ts" gin (to_tsvector('english'::regconfig, c4))
3649
3650 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)';
3651                                                                QUERY PLAN                                                                
3652 -----------------------------------------------------------------------------------------------------------------------------------------
3653  Tid Scan on ti1
3654    TID Cond: (ctid = '(1,1)'::tid)
3655    Filter: ((c1 < 100) AND (c2 = 1) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3656 (3 rows)
3657
3658 -- No. S-3-4-1
3659 /*+IndexScan(ti1 ti1_btree)*/
3660 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)';
3661 LOG:  candidate index for "ti1": ti1_btree
3662 LOG:  pg_hint_plan:
3663 used hint:
3664 IndexScan(ti1 ti1_btree)
3665 not used hint:
3666 duplication hint:
3667 error hint:
3668
3669                                                                      QUERY PLAN                                                                     
3670 ----------------------------------------------------------------------------------------------------------------------------------------------------
3671  Index Scan using ti1_btree on ti1
3672    Index Cond: (c1 < 100)
3673    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3674 (3 rows)
3675
3676 -- No. S-3-4-2
3677 /*+IndexScan(ti1 ti1_hash)*/
3678 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)';
3679 LOG:  candidate index for "ti1": ti1_hash
3680 LOG:  pg_hint_plan:
3681 used hint:
3682 IndexScan(ti1 ti1_hash)
3683 not used hint:
3684 duplication hint:
3685 error hint:
3686
3687                                                                      QUERY PLAN                                                                     
3688 ----------------------------------------------------------------------------------------------------------------------------------------------------
3689  Index Scan using ti1_hash on ti1
3690    Index Cond: (c1 = 100)
3691    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3692 (3 rows)
3693
3694 -- No. S-3-4-3
3695 /*+IndexScan(ti1 ti1_gist)*/
3696 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)';
3697 LOG:  candidate index for "ti1": ti1_gist
3698 LOG:  pg_hint_plan:
3699 used hint:
3700 IndexScan(ti1 ti1_gist)
3701 not used hint:
3702 duplication hint:
3703 error hint:
3704
3705                                                                      QUERY PLAN                                                                     
3706 ----------------------------------------------------------------------------------------------------------------------------------------------------
3707  Index Scan using ti1_gist on ti1
3708    Index Cond: (c1 < 100)
3709    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3710 (3 rows)
3711
3712 -- No. S-3-4-4
3713 /*+IndexScan(ti1 ti1_gin)*/
3714 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)';
3715 LOG:  candidate index for "ti1": ti1_gin
3716 LOG:  pg_hint_plan:
3717 used hint:
3718 IndexScan(ti1 ti1_gin)
3719 not used hint:
3720 duplication hint:
3721 error hint:
3722
3723                                                                QUERY PLAN                                                                
3724 -----------------------------------------------------------------------------------------------------------------------------------------
3725  Tid Scan on ti1
3726    TID Cond: (ctid = '(1,1)'::tid)
3727    Filter: ((c1 < 100) AND (c2 = 1) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3728 (3 rows)
3729
3730 -- No. S-3-4-5
3731 /*+IndexScan(ti1 ti1_expr)*/
3732 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)';
3733 LOG:  candidate index for "ti1": ti1_expr
3734 LOG:  pg_hint_plan:
3735 used hint:
3736 IndexScan(ti1 ti1_expr)
3737 not used hint:
3738 duplication hint:
3739 error hint:
3740
3741                                                                             QUERY PLAN                                                                             
3742 -------------------------------------------------------------------------------------------------------------------------------------------------------------------
3743  Index Scan using ti1_expr on ti1
3744    Index Cond: ((c1 < 100) = true)
3745    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))
3746 (3 rows)
3747
3748 -- No. S-3-4-6
3749 /*+IndexScan(ti1 ti1_pred)*/
3750 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)';
3751 LOG:  candidate index for "ti1": ti1_pred
3752 LOG:  pg_hint_plan:
3753 used hint:
3754 IndexScan(ti1 ti1_pred)
3755 not used hint:
3756 duplication hint:
3757 error hint:
3758
3759                                                               QUERY PLAN                                                               
3760 ---------------------------------------------------------------------------------------------------------------------------------------
3761  Index Scan using ti1_pred on ti1
3762    Index Cond: (lower(c4) = '1'::text)
3763    Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
3764 (3 rows)
3765
3766 -- No. S-3-4-7
3767 /*+IndexScan(ti1 ti1_uniq)*/
3768 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)';
3769 LOG:  candidate index for "ti1": ti1_uniq
3770 LOG:  pg_hint_plan:
3771 used hint:
3772 IndexScan(ti1 ti1_uniq)
3773 not used hint:
3774 duplication hint:
3775 error hint:
3776
3777                                                                      QUERY PLAN                                                                     
3778 ----------------------------------------------------------------------------------------------------------------------------------------------------
3779  Index Scan using ti1_uniq on ti1
3780    Index Cond: (c1 < 100)
3781    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3782 (3 rows)
3783
3784 -- No. S-3-4-8
3785 /*+IndexScan(ti1 ti1_multi)*/
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:  candidate index for "ti1": ti1_multi
3788 LOG:  pg_hint_plan:
3789 used hint:
3790 IndexScan(ti1 ti1_multi)
3791 not used hint:
3792 duplication hint:
3793 error hint:
3794
3795                                                               QUERY PLAN                                                               
3796 ---------------------------------------------------------------------------------------------------------------------------------------
3797  Index Scan using ti1_multi on ti1
3798    Index Cond: ((c1 < 100) AND (c2 = 1))
3799    Filter: ((ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3800 (3 rows)
3801
3802 -- No. S-3-4-9
3803 /*+IndexScan(ti1 ti1_ts)*/
3804 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)';
3805 LOG:  candidate index for "ti1": ti1_ts
3806 LOG:  pg_hint_plan:
3807 used hint:
3808 IndexScan(ti1 ti1_ts)
3809 not used hint:
3810 duplication hint:
3811 error hint:
3812
3813                                                                QUERY PLAN                                                                
3814 -----------------------------------------------------------------------------------------------------------------------------------------
3815  Tid Scan on ti1
3816    TID Cond: (ctid = '(1,1)'::tid)
3817    Filter: ((c1 < 100) AND (c2 = 1) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3818 (3 rows)
3819
3820 -- No. S-3-4-10
3821 /*+IndexScan(ti1 ti1_pkey)*/
3822 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)';
3823 LOG:  candidate index for "ti1": ti1_pkey
3824 LOG:  pg_hint_plan:
3825 used hint:
3826 IndexScan(ti1 ti1_pkey)
3827 not used hint:
3828 duplication hint:
3829 error hint:
3830
3831                                                                      QUERY PLAN                                                                     
3832 ----------------------------------------------------------------------------------------------------------------------------------------------------
3833  Index Scan using ti1_pkey on ti1
3834    Index Cond: (c1 < 100)
3835    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3836 (3 rows)
3837
3838 -- No. S-3-4-11
3839 /*+IndexScan(ti1 ti1_c2_key)*/
3840 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)';
3841 LOG:  candidate index for "ti1": ti1_c2_key
3842 LOG:  pg_hint_plan:
3843 used hint:
3844 IndexScan(ti1 ti1_c2_key)
3845 not used hint:
3846 duplication hint:
3847 error hint:
3848
3849                                                                       QUERY PLAN                                                                      
3850 ------------------------------------------------------------------------------------------------------------------------------------------------------
3851  Index Scan using ti1_c2_key on ti1
3852    Index Cond: (c2 = 1)
3853    Filter: ((c1 < 100) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3854 (3 rows)
3855
3856 -- No. S-3-4-12
3857 /*+BitmapScan(ti1 ti1_btree)*/
3858 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)';
3859 LOG:  candidate index for "ti1": ti1_btree
3860 LOG:  pg_hint_plan:
3861 used hint:
3862 BitmapScan(ti1 ti1_btree)
3863 not used hint:
3864 duplication hint:
3865 error hint:
3866
3867                                                                      QUERY PLAN                                                                     
3868 ----------------------------------------------------------------------------------------------------------------------------------------------------
3869  Bitmap Heap Scan on ti1
3870    Recheck Cond: (c1 < 100)
3871    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3872    ->  Bitmap Index Scan on ti1_btree
3873          Index Cond: (c1 < 100)
3874 (5 rows)
3875
3876 -- No. S-3-4-13
3877 /*+BitmapScan(ti1 ti1_hash)*/
3878 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)';
3879 LOG:  candidate index for "ti1": ti1_hash
3880 LOG:  pg_hint_plan:
3881 used hint:
3882 BitmapScan(ti1 ti1_hash)
3883 not used hint:
3884 duplication hint:
3885 error hint:
3886
3887                                                                      QUERY PLAN                                                                     
3888 ----------------------------------------------------------------------------------------------------------------------------------------------------
3889  Bitmap Heap Scan on ti1
3890    Recheck Cond: (c1 = 100)
3891    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3892    ->  Bitmap Index Scan on ti1_hash
3893          Index Cond: (c1 = 100)
3894 (5 rows)
3895
3896 -- No. S-3-4-14
3897 /*+BitmapScan(ti1 ti1_gist)*/
3898 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)';
3899 LOG:  candidate index for "ti1": ti1_gist
3900 LOG:  pg_hint_plan:
3901 used hint:
3902 BitmapScan(ti1 ti1_gist)
3903 not used hint:
3904 duplication hint:
3905 error hint:
3906
3907                                                                      QUERY PLAN                                                                     
3908 ----------------------------------------------------------------------------------------------------------------------------------------------------
3909  Bitmap Heap Scan on ti1
3910    Recheck Cond: (c1 < 100)
3911    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3912    ->  Bitmap Index Scan on ti1_gist
3913          Index Cond: (c1 < 100)
3914 (5 rows)
3915
3916 -- No. S-3-4-15
3917 /*+BitmapScan(ti1 ti1_gin)*/
3918 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)';
3919 LOG:  candidate index for "ti1": ti1_gin
3920 LOG:  pg_hint_plan:
3921 used hint:
3922 BitmapScan(ti1 ti1_gin)
3923 not used hint:
3924 duplication hint:
3925 error hint:
3926
3927                                                                      QUERY PLAN                                                                     
3928 ----------------------------------------------------------------------------------------------------------------------------------------------------
3929  Bitmap Heap Scan on ti1
3930    Recheck Cond: (c1 < 100)
3931    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3932    ->  Bitmap Index Scan on ti1_gin
3933          Index Cond: (c1 < 100)
3934 (5 rows)
3935
3936 -- No. S-3-4-16
3937 /*+BitmapScan(ti1 ti1_expr)*/
3938 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)';
3939 LOG:  candidate index for "ti1": ti1_expr
3940 LOG:  pg_hint_plan:
3941 used hint:
3942 BitmapScan(ti1 ti1_expr)
3943 not used hint:
3944 duplication hint:
3945 error hint:
3946
3947                                                                             QUERY PLAN                                                                             
3948 -------------------------------------------------------------------------------------------------------------------------------------------------------------------
3949  Bitmap Heap Scan on ti1
3950    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))
3951    ->  Bitmap Index Scan on ti1_expr
3952          Index Cond: ((c1 < 100) = true)
3953 (4 rows)
3954
3955 -- No. S-3-4-17
3956 /*+BitmapScan(ti1 ti1_pred)*/
3957 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)';
3958 LOG:  candidate index for "ti1": ti1_pred
3959 LOG:  pg_hint_plan:
3960 used hint:
3961 BitmapScan(ti1 ti1_pred)
3962 not used hint:
3963 duplication hint:
3964 error hint:
3965
3966                                                               QUERY PLAN                                                               
3967 ---------------------------------------------------------------------------------------------------------------------------------------
3968  Bitmap Heap Scan on ti1
3969    Recheck Cond: (lower(c4) = '1'::text)
3970    Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
3971    ->  Bitmap Index Scan on ti1_pred
3972          Index Cond: (lower(c4) = '1'::text)
3973 (5 rows)
3974
3975 -- No. S-3-4-18
3976 /*+BitmapScan(ti1 ti1_uniq)*/
3977 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)';
3978 LOG:  candidate index for "ti1": ti1_uniq
3979 LOG:  pg_hint_plan:
3980 used hint:
3981 BitmapScan(ti1 ti1_uniq)
3982 not used hint:
3983 duplication hint:
3984 error hint:
3985
3986                                                                      QUERY PLAN                                                                     
3987 ----------------------------------------------------------------------------------------------------------------------------------------------------
3988  Bitmap Heap Scan on ti1
3989    Recheck Cond: (c1 < 100)
3990    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3991    ->  Bitmap Index Scan on ti1_uniq
3992          Index Cond: (c1 < 100)
3993 (5 rows)
3994
3995 -- No. S-3-4-19
3996 /*+BitmapScan(ti1 ti1_multi)*/
3997 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)';
3998 LOG:  candidate index for "ti1": ti1_multi
3999 LOG:  pg_hint_plan:
4000 used hint:
4001 BitmapScan(ti1 ti1_multi)
4002 not used hint:
4003 duplication hint:
4004 error hint:
4005
4006                                                               QUERY PLAN                                                               
4007 ---------------------------------------------------------------------------------------------------------------------------------------
4008  Bitmap Heap Scan on ti1
4009    Recheck Cond: ((c1 < 100) AND (c2 = 1))
4010    Filter: ((ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
4011    ->  Bitmap Index Scan on ti1_multi
4012          Index Cond: ((c1 < 100) AND (c2 = 1))
4013 (5 rows)
4014
4015 -- No. S-3-4-20
4016 /*+BitmapScan(ti1 ti1_ts)*/
4017 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)';
4018 LOG:  candidate index for "ti1": ti1_ts
4019 LOG:  pg_hint_plan:
4020 used hint:
4021 BitmapScan(ti1 ti1_ts)
4022 not used hint:
4023 duplication hint:
4024 error hint:
4025
4026                                         QUERY PLAN                                         
4027 -------------------------------------------------------------------------------------------
4028  Bitmap Heap Scan on ti1
4029    Recheck Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
4030    Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (lower(c4) = '1'::text))
4031    ->  Bitmap Index Scan on ti1_ts
4032          Index Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
4033 (5 rows)
4034
4035 -- No. S-3-4-10
4036 /*+BitmapScan(ti1 ti1_pkey)*/
4037 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)';
4038 LOG:  candidate index for "ti1": ti1_pkey
4039 LOG:  pg_hint_plan:
4040 used hint:
4041 BitmapScan(ti1 ti1_pkey)
4042 not used hint:
4043 duplication hint:
4044 error hint:
4045
4046                                                                      QUERY PLAN                                                                     
4047 ----------------------------------------------------------------------------------------------------------------------------------------------------
4048  Bitmap Heap Scan on ti1
4049    Recheck Cond: (c1 < 100)
4050    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
4051    ->  Bitmap Index Scan on ti1_pkey
4052          Index Cond: (c1 < 100)
4053 (5 rows)
4054
4055 -- No. S-3-4-11
4056 /*+BitmapScan(ti1 ti1_c2_key)*/
4057 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)';
4058 LOG:  candidate index for "ti1": ti1_c2_key
4059 LOG:  pg_hint_plan:
4060 used hint:
4061 BitmapScan(ti1 ti1_c2_key)
4062 not used hint:
4063 duplication hint:
4064 error hint:
4065
4066                                                                       QUERY PLAN                                                                      
4067 ------------------------------------------------------------------------------------------------------------------------------------------------------
4068  Bitmap Heap Scan on ti1
4069    Recheck Cond: (c2 = 1)
4070    Filter: ((c1 < 100) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
4071    ->  Bitmap Index Scan on ti1_c2_key
4072          Index Cond: (c2 = 1)
4073 (5 rows)
4074
4075 -- No. S-3-4-23
4076 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4077      QUERY PLAN      
4078 ---------------------
4079  Seq Scan on ti1
4080    Filter: (c1 >= 1)
4081 (2 rows)
4082
4083 /*+IndexOnlyScan(ti1 ti1_btree)*/
4084 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4085 LOG:  candidate index for "ti1": ti1_btree
4086 LOG:  pg_hint_plan:
4087 used hint:
4088 IndexOnlyScan(ti1 ti1_btree)
4089 not used hint:
4090 duplication hint:
4091 error hint:
4092
4093                QUERY PLAN               
4094 ----------------------------------------
4095  Index Only Scan using ti1_btree on ti1
4096    Index Cond: (c1 >= 1)
4097 (2 rows)
4098
4099 -- No. S-3-4-24
4100 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
4101               QUERY PLAN               
4102 ---------------------------------------
4103  Index Only Scan using ti1_uniq on ti1
4104    Index Cond: (c1 = 1)
4105 (2 rows)
4106
4107 /*+IndexOnlyScan(ti1 ti1_hash)*/
4108 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
4109 LOG:  candidate index for "ti1": ti1_hash
4110 LOG:  pg_hint_plan:
4111 used hint:
4112 IndexOnlyScan(ti1 ti1_hash)
4113 not used hint:
4114 duplication hint:
4115 error hint:
4116
4117             QUERY PLAN            
4118 ----------------------------------
4119  Index Scan using ti1_hash on ti1
4120    Index Cond: (c1 = 1)
4121 (2 rows)
4122
4123 -- No. S-3-4-25
4124 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 < 1;
4125               QUERY PLAN               
4126 ---------------------------------------
4127  Index Only Scan using ti1_uniq on ti1
4128    Index Cond: (c1 < 1)
4129 (2 rows)
4130
4131 /*+IndexOnlyScan(ti1 ti1_gist)*/
4132 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 < 1;
4133 LOG:  candidate index for "ti1": ti1_gist
4134 LOG:  pg_hint_plan:
4135 used hint:
4136 IndexOnlyScan(ti1 ti1_gist)
4137 not used hint:
4138 duplication hint:
4139 error hint:
4140
4141             QUERY PLAN            
4142 ----------------------------------
4143  Index Scan using ti1_gist on ti1
4144    Index Cond: (c1 < 1)
4145 (2 rows)
4146
4147 -- No. S-3-4-26
4148 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
4149               QUERY PLAN               
4150 ---------------------------------------
4151  Index Only Scan using ti1_uniq on ti1
4152    Index Cond: (c1 = 1)
4153 (2 rows)
4154
4155 /*+IndexOnlyScan(ti1 ti1_gin)*/
4156 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
4157 LOG:  candidate index for "ti1": ti1_gin
4158 LOG:  pg_hint_plan:
4159 used hint:
4160 IndexOnlyScan(ti1 ti1_gin)
4161 not used hint:
4162 duplication hint:
4163 error hint:
4164
4165      QUERY PLAN     
4166 --------------------
4167  Seq Scan on ti1
4168    Filter: (c1 = 1)
4169 (2 rows)
4170
4171 -- No. S-3-4-27
4172 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 < 100;
4173               QUERY PLAN               
4174 ---------------------------------------
4175  Index Only Scan using ti1_uniq on ti1
4176    Index Cond: (c1 < 100)
4177 (2 rows)
4178
4179 /*+IndexOnlyScan(ti1 ti1_expr)*/
4180 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 < 100;
4181 LOG:  candidate index for "ti1": ti1_expr
4182 LOG:  pg_hint_plan:
4183 used hint:
4184 IndexOnlyScan(ti1 ti1_expr)
4185 not used hint:
4186 duplication hint:
4187 error hint:
4188
4189             QUERY PLAN             
4190 -----------------------------------
4191  Index Scan using ti1_expr on ti1
4192    Index Cond: ((c1 < 100) = true)
4193    Filter: (c1 < 100)
4194 (3 rows)
4195
4196 -- No. S-3-4-28
4197 EXPLAIN (COSTS false) SELECT c4 FROM s1.ti1 WHERE lower(c4) >= '1';
4198              QUERY PLAN             
4199 ------------------------------------
4200  Seq Scan on ti1
4201    Filter: (lower(c4) >= '1'::text)
4202 (2 rows)
4203
4204 /*+IndexOnlyScan(ti1 ti1_pred)*/
4205 EXPLAIN (COSTS false) SELECT c4 FROM s1.ti1 WHERE lower(c4) >= '1';
4206 LOG:  candidate index for "ti1": ti1_pred
4207 LOG:  pg_hint_plan:
4208 used hint:
4209 IndexOnlyScan(ti1 ti1_pred)
4210 not used hint:
4211 duplication hint:
4212 error hint:
4213
4214                QUERY PLAN               
4215 ----------------------------------------
4216  Index Scan using ti1_pred on ti1
4217    Index Cond: (lower(c4) >= '1'::text)
4218 (2 rows)
4219
4220 -- No. S-3-4-29
4221 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4222      QUERY PLAN      
4223 ---------------------
4224  Seq Scan on ti1
4225    Filter: (c1 >= 1)
4226 (2 rows)
4227
4228 /*+IndexOnlyScan(ti1 ti1_uniq)*/
4229 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4230 LOG:  candidate index for "ti1": ti1_uniq
4231 LOG:  pg_hint_plan:
4232 used hint:
4233 IndexOnlyScan(ti1 ti1_uniq)
4234 not used hint:
4235 duplication hint:
4236 error hint:
4237
4238               QUERY PLAN               
4239 ---------------------------------------
4240  Index Only Scan using ti1_uniq on ti1
4241    Index Cond: (c1 >= 1)
4242 (2 rows)
4243
4244 -- No. S-3-4-30
4245 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4246      QUERY PLAN      
4247 ---------------------
4248  Seq Scan on ti1
4249    Filter: (c1 >= 1)
4250 (2 rows)
4251
4252 /*+IndexOnlyScan(ti1 ti1_multi)*/
4253 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4254 LOG:  candidate index for "ti1": ti1_multi
4255 LOG:  pg_hint_plan:
4256 used hint:
4257 IndexOnlyScan(ti1 ti1_multi)
4258 not used hint:
4259 duplication hint:
4260 error hint:
4261
4262                QUERY PLAN               
4263 ----------------------------------------
4264  Index Only Scan using ti1_multi on ti1
4265    Index Cond: (c1 >= 1)
4266 (2 rows)
4267
4268 -- No. S-3-4-31
4269 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE to_tsvector('english', c4) @@ 'a & b';
4270                                        QUERY PLAN                                        
4271 -----------------------------------------------------------------------------------------
4272  Bitmap Heap Scan on ti1
4273    Recheck Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
4274    ->  Bitmap Index Scan on ti1_ts
4275          Index Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
4276 (4 rows)
4277
4278 /*+IndexOnlyScan(ti1 ti1_ts)*/
4279 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE to_tsvector('english', c4) @@ 'a & b';
4280 LOG:  candidate index for "ti1": ti1_ts
4281 LOG:  pg_hint_plan:
4282 used hint:
4283 IndexOnlyScan(ti1 ti1_ts)
4284 not used hint:
4285 duplication hint:
4286 error hint:
4287
4288                                   QUERY PLAN                                   
4289 -------------------------------------------------------------------------------
4290  Seq Scan on ti1
4291    Filter: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
4292 (2 rows)
4293
4294 -- No. S-3-4-32
4295 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4296      QUERY PLAN      
4297 ---------------------
4298  Seq Scan on ti1
4299    Filter: (c1 >= 1)
4300 (2 rows)
4301
4302 /*+IndexOnlyScan(ti1 ti1_pkey)*/
4303 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4304 LOG:  candidate index for "ti1": ti1_pkey
4305 LOG:  pg_hint_plan:
4306 used hint:
4307 IndexOnlyScan(ti1 ti1_pkey)
4308 not used hint:
4309 duplication hint:
4310 error hint:
4311
4312               QUERY PLAN               
4313 ---------------------------------------
4314  Index Only Scan using ti1_pkey on ti1
4315    Index Cond: (c1 >= 1)
4316 (2 rows)
4317
4318 -- No. S-3-4-33
4319 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE c2 >= 1;
4320      QUERY PLAN      
4321 ---------------------
4322  Seq Scan on ti1
4323    Filter: (c2 >= 1)
4324 (2 rows)
4325
4326 /*+IndexOnlyScan(ti1 ti1_c2_key)*/
4327 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE c2 >= 1;
4328 LOG:  candidate index for "ti1": ti1_c2_key
4329 LOG:  pg_hint_plan:
4330 used hint:
4331 IndexOnlyScan(ti1 ti1_c2_key)
4332 not used hint:
4333 duplication hint:
4334 error hint:
4335
4336                QUERY PLAN                
4337 -----------------------------------------
4338  Index Only Scan using ti1_c2_key on ti1
4339    Index Cond: (c2 >= 1)
4340 (2 rows)
4341
4342 ----
4343 ---- No. S-3-5 not used index
4344 ----
4345 -- No. S-3-5-1
4346 /*+IndexScan(ti1 ti1_pred)*/
4347 EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
4348 LOG:  candidate index for "ti1": ti1_pred
4349 LOG:  pg_hint_plan:
4350 used hint:
4351 IndexScan(ti1 ti1_pred)
4352 not used hint:
4353 duplication hint:
4354 error hint:
4355
4356                                QUERY PLAN                               
4357 ------------------------------------------------------------------------
4358  Seq Scan on ti1  (cost=10000000000.00..10000000018.50 rows=1 width=15)
4359    Filter: (c1 = 100)
4360 (2 rows)
4361
4362 -- No. S-3-5-2
4363 /*+BitmapScan(ti1 ti1_pred)*/
4364 EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
4365 LOG:  candidate index for "ti1": ti1_pred
4366 LOG:  pg_hint_plan:
4367 used hint:
4368 BitmapScan(ti1 ti1_pred)
4369 not used hint:
4370 duplication hint:
4371 error hint:
4372
4373                                QUERY PLAN                               
4374 ------------------------------------------------------------------------
4375  Seq Scan on ti1  (cost=10000000000.00..10000000018.50 rows=1 width=15)
4376    Filter: (c1 = 100)
4377 (2 rows)
4378
4379 -- No. S-3-5-3
4380 /*+IndexOnlyScan(ti1 ti1_pred)*/
4381 EXPLAIN (COSTS true) SELECT c1 FROM s1.ti1 WHERE c1 = 100;
4382 LOG:  candidate index for "ti1": ti1_pred
4383 LOG:  pg_hint_plan:
4384 used hint:
4385 IndexOnlyScan(ti1 ti1_pred)
4386 not used hint:
4387 duplication hint:
4388 error hint:
4389
4390                               QUERY PLAN                               
4391 -----------------------------------------------------------------------
4392  Seq Scan on ti1  (cost=10000000000.00..10000000018.50 rows=1 width=4)
4393    Filter: (c1 = 100)
4394 (2 rows)
4395
4396 ----
4397 ---- No. S-3-6 not exist index
4398 ----
4399 -- No. S-3-6-1
4400 /*+IndexScan(ti1 not_exist)*/
4401 EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
4402 LOG:  candidate index for "ti1":
4403 LOG:  pg_hint_plan:
4404 used hint:
4405 IndexScan(ti1 not_exist)
4406 not used hint:
4407 duplication hint:
4408 error hint:
4409
4410                                QUERY PLAN                               
4411 ------------------------------------------------------------------------
4412  Seq Scan on ti1  (cost=10000000000.00..10000000018.50 rows=1 width=15)
4413    Filter: (c1 = 100)
4414 (2 rows)
4415
4416 -- No. S-3-6-2
4417 /*+BitmapScan(ti1 not_exist)*/
4418 EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
4419 LOG:  candidate index for "ti1":
4420 LOG:  pg_hint_plan:
4421 used hint:
4422 BitmapScan(ti1 not_exist)
4423 not used hint:
4424 duplication hint:
4425 error hint:
4426
4427                                QUERY PLAN                               
4428 ------------------------------------------------------------------------
4429  Seq Scan on ti1  (cost=10000000000.00..10000000018.50 rows=1 width=15)
4430    Filter: (c1 = 100)
4431 (2 rows)
4432
4433 -- No. S-3-6-3
4434 /*+IndexOnlyScan(ti1 not_exist)*/
4435 EXPLAIN (COSTS true) SELECT c1 FROM s1.ti1 WHERE c1 = 100;
4436 LOG:  candidate index for "ti1":
4437 LOG:  pg_hint_plan:
4438 used hint:
4439 IndexOnlyScan(ti1 not_exist)
4440 not used hint:
4441 duplication hint:
4442 error hint:
4443
4444                               QUERY PLAN                               
4445 -----------------------------------------------------------------------
4446  Seq Scan on ti1  (cost=10000000000.00..10000000018.50 rows=1 width=4)
4447    Filter: (c1 = 100)
4448 (2 rows)
4449
4450 ----
4451 ---- No. S-3-7 query structure
4452 ----
4453 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
4454                   QUERY PLAN                   
4455 -----------------------------------------------
4456  Hash Join
4457    Hash Cond: (t2.c1 = t1.c1)
4458    ->  Seq Scan on t2
4459    ->  Hash
4460          ->  Tid Scan on t1
4461                TID Cond: (ctid = '(1,1)'::tid)
4462 (6 rows)
4463
4464 -- No. S-3-7-1
4465 /*+SeqScan(t1)*/
4466 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE c1 = 100;
4467 LOG:  pg_hint_plan:
4468 used hint:
4469 SeqScan(t1)
4470 not used hint:
4471 duplication hint:
4472 error hint:
4473
4474       QUERY PLAN      
4475 ----------------------
4476  Seq Scan on t1
4477    Filter: (c1 = 100)
4478 (2 rows)
4479
4480 -- No. S-3-7-2
4481 /*+SeqScan(t1)BitmapScan(t2)*/
4482 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
4483 LOG:  pg_hint_plan:
4484 used hint:
4485 SeqScan(t1)
4486 BitmapScan(t2)
4487 not used hint:
4488 duplication hint:
4489 error hint:
4490
4491                QUERY PLAN               
4492 ----------------------------------------
4493  Nested Loop
4494    ->  Seq Scan on t1
4495          Filter: (ctid = '(1,1)'::tid)
4496    ->  Bitmap Heap Scan on t2
4497          Recheck Cond: (c1 = t1.c1)
4498          ->  Bitmap Index Scan on t2_i1
4499                Index Cond: (c1 = t1.c1)
4500 (7 rows)
4501
4502 -- No. S-3-7-3
4503 /*+SeqScan(t1)*/
4504 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
4505 LOG:  pg_hint_plan:
4506 used hint:
4507 SeqScan(t1)
4508 not used hint:
4509 duplication hint:
4510 error hint:
4511
4512                  QUERY PLAN                  
4513 ---------------------------------------------
4514  Hash Join
4515    Hash Cond: (t2.c1 = t1.c1)
4516    ->  Seq Scan on t2
4517    ->  Hash
4518          ->  Seq Scan on t1
4519                Filter: (ctid = '(1,1)'::tid)
4520 (6 rows)
4521
4522 ----
4523 ---- No. S-3-8 query structure
4524 ----
4525 -- No. S-3-8-1
4526 EXPLAIN (COSTS false) 
4527 WITH c1 (c1) AS (
4528 SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.c1 = 1)
4529 SELECT max(b3t1.c1), (
4530 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
4531                   ) FROM s1.t1 b3t1 WHERE b3t1.c1 = (
4532 SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
4533                              QUERY PLAN                              
4534 ---------------------------------------------------------------------
4535  Result
4536    InitPlan 2 (returns $1)
4537      ->  Result
4538            InitPlan 1 (returns $0)
4539              ->  Limit
4540                    ->  Index Only Scan using t1_i1 on t1 b2t1
4541                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4542    InitPlan 4 (returns $3)
4543      ->  Result
4544            InitPlan 3 (returns $2)
4545              ->  Limit
4546                    ->  Index Only Scan using t1_i1 on t1 b4t1
4547                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4548    InitPlan 5 (returns $4)
4549      ->  Limit
4550            ->  Index Only Scan using t1_i1 on t1 b3t1
4551                  Index Cond: ((c1 IS NOT NULL) AND (c1 = $3))
4552 (17 rows)
4553
4554 /*+SeqScan(b1t1)IndexScan(b2t1 t1_pkey)BitmapScan(b3t1 t1_pkey)TidScan(b4t1)
4555 */
4556 EXPLAIN (COSTS false) 
4557 WITH c1 (c1) AS (
4558 SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.c1 = 1)
4559 SELECT max(b3t1.c1), (
4560 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
4561                   ) FROM s1.t1 b3t1 WHERE b3t1.c1 = (
4562 SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
4563 LOG:  candidate index for "b2t1": t1_pkey
4564 LOG:  candidate index for "b2t1": t1_pkey
4565 LOG:  candidate index for "b3t1": t1_pkey
4566 LOG:  candidate index for "b3t1": t1_pkey
4567 LOG:  pg_hint_plan:
4568 used hint:
4569 IndexScan(b2t1 t1_pkey)
4570 BitmapScan(b3t1 t1_pkey)
4571 TidScan(b4t1)
4572 not used hint:
4573 SeqScan(b1t1)
4574 duplication hint:
4575 error hint:
4576
4577                              QUERY PLAN                              
4578 ---------------------------------------------------------------------
4579  Result
4580    InitPlan 2 (returns $1)
4581      ->  Result
4582            InitPlan 1 (returns $0)
4583              ->  Limit
4584                    ->  Index Scan using t1_pkey on t1 b2t1
4585                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4586    InitPlan 4 (returns $3)
4587      ->  Result
4588            InitPlan 3 (returns $2)
4589              ->  Limit
4590                    ->  Seq Scan on t1 b4t1
4591                          Filter: ((c1 IS NOT NULL) AND (c1 = 1))
4592    InitPlan 5 (returns $4)
4593      ->  Limit
4594            ->  Bitmap Heap Scan on t1 b3t1
4595                  Recheck Cond: ((c1 IS NOT NULL) AND (c1 = $3))
4596                  ->  Bitmap Index Scan on t1_pkey
4597                        Index Cond: ((c1 IS NOT NULL) AND (c1 = $3))
4598 (19 rows)
4599
4600 -- No. S-3-8-2
4601 EXPLAIN (COSTS false) 
4602 WITH cte1 (c1) AS (
4603 SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
4604 SELECT max(b3t1.c1), (
4605 SELECT max(b2t1.c1) FROM s1.t1 b2t1 JOIN s1.t2 b2t2 ON(b2t1.c1 = b2t2.c1) WHERE b2t1.c1 = 1
4606                   ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
4607 SELECT max(b4t1.c1) FROM s1.t1 b4t1 JOIN s1.t2 b4t2 ON(b4t1.c1 = b4t2.c1) WHERE b4t1.c1 = 1);
4608                          QUERY PLAN                         
4609 ------------------------------------------------------------
4610  Aggregate
4611    CTE cte1
4612      ->  Aggregate
4613            ->  Nested Loop
4614                  ->  Index Only Scan using t1_i1 on t1 b1t1
4615                        Index Cond: (c1 = 1)
4616                  ->  Seq Scan on t2 b1t2
4617                        Filter: (c1 = 1)
4618    InitPlan 2 (returns $1)
4619      ->  Aggregate
4620            ->  Nested Loop
4621                  ->  Index Only Scan using t1_i1 on t1 b2t1
4622                        Index Cond: (c1 = 1)
4623                  ->  Seq Scan on t2 b2t2
4624                        Filter: (c1 = 1)
4625    InitPlan 3 (returns $2)
4626      ->  Aggregate
4627            ->  Nested Loop
4628                  ->  Index Only Scan using t1_i1 on t1 b4t1
4629                        Index Cond: (c1 = 1)
4630                  ->  Seq Scan on t2 b4t2
4631                        Filter: (c1 = 1)
4632    ->  Nested Loop
4633          ->  Nested Loop
4634                ->  Index Only Scan using t1_i1 on t1 b3t1
4635                      Index Cond: (c1 = $2)
4636                ->  Seq Scan on t2 b3t2
4637                      Filter: (c1 = $2)
4638          ->  CTE Scan on cte1
4639                Filter: (c1 = $2)
4640 (30 rows)
4641
4642 /*+SeqScan(b1t1)IndexScan(b2t1 t1_pkey)BitmapScan(b3t1 t1_pkey)TidScan(b4t1)
4643 TidScan(b1t2)SeqScan(b2t2)IndexScan(b3t2 t2_pkey)BitmapScan(b4t2 t2_pkey)
4644 */
4645 EXPLAIN (COSTS false) 
4646 WITH cte1 (c1) AS (
4647 SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
4648 SELECT max(b3t1.c1), (
4649 SELECT max(b2t1.c1) FROM s1.t1 b2t1 JOIN s1.t2 b2t2 ON(b2t1.c1 = b2t2.c1) WHERE b2t1.c1 = 1
4650                   ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
4651 SELECT max(b4t1.c1) FROM s1.t1 b4t1 JOIN s1.t2 b4t2 ON(b4t1.c1 = b4t2.c1) WHERE b4t1.c1 = 1);
4652 LOG:  candidate index for "b2t1": t1_pkey
4653 LOG:  candidate index for "b4t2": t2_pkey
4654 LOG:  candidate index for "b3t1": t1_pkey
4655 LOG:  candidate index for "b3t2": t2_pkey
4656 LOG:  pg_hint_plan:
4657 used hint:
4658 SeqScan(b1t1)
4659 TidScan(b1t2)
4660 IndexScan(b2t1 t1_pkey)
4661 SeqScan(b2t2)
4662 BitmapScan(b3t1 t1_pkey)
4663 IndexScan(b3t2 t2_pkey)
4664 TidScan(b4t1)
4665 BitmapScan(b4t2 t2_pkey)
4666 not used hint:
4667 duplication hint:
4668 error hint:
4669
4670                        QUERY PLAN                        
4671 ---------------------------------------------------------
4672  Aggregate
4673    CTE cte1
4674      ->  Aggregate
4675            ->  Nested Loop
4676                  ->  Seq Scan on t1 b1t1
4677                        Filter: (c1 = 1)
4678                  ->  Seq Scan on t2 b1t2
4679                        Filter: (c1 = 1)
4680    InitPlan 2 (returns $1)
4681      ->  Aggregate
4682            ->  Nested Loop
4683                  ->  Index Scan using t1_pkey on t1 b2t1
4684                        Index Cond: (c1 = 1)
4685                  ->  Seq Scan on t2 b2t2
4686                        Filter: (c1 = 1)
4687    InitPlan 3 (returns $2)
4688      ->  Aggregate
4689            ->  Nested Loop
4690                  ->  Seq Scan on t1 b4t1
4691                        Filter: (c1 = 1)
4692                  ->  Bitmap Heap Scan on t2 b4t2
4693                        Recheck Cond: (c1 = 1)
4694                        ->  Bitmap Index Scan on t2_pkey
4695                              Index Cond: (c1 = 1)
4696    ->  Nested Loop
4697          ->  Nested Loop
4698                ->  Bitmap Heap Scan on t1 b3t1
4699                      Recheck Cond: (c1 = $2)
4700                      ->  Bitmap Index Scan on t1_pkey
4701                            Index Cond: (c1 = $2)
4702                ->  Index Scan using t2_pkey on t2 b3t2
4703                      Index Cond: (c1 = $2)
4704          ->  CTE Scan on cte1
4705                Filter: (c1 = $2)
4706 (34 rows)
4707
4708 -- No. S-3-8-3
4709 EXPLAIN (COSTS false) 
4710 WITH cte1 (c1) AS (
4711 SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
4712 SELECT max(b3t1.c1), (
4713 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
4714                   ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
4715 SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
4716                              QUERY PLAN                              
4717 ---------------------------------------------------------------------
4718  Aggregate
4719    CTE cte1
4720      ->  Aggregate
4721            ->  Nested Loop
4722                  ->  Index Only Scan using t1_i1 on t1 b1t1
4723                        Index Cond: (c1 = 1)
4724                  ->  Seq Scan on t2 b1t2
4725                        Filter: (c1 = 1)
4726    InitPlan 3 (returns $2)
4727      ->  Result
4728            InitPlan 2 (returns $1)
4729              ->  Limit
4730                    ->  Index Only Scan using t1_i1 on t1 b2t1
4731                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4732    InitPlan 5 (returns $4)
4733      ->  Result
4734            InitPlan 4 (returns $3)
4735              ->  Limit
4736                    ->  Index Only Scan using t1_i1 on t1 b4t1
4737                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4738    ->  Nested Loop
4739          ->  Nested Loop
4740                ->  Index Only Scan using t1_i1 on t1 b3t1
4741                      Index Cond: (c1 = $4)
4742                ->  Seq Scan on t2 b3t2
4743                      Filter: (c1 = $4)
4744          ->  CTE Scan on cte1
4745                Filter: (c1 = $4)
4746 (28 rows)
4747
4748 /*+SeqScan(b1t1)IndexScan(b2t1 t1_pkey)BitmapScan(b3t1 t1_pkey)TidScan(b4t1)
4749 TidScan(b1t2)IndexScan(b3t2 t2_pkey)
4750 */
4751 EXPLAIN (COSTS false) 
4752 WITH cte1 (c1) AS (
4753 SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
4754 SELECT max(b3t1.c1), (
4755 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
4756                   ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
4757 SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
4758 LOG:  candidate index for "b2t1": t1_pkey
4759 LOG:  candidate index for "b2t1": t1_pkey
4760 LOG:  candidate index for "b3t1": t1_pkey
4761 LOG:  candidate index for "b3t2": t2_pkey
4762 LOG:  pg_hint_plan:
4763 used hint:
4764 SeqScan(b1t1)
4765 TidScan(b1t2)
4766 IndexScan(b2t1 t1_pkey)
4767 BitmapScan(b3t1 t1_pkey)
4768 IndexScan(b3t2 t2_pkey)
4769 TidScan(b4t1)
4770 not used hint:
4771 duplication hint:
4772 error hint:
4773
4774                              QUERY PLAN                              
4775 ---------------------------------------------------------------------
4776  Aggregate
4777    CTE cte1
4778      ->  Aggregate
4779            ->  Nested Loop
4780                  ->  Seq Scan on t1 b1t1
4781                        Filter: (c1 = 1)
4782                  ->  Seq Scan on t2 b1t2
4783                        Filter: (c1 = 1)
4784    InitPlan 3 (returns $2)
4785      ->  Result
4786            InitPlan 2 (returns $1)
4787              ->  Limit
4788                    ->  Index Scan using t1_pkey on t1 b2t1
4789                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4790    InitPlan 5 (returns $4)
4791      ->  Result
4792            InitPlan 4 (returns $3)
4793              ->  Limit
4794                    ->  Seq Scan on t1 b4t1
4795                          Filter: ((c1 IS NOT NULL) AND (c1 = 1))
4796    ->  Nested Loop
4797          ->  Nested Loop
4798                ->  Bitmap Heap Scan on t1 b3t1
4799                      Recheck Cond: (c1 = $4)
4800                      ->  Bitmap Index Scan on t1_pkey
4801                            Index Cond: (c1 = $4)
4802                ->  Index Scan using t2_pkey on t2 b3t2
4803                      Index Cond: (c1 = $4)
4804          ->  CTE Scan on cte1
4805                Filter: (c1 = $4)
4806 (30 rows)
4807
4808 ----
4809 ---- No. S-3-9 inheritance table select type
4810 ----
4811 -- No. S-3-9-1
4812 EXPLAIN (COSTS false) SELECT * FROM ONLY s1.p1 WHERE c1 = 1;
4813      QUERY PLAN     
4814 --------------------
4815  Seq Scan on p1
4816    Filter: (c1 = 1)
4817 (2 rows)
4818
4819 /*+IndexScan(p1)*/
4820 EXPLAIN (COSTS false) SELECT * FROM ONLY s1.p1 WHERE c1 = 1;
4821 LOG:  pg_hint_plan:
4822 used hint:
4823 IndexScan(p1)
4824 not used hint:
4825 duplication hint:
4826 error hint:
4827
4828          QUERY PLAN          
4829 -----------------------------
4830  Index Scan using p1_i on p1
4831    Index Cond: (c1 = 1)
4832 (2 rows)
4833
4834 -- No. S-3-9-2
4835 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
4836            QUERY PLAN            
4837 ---------------------------------
4838  Result
4839    ->  Append
4840          ->  Seq Scan on p1
4841                Filter: (c1 = 1)
4842          ->  Seq Scan on p1c1 p1
4843                Filter: (c1 = 1)
4844 (6 rows)
4845
4846 /*+IndexScan(p1)*/
4847 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
4848 LOG:  pg_hint_plan:
4849 used hint:
4850 IndexScan(p1)
4851 not used hint:
4852 duplication hint:
4853 error hint:
4854
4855                    QUERY PLAN                   
4856 ------------------------------------------------
4857  Result
4858    ->  Append
4859          ->  Index Scan using p1_i on p1
4860                Index Cond: (c1 = 1)
4861          ->  Index Scan using p1c1_i on p1c1 p1
4862                Index Cond: (c1 = 1)
4863 (6 rows)
4864
4865 ----
4866 ---- No. S-3-10 inheritance table number
4867 ----
4868 -- No. S-3-10-1
4869 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
4870            QUERY PLAN            
4871 ---------------------------------
4872  Result
4873    ->  Append
4874          ->  Seq Scan on p1
4875                Filter: (c1 = 1)
4876          ->  Seq Scan on p1c1 p1
4877                Filter: (c1 = 1)
4878 (6 rows)
4879
4880 /*+IndexScan(p1)*/
4881 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
4882 LOG:  pg_hint_plan:
4883 used hint:
4884 IndexScan(p1)
4885 not used hint:
4886 duplication hint:
4887 error hint:
4888
4889                    QUERY PLAN                   
4890 ------------------------------------------------
4891  Result
4892    ->  Append
4893          ->  Index Scan using p1_i on p1
4894                Index Cond: (c1 = 1)
4895          ->  Index Scan using p1c1_i on p1c1 p1
4896                Index Cond: (c1 = 1)
4897 (6 rows)
4898
4899 -- No. S-3-10-2
4900 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4901             QUERY PLAN             
4902 -----------------------------------
4903  Result
4904    ->  Append
4905          ->  Seq Scan on p2
4906                Filter: (c1 = 1)
4907          ->  Seq Scan on p2c1 p2
4908                Filter: (c1 = 1)
4909          ->  Seq Scan on p2c1c1 p2
4910                Filter: (c1 = 1)
4911 (8 rows)
4912
4913 /*+IndexScan(p2)*/
4914 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4915 LOG:  pg_hint_plan:
4916 used hint:
4917 IndexScan(p2)
4918 not used hint:
4919 duplication hint:
4920 error hint:
4921
4922                      QUERY PLAN                     
4923 ----------------------------------------------------
4924  Result
4925    ->  Append
4926          ->  Index Scan using p2_i on p2
4927                Index Cond: (c1 = 1)
4928          ->  Index Scan using p2c1_i on p2c1 p2
4929                Index Cond: (c1 = 1)
4930          ->  Index Scan using p2c1c1_i on p2c1c1 p2
4931                Index Cond: (c1 = 1)
4932 (8 rows)
4933
4934 ----
4935 ---- No. S-3-11 inheritance table specified table
4936 ----
4937 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4938             QUERY PLAN             
4939 -----------------------------------
4940  Result
4941    ->  Append
4942          ->  Seq Scan on p2
4943                Filter: (c1 = 1)
4944          ->  Seq Scan on p2c1 p2
4945                Filter: (c1 = 1)
4946          ->  Seq Scan on p2c1c1 p2
4947                Filter: (c1 = 1)
4948 (8 rows)
4949
4950 -- No. S-3-11-1
4951 /*+IndexScan(p2)*/
4952 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4953 LOG:  pg_hint_plan:
4954 used hint:
4955 IndexScan(p2)
4956 not used hint:
4957 duplication hint:
4958 error hint:
4959
4960                      QUERY PLAN                     
4961 ----------------------------------------------------
4962  Result
4963    ->  Append
4964          ->  Index Scan using p2_i on p2
4965                Index Cond: (c1 = 1)
4966          ->  Index Scan using p2c1_i on p2c1 p2
4967                Index Cond: (c1 = 1)
4968          ->  Index Scan using p2c1c1_i on p2c1c1 p2
4969                Index Cond: (c1 = 1)
4970 (8 rows)
4971
4972 -- No. S-3-11-2
4973 /*+IndexScan(p2c1)*/
4974 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4975 LOG:  pg_hint_plan:
4976 used hint:
4977 not used hint:
4978 IndexScan(p2c1)
4979 duplication hint:
4980 error hint:
4981
4982             QUERY PLAN             
4983 -----------------------------------
4984  Result
4985    ->  Append
4986          ->  Seq Scan on p2
4987                Filter: (c1 = 1)
4988          ->  Seq Scan on p2c1 p2
4989                Filter: (c1 = 1)
4990          ->  Seq Scan on p2c1c1 p2
4991                Filter: (c1 = 1)
4992 (8 rows)
4993
4994 -- No. S-3-11-3
4995 /*+IndexScan(p2 p2_pkey p2c1_pkey p2c1c1_pkey)*/
4996 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4997 LOG:  candidate index for "p2":
4998 LOG:  candidate index for "p2": p2_pkey
4999 LOG:  candidate index for "p2c1": p2c1_pkey
5000 LOG:  candidate index for "p2c2":
5001 LOG:  candidate index for "p2c3":
5002 LOG:  candidate index for "p2c1c1": p2c1c1_pkey
5003 LOG:  candidate index for "p2c1c2":
5004 LOG:  candidate index for "p2c2c1":
5005 LOG:  candidate index for "p2c2c2":
5006 LOG:  candidate index for "p2c3c1":
5007 LOG:  candidate index for "p2c3c2":
5008 LOG:  pg_hint_plan:
5009 used hint:
5010 IndexScan(p2 p2_pkey p2c1_pkey p2c1c1_pkey)
5011 not used hint:
5012 duplication hint:
5013 error hint:
5014
5015                       QUERY PLAN                       
5016 -------------------------------------------------------
5017  Result
5018    ->  Append
5019          ->  Index Scan using p2_pkey on p2
5020                Index Cond: (c1 = 1)
5021          ->  Index Scan using p2c1_pkey on p2c1 p2
5022                Index Cond: (c1 = 1)
5023          ->  Index Scan using p2c1c1_pkey on p2c1c1 p2
5024                Index Cond: (c1 = 1)
5025 (8 rows)
5026
5027 -- No. S-3-11-4
5028 /*+IndexScan(p2 p2c1_pkey)*/
5029 EXPLAIN (COSTS true) SELECT * FROM s1.p2 WHERE c1 = 1;
5030 LOG:  candidate index for "p2":
5031 LOG:  candidate index for "p2":
5032 LOG:  candidate index for "p2c1": p2c1_pkey
5033 LOG:  candidate index for "p2c2":
5034 LOG:  candidate index for "p2c3":
5035 LOG:  candidate index for "p2c1c1":
5036 LOG:  candidate index for "p2c1c2":
5037 LOG:  candidate index for "p2c2c1":
5038 LOG:  candidate index for "p2c2c2":
5039 LOG:  candidate index for "p2c3c1":
5040 LOG:  candidate index for "p2c3c2":
5041 LOG:  pg_hint_plan:
5042 used hint:
5043 IndexScan(p2 p2c1_pkey)
5044 not used hint:
5045 duplication hint:
5046 error hint:
5047
5048                                         QUERY PLAN                                        
5049 ------------------------------------------------------------------------------------------
5050  Result  (cost=10000000000.00..20000000009.89 rows=3 width=34)
5051    ->  Append  (cost=10000000000.00..20000000009.89 rows=3 width=34)
5052          ->  Seq Scan on p2  (cost=10000000000.00..10000000000.00 rows=1 width=44)
5053                Filter: (c1 = 1)
5054          ->  Index Scan using p2c1_pkey on p2c1 p2  (cost=0.00..8.27 rows=1 width=44)
5055                Index Cond: (c1 = 1)
5056          ->  Seq Scan on p2c1c1 p2  (cost=10000000000.00..10000000001.62 rows=1 width=14)
5057                Filter: (c1 = 1)
5058 (8 rows)
5059
5060 ----
5061 ---- No. S-3-12 specified same table
5062 ----
5063 -- No. S-3-12-1
5064 /*+IndexScan(ti1) BitmapScan(ti1)*/
5065 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5066 INFO:  hint syntax error at or near "IndexScan(ti1) BitmapScan(ti1)"
5067 DETAIL:  Conflict scan method hint.
5068 LOG:  pg_hint_plan:
5069 used hint:
5070 BitmapScan(ti1)
5071 not used hint:
5072 duplication hint:
5073 IndexScan(ti1)
5074 error hint:
5075
5076              QUERY PLAN              
5077 -------------------------------------
5078  Bitmap Heap Scan on ti1
5079    Recheck Cond: (c1 = 1)
5080    Filter: (ctid = '(1,1)'::tid)
5081    ->  Bitmap Index Scan on ti1_uniq
5082          Index Cond: (c1 = 1)
5083 (5 rows)
5084
5085 -- No. S-3-12-2
5086 /*+IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)*/
5087 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5088 INFO:  hint syntax error at or near "IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
5089 DETAIL:  Conflict scan method hint.
5090 LOG:  candidate index for "ti1": ti1_btree
5091 LOG:  pg_hint_plan:
5092 used hint:
5093 BitmapScan(ti1 ti1_btree)
5094 not used hint:
5095 duplication hint:
5096 IndexScan(ti1 ti1_pkey)
5097 error hint:
5098
5099               QUERY PLAN              
5100 --------------------------------------
5101  Bitmap Heap Scan on ti1
5102    Recheck Cond: (c1 = 1)
5103    Filter: (ctid = '(1,1)'::tid)
5104    ->  Bitmap Index Scan on ti1_btree
5105          Index Cond: (c1 = 1)
5106 (5 rows)
5107
5108 -- No. S-3-12-3
5109 /*+BitmapScan(ti1) IndexScan(ti1) BitmapScan(ti1)*/
5110 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5111 INFO:  hint syntax error at or near "BitmapScan(ti1) IndexScan(ti1) BitmapScan(ti1)"
5112 DETAIL:  Conflict scan method hint.
5113 INFO:  hint syntax error at or near "IndexScan(ti1) BitmapScan(ti1)"
5114 DETAIL:  Conflict scan method hint.
5115 LOG:  pg_hint_plan:
5116 used hint:
5117 BitmapScan(ti1)
5118 not used hint:
5119 duplication hint:
5120 BitmapScan(ti1)
5121 IndexScan(ti1)
5122 error hint:
5123
5124              QUERY PLAN              
5125 -------------------------------------
5126  Bitmap Heap Scan on ti1
5127    Recheck Cond: (c1 = 1)
5128    Filter: (ctid = '(1,1)'::tid)
5129    ->  Bitmap Index Scan on ti1_uniq
5130          Index Cond: (c1 = 1)
5131 (5 rows)
5132
5133 -- No. S-3-12-4
5134 /*+BitmapScan(ti1 ti1_hash) IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)*/
5135 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5136 INFO:  hint syntax error at or near "BitmapScan(ti1 ti1_hash) IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
5137 DETAIL:  Conflict scan method hint.
5138 INFO:  hint syntax error at or near "IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
5139 DETAIL:  Conflict scan method hint.
5140 LOG:  candidate index for "ti1": ti1_btree
5141 LOG:  pg_hint_plan:
5142 used hint:
5143 BitmapScan(ti1 ti1_btree)
5144 not used hint:
5145 duplication hint:
5146 BitmapScan(ti1 ti1_hash)
5147 IndexScan(ti1 ti1_pkey)
5148 error hint:
5149
5150               QUERY PLAN              
5151 --------------------------------------
5152  Bitmap Heap Scan on ti1
5153    Recheck Cond: (c1 = 1)
5154    Filter: (ctid = '(1,1)'::tid)
5155    ->  Bitmap Index Scan on ti1_btree
5156          Index Cond: (c1 = 1)
5157 (5 rows)
5158
5159 ----
5160 ---- No. S-3-13 message output
5161 ----
5162 -- No. S-3-13-1
5163 /*+SeqScan(ti1)*/
5164 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5165 LOG:  pg_hint_plan:
5166 used hint:
5167 SeqScan(ti1)
5168 not used hint:
5169 duplication hint:
5170 error hint:
5171
5172                    QUERY PLAN                   
5173 ------------------------------------------------
5174  Seq Scan on ti1
5175    Filter: ((c1 = 1) AND (ctid = '(1,1)'::tid))
5176 (2 rows)
5177
5178 -- No. S-3-13-2
5179 /*+SeqScan(ti1 ti1_pkey)*/
5180 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5181 INFO:  hint syntax error at or near ""
5182 DETAIL:  SeqScan hint accepts only one relation.
5183 LOG:  pg_hint_plan:
5184 used hint:
5185 not used hint:
5186 duplication hint:
5187 error hint:
5188 SeqScan(ti1 ti1_pkey)
5189
5190             QUERY PLAN             
5191 -----------------------------------
5192  Tid Scan on ti1
5193    TID Cond: (ctid = '(1,1)'::tid)
5194    Filter: (c1 = 1)
5195 (3 rows)
5196
5197 -- No. S-3-13-3
5198 /*+SeqScan(ti1 ti1_pkey ti1_btree)*/
5199 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5200 INFO:  hint syntax error at or near ""
5201 DETAIL:  SeqScan hint accepts only one relation.
5202 LOG:  pg_hint_plan:
5203 used hint:
5204 not used hint:
5205 duplication hint:
5206 error hint:
5207 SeqScan(ti1 ti1_pkey ti1_btree)
5208
5209             QUERY PLAN             
5210 -----------------------------------
5211  Tid Scan on ti1
5212    TID Cond: (ctid = '(1,1)'::tid)
5213    Filter: (c1 = 1)
5214 (3 rows)
5215
5216 -- No. S-3-13-4
5217 /*+IndexScan(ti1)*/
5218 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5219 LOG:  pg_hint_plan:
5220 used hint:
5221 IndexScan(ti1)
5222 not used hint:
5223 duplication hint:
5224 error hint:
5225
5226             QUERY PLAN            
5227 ----------------------------------
5228  Index Scan using ti1_uniq on ti1
5229    Index Cond: (c1 = 1)
5230    Filter: (ctid = '(1,1)'::tid)
5231 (3 rows)
5232
5233 -- No. S-3-13-5
5234 /*+IndexScan(ti1 ti1_pkey)*/
5235 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5236 LOG:  candidate index for "ti1": ti1_pkey
5237 LOG:  pg_hint_plan:
5238 used hint:
5239 IndexScan(ti1 ti1_pkey)
5240 not used hint:
5241 duplication hint:
5242 error hint:
5243
5244             QUERY PLAN            
5245 ----------------------------------
5246  Index Scan using ti1_pkey on ti1
5247    Index Cond: (c1 = 1)
5248    Filter: (ctid = '(1,1)'::tid)
5249 (3 rows)
5250
5251 -- No. S-3-13-6
5252 /*+IndexScan(ti1 ti1_pkey ti1_btree)*/
5253 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5254 LOG:  candidate index for "ti1": ti1_btree ti1_pkey
5255 LOG:  pg_hint_plan:
5256 used hint:
5257 IndexScan(ti1 ti1_pkey ti1_btree)
5258 not used hint:
5259 duplication hint:
5260 error hint:
5261
5262             QUERY PLAN             
5263 -----------------------------------
5264  Index Scan using ti1_btree on ti1
5265    Index Cond: (c1 = 1)
5266    Filter: (ctid = '(1,1)'::tid)
5267 (3 rows)
5268
5269 -- No. S-3-13-7
5270 /*+BitmapScan(ti1)*/
5271 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5272 LOG:  pg_hint_plan:
5273 used hint:
5274 BitmapScan(ti1)
5275 not used hint:
5276 duplication hint:
5277 error hint:
5278
5279              QUERY PLAN              
5280 -------------------------------------
5281  Bitmap Heap Scan on ti1
5282    Recheck Cond: (c1 = 1)
5283    Filter: (ctid = '(1,1)'::tid)
5284    ->  Bitmap Index Scan on ti1_uniq
5285          Index Cond: (c1 = 1)
5286 (5 rows)
5287
5288 -- No. S-3-13-8
5289 /*+BitmapScan(ti1 ti1_pkey)*/
5290 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5291 LOG:  candidate index for "ti1": ti1_pkey
5292 LOG:  pg_hint_plan:
5293 used hint:
5294 BitmapScan(ti1 ti1_pkey)
5295 not used hint:
5296 duplication hint:
5297 error hint:
5298
5299              QUERY PLAN              
5300 -------------------------------------
5301  Bitmap Heap Scan on ti1
5302    Recheck Cond: (c1 = 1)
5303    Filter: (ctid = '(1,1)'::tid)
5304    ->  Bitmap Index Scan on ti1_pkey
5305          Index Cond: (c1 = 1)
5306 (5 rows)
5307
5308 -- No. S-3-13-9
5309 /*+BitmapScan(ti1 ti1_pkey ti1_btree)*/
5310 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5311 LOG:  candidate index for "ti1": ti1_btree ti1_pkey
5312 LOG:  pg_hint_plan:
5313 used hint:
5314 BitmapScan(ti1 ti1_pkey ti1_btree)
5315 not used hint:
5316 duplication hint:
5317 error hint:
5318
5319               QUERY PLAN              
5320 --------------------------------------
5321  Bitmap Heap Scan on ti1
5322    Recheck Cond: (c1 = 1)
5323    Filter: (ctid = '(1,1)'::tid)
5324    ->  Bitmap Index Scan on ti1_btree
5325          Index Cond: (c1 = 1)
5326 (5 rows)
5327
5328 -- No. S-3-13-10
5329 /*+TidScan(ti1)*/
5330 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5331 LOG:  pg_hint_plan:
5332 used hint:
5333 TidScan(ti1)
5334 not used hint:
5335 duplication hint:
5336 error hint:
5337
5338             QUERY PLAN             
5339 -----------------------------------
5340  Tid Scan on ti1
5341    TID Cond: (ctid = '(1,1)'::tid)
5342    Filter: (c1 = 1)
5343 (3 rows)
5344
5345 -- No. S-3-13-11
5346 /*+TidScan(ti1 ti1_pkey)*/
5347 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5348 INFO:  hint syntax error at or near ""
5349 DETAIL:  TidScan hint accepts only one relation.
5350 LOG:  pg_hint_plan:
5351 used hint:
5352 not used hint:
5353 duplication hint:
5354 error hint:
5355 TidScan(ti1 ti1_pkey)
5356
5357             QUERY PLAN             
5358 -----------------------------------
5359  Tid Scan on ti1
5360    TID Cond: (ctid = '(1,1)'::tid)
5361    Filter: (c1 = 1)
5362 (3 rows)
5363
5364 -- No. S-3-13-12
5365 /*+TidScan(ti1 ti1_pkey ti1_btree)*/
5366 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5367 INFO:  hint syntax error at or near ""
5368 DETAIL:  TidScan hint accepts only one relation.
5369 LOG:  pg_hint_plan:
5370 used hint:
5371 not used hint:
5372 duplication hint:
5373 error hint:
5374 TidScan(ti1 ti1_pkey ti1_btree)
5375
5376             QUERY PLAN             
5377 -----------------------------------
5378  Tid Scan on ti1
5379    TID Cond: (ctid = '(1,1)'::tid)
5380    Filter: (c1 = 1)
5381 (3 rows)
5382
5383 -- No. S-3-13-13
5384 /*+NoSeqScan(ti1)*/
5385 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5386 LOG:  pg_hint_plan:
5387 used hint:
5388 NoSeqScan(ti1)
5389 not used hint:
5390 duplication hint:
5391 error hint:
5392
5393             QUERY PLAN             
5394 -----------------------------------
5395  Tid Scan on ti1
5396    TID Cond: (ctid = '(1,1)'::tid)
5397    Filter: (c1 = 1)
5398 (3 rows)
5399
5400 -- No. S-3-13-14
5401 /*+NoSeqScan(ti1 ti1_pkey)*/
5402 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5403 INFO:  hint syntax error at or near ""
5404 DETAIL:  NoSeqScan hint accepts only one relation.
5405 LOG:  pg_hint_plan:
5406 used hint:
5407 not used hint:
5408 duplication hint:
5409 error hint:
5410 NoSeqScan(ti1 ti1_pkey)
5411
5412             QUERY PLAN             
5413 -----------------------------------
5414  Tid Scan on ti1
5415    TID Cond: (ctid = '(1,1)'::tid)
5416    Filter: (c1 = 1)
5417 (3 rows)
5418
5419 -- No. S-3-13-15
5420 /*+NoSeqScan(ti1 ti1_pkey ti1_btree)*/
5421 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5422 INFO:  hint syntax error at or near ""
5423 DETAIL:  NoSeqScan hint accepts only one relation.
5424 LOG:  pg_hint_plan:
5425 used hint:
5426 not used hint:
5427 duplication hint:
5428 error hint:
5429 NoSeqScan(ti1 ti1_pkey ti1_btree)
5430
5431             QUERY PLAN             
5432 -----------------------------------
5433  Tid Scan on ti1
5434    TID Cond: (ctid = '(1,1)'::tid)
5435    Filter: (c1 = 1)
5436 (3 rows)
5437
5438 -- No. S-3-13-16
5439 /*+NoIndexScan(ti1)*/
5440 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5441 LOG:  pg_hint_plan:
5442 used hint:
5443 NoIndexScan(ti1)
5444 not used hint:
5445 duplication hint:
5446 error hint:
5447
5448             QUERY PLAN             
5449 -----------------------------------
5450  Tid Scan on ti1
5451    TID Cond: (ctid = '(1,1)'::tid)
5452    Filter: (c1 = 1)
5453 (3 rows)
5454
5455 -- No. S-3-13-17
5456 /*+NoIndexScan(ti1 ti1_pkey)*/
5457 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5458 INFO:  hint syntax error at or near ""
5459 DETAIL:  NoIndexScan hint accepts only one relation.
5460 LOG:  pg_hint_plan:
5461 used hint:
5462 not used hint:
5463 duplication hint:
5464 error hint:
5465 NoIndexScan(ti1 ti1_pkey)
5466
5467             QUERY PLAN             
5468 -----------------------------------
5469  Tid Scan on ti1
5470    TID Cond: (ctid = '(1,1)'::tid)
5471    Filter: (c1 = 1)
5472 (3 rows)
5473
5474 -- No. S-3-13-18
5475 /*+NoIndexScan(ti1 ti1_pkey ti1_btree)*/
5476 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5477 INFO:  hint syntax error at or near ""
5478 DETAIL:  NoIndexScan hint accepts only one relation.
5479 LOG:  pg_hint_plan:
5480 used hint:
5481 not used hint:
5482 duplication hint:
5483 error hint:
5484 NoIndexScan(ti1 ti1_pkey ti1_btree)
5485
5486             QUERY PLAN             
5487 -----------------------------------
5488  Tid Scan on ti1
5489    TID Cond: (ctid = '(1,1)'::tid)
5490    Filter: (c1 = 1)
5491 (3 rows)
5492
5493 -- No. S-3-13-19
5494 /*+NoBitmapScan(ti1)*/
5495 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5496 LOG:  pg_hint_plan:
5497 used hint:
5498 NoBitmapScan(ti1)
5499 not used hint:
5500 duplication hint:
5501 error hint:
5502
5503             QUERY PLAN             
5504 -----------------------------------
5505  Tid Scan on ti1
5506    TID Cond: (ctid = '(1,1)'::tid)
5507    Filter: (c1 = 1)
5508 (3 rows)
5509
5510 -- No. S-3-13-20
5511 /*+NoBitmapScan(ti1 ti1_pkey)*/
5512 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5513 INFO:  hint syntax error at or near ""
5514 DETAIL:  NoBitmapScan hint accepts only one relation.
5515 LOG:  pg_hint_plan:
5516 used hint:
5517 not used hint:
5518 duplication hint:
5519 error hint:
5520 NoBitmapScan(ti1 ti1_pkey)
5521
5522             QUERY PLAN             
5523 -----------------------------------
5524  Tid Scan on ti1
5525    TID Cond: (ctid = '(1,1)'::tid)
5526    Filter: (c1 = 1)
5527 (3 rows)
5528
5529 -- No. S-3-13-21
5530 /*+NoBitmapScan(ti1 ti1_pkey ti1_btree)*/
5531 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5532 INFO:  hint syntax error at or near ""
5533 DETAIL:  NoBitmapScan hint accepts only one relation.
5534 LOG:  pg_hint_plan:
5535 used hint:
5536 not used hint:
5537 duplication hint:
5538 error hint:
5539 NoBitmapScan(ti1 ti1_pkey ti1_btree)
5540
5541             QUERY PLAN             
5542 -----------------------------------
5543  Tid Scan on ti1
5544    TID Cond: (ctid = '(1,1)'::tid)
5545    Filter: (c1 = 1)
5546 (3 rows)
5547
5548 -- No. S-3-13-22
5549 /*+NoTidScan(ti1)*/
5550 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5551 LOG:  pg_hint_plan:
5552 used hint:
5553 NoTidScan(ti1)
5554 not used hint:
5555 duplication hint:
5556 error hint:
5557
5558             QUERY PLAN            
5559 ----------------------------------
5560  Index Scan using ti1_uniq on ti1
5561    Index Cond: (c1 = 1)
5562    Filter: (ctid = '(1,1)'::tid)
5563 (3 rows)
5564
5565 -- No. S-3-13-23
5566 /*+NoTidScan(ti1 ti1_pkey)*/
5567 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5568 INFO:  hint syntax error at or near ""
5569 DETAIL:  NoTidScan hint accepts only one relation.
5570 LOG:  pg_hint_plan:
5571 used hint:
5572 not used hint:
5573 duplication hint:
5574 error hint:
5575 NoTidScan(ti1 ti1_pkey)
5576
5577             QUERY PLAN             
5578 -----------------------------------
5579  Tid Scan on ti1
5580    TID Cond: (ctid = '(1,1)'::tid)
5581    Filter: (c1 = 1)
5582 (3 rows)
5583
5584 -- No. S-3-13-24
5585 /*+NoTidScan(ti1 ti1_pkey ti1_btree)*/
5586 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5587 INFO:  hint syntax error at or near ""
5588 DETAIL:  NoTidScan hint accepts only one relation.
5589 LOG:  pg_hint_plan:
5590 used hint:
5591 not used hint:
5592 duplication hint:
5593 error hint:
5594 NoTidScan(ti1 ti1_pkey ti1_btree)
5595
5596             QUERY PLAN             
5597 -----------------------------------
5598  Tid Scan on ti1
5599    TID Cond: (ctid = '(1,1)'::tid)
5600    Filter: (c1 = 1)
5601 (3 rows)
5602
5603 -- No. S-3-13-25
5604 /*+IndexOnlyScan(ti1)*/
5605 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
5606 LOG:  pg_hint_plan:
5607 used hint:
5608 IndexOnlyScan(ti1)
5609 not used hint:
5610 duplication hint:
5611 error hint:
5612
5613               QUERY PLAN               
5614 ---------------------------------------
5615  Index Only Scan using ti1_uniq on ti1
5616    Index Cond: (c1 >= 1)
5617 (2 rows)
5618
5619 -- No. S-3-13-26
5620 /*+IndexOnlyScan(ti1 ti1_pkey)*/
5621 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
5622 LOG:  candidate index for "ti1": ti1_pkey
5623 LOG:  pg_hint_plan:
5624 used hint:
5625 IndexOnlyScan(ti1 ti1_pkey)
5626 not used hint:
5627 duplication hint:
5628 error hint:
5629
5630               QUERY PLAN               
5631 ---------------------------------------
5632  Index Only Scan using ti1_pkey on ti1
5633    Index Cond: (c1 >= 1)
5634 (2 rows)
5635
5636 -- No. S-3-13-27
5637 /*+IndexOnlyScan(ti1 ti1_pkey ti1_btree)*/
5638 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
5639 LOG:  candidate index for "ti1": ti1_btree ti1_pkey
5640 LOG:  pg_hint_plan:
5641 used hint:
5642 IndexOnlyScan(ti1 ti1_pkey ti1_btree)
5643 not used hint:
5644 duplication hint:
5645 error hint:
5646
5647                QUERY PLAN               
5648 ----------------------------------------
5649  Index Only Scan using ti1_btree on ti1
5650    Index Cond: (c1 >= 1)
5651 (2 rows)
5652
5653 -- No. S-3-13-28
5654 /*+NoIndexOnlyScan(ti1)*/
5655 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
5656 LOG:  pg_hint_plan:
5657 used hint:
5658 NoIndexOnlyScan(ti1)
5659 not used hint:
5660 duplication hint:
5661 error hint:
5662
5663             QUERY PLAN            
5664 ----------------------------------
5665  Index Scan using ti1_uniq on ti1
5666    Index Cond: (c1 = 1)
5667 (2 rows)
5668
5669 -- No. S-3-13-29
5670 /*+NoIndexOnlyScan(ti1 ti1_pkey)*/
5671 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
5672 INFO:  hint syntax error at or near ""
5673 DETAIL:  NoIndexOnlyScan hint accepts only one relation.
5674 LOG:  pg_hint_plan:
5675 used hint:
5676 not used hint:
5677 duplication hint:
5678 error hint:
5679 NoIndexOnlyScan(ti1 ti1_pkey)
5680
5681               QUERY PLAN               
5682 ---------------------------------------
5683  Index Only Scan using ti1_uniq on ti1
5684    Index Cond: (c1 = 1)
5685 (2 rows)
5686
5687 -- No. S-3-13-30
5688 /*+NoIndexOnlyScan(ti1 ti1_pkey ti1_btree)*/
5689 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
5690 INFO:  hint syntax error at or near ""
5691 DETAIL:  NoIndexOnlyScan hint accepts only one relation.
5692 LOG:  pg_hint_plan:
5693 used hint:
5694 not used hint:
5695 duplication hint:
5696 error hint:
5697 NoIndexOnlyScan(ti1 ti1_pkey ti1_btree)
5698
5699               QUERY PLAN               
5700 ---------------------------------------
5701  Index Only Scan using ti1_uniq on ti1
5702    Index Cond: (c1 = 1)
5703 (2 rows)
5704