OSDN Git Service

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