OSDN Git Service

Aの試験の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 complexity query block
623 ----
624 -- No. S-2-1-1
625 EXPLAIN (COSTS false)
626 SELECT max(bmt1.c1), (
627 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
628 )
629                     FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
630 ;
631                             QUERY PLAN                             
632 -------------------------------------------------------------------
633  Aggregate
634    InitPlan 1 (returns $0)
635      ->  Aggregate
636            ->  Merge Join
637                  Merge Cond: (b1t1.c1 = b1t2.c1)
638                  ->  Merge Join
639                        Merge Cond: (b1t1.c1 = b1t4.c1)
640                        ->  Merge Join
641                              Merge Cond: (b1t1.c1 = b1t3.c1)
642                              ->  Index Scan using t1_i1 on t1 b1t1
643                              ->  Index Scan using t3_i1 on t3 b1t3
644                        ->  Index Scan using t4_i1 on t4 b1t4
645                  ->  Sort
646                        Sort Key: b1t2.c1
647                        ->  Seq Scan on t2 b1t2
648    ->  Merge Join
649          Merge Cond: (bmt1.c1 = bmt2.c1)
650          ->  Merge Join
651                Merge Cond: (bmt1.c1 = bmt4.c1)
652                ->  Merge Join
653                      Merge Cond: (bmt1.c1 = bmt3.c1)
654                      ->  Index Scan using t1_i1 on t1 bmt1
655                      ->  Index Scan using t3_i1 on t3 bmt3
656                ->  Index Scan using t4_i1 on t4 bmt4
657          ->  Sort
658                Sort Key: bmt2.c1
659                ->  Seq Scan on t2 bmt2
660 (27 rows)
661
662 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
663 TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
664 */
665 EXPLAIN (COSTS false)
666 SELECT max(bmt1.c1), (
667 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
668 )
669                     FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
670 ;
671 LOG:  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 definition table
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 ----
2866 ---- No. S-2-4 VALUES clause
2867 ----
2868 -- No. S-2-4-1
2869 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1) WHERE t1.c1 = 1;
2870         QUERY PLAN         
2871 ---------------------------
2872  Values Scan on "*VALUES*"
2873    Filter: (column1 = 1)
2874 (2 rows)
2875
2876 /*+SeqScan(t1)*/
2877 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1) WHERE t1.c1 = 1;
2878 LOG:  pg_hint_plan:
2879 used hint:
2880 not used hint:
2881 SeqScan(t1)
2882 duplication hint:
2883 error hint:
2884
2885         QUERY PLAN         
2886 ---------------------------
2887  Values Scan on "*VALUES*"
2888    Filter: (column1 = 1)
2889 (2 rows)
2890
2891 /*+SeqScan(*VALUES*)*/
2892 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1) WHERE t1.c1 = 1;
2893 LOG:  pg_hint_plan:
2894 used hint:
2895 not used hint:
2896 SeqScan(*VALUES*)
2897 duplication hint:
2898 error hint:
2899
2900         QUERY PLAN         
2901 ---------------------------
2902  Values Scan on "*VALUES*"
2903    Filter: (column1 = 1)
2904 (2 rows)
2905
2906 -- No. S-2-4-2
2907 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;
2908                         QUERY PLAN                        
2909 ----------------------------------------------------------
2910  Nested Loop
2911    Join Filter: ("*VALUES*".column1 = "*VALUES*".column1)
2912    ->  Values Scan on "*VALUES*"
2913    ->  Values Scan on "*VALUES*"
2914 (4 rows)
2915
2916 /*+SeqScan(t1 t2)*/
2917 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;
2918 INFO:  hint syntax error at or near ""
2919 DETAIL:  SeqScan hint accepts only one relation.
2920 LOG:  pg_hint_plan:
2921 used hint:
2922 not used hint:
2923 duplication hint:
2924 error hint:
2925 SeqScan(t1 t2)
2926
2927                         QUERY PLAN                        
2928 ----------------------------------------------------------
2929  Nested Loop
2930    Join Filter: ("*VALUES*".column1 = "*VALUES*".column1)
2931    ->  Values Scan on "*VALUES*"
2932    ->  Values Scan on "*VALUES*"
2933 (4 rows)
2934
2935 /*+SeqScan(*VALUES*)*/
2936 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;
2937 LOG:  pg_hint_plan:
2938 used hint:
2939 not used hint:
2940 SeqScan(*VALUES*)
2941 duplication hint:
2942 error hint:
2943
2944                         QUERY PLAN                        
2945 ----------------------------------------------------------
2946  Nested Loop
2947    Join Filter: ("*VALUES*".column1 = "*VALUES*".column1)
2948    ->  Values Scan on "*VALUES*"
2949    ->  Values Scan on "*VALUES*"
2950 (4 rows)
2951
2952 ----
2953 ---- No. S-3-1 scan method hint
2954 ----
2955 -- No. S-3-1-1
2956 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
2957      QUERY PLAN      
2958 ---------------------
2959  Seq Scan on t1
2960    Filter: (c1 >= 1)
2961 (2 rows)
2962
2963 /*+SeqScan(t1)*/
2964 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
2965 LOG:  pg_hint_plan:
2966 used hint:
2967 SeqScan(t1)
2968 not used hint:
2969 duplication hint:
2970 error hint:
2971
2972      QUERY PLAN      
2973 ---------------------
2974  Seq Scan on t1
2975    Filter: (c1 >= 1)
2976 (2 rows)
2977
2978 -- No. S-3-1-2
2979 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2980           QUERY PLAN          
2981 ------------------------------
2982  Index Scan using t1_i1 on t1
2983    Index Cond: (c1 = 1)
2984 (2 rows)
2985
2986 /*+SeqScan(t1)*/
2987 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2988 LOG:  pg_hint_plan:
2989 used hint:
2990 SeqScan(t1)
2991 not used hint:
2992 duplication hint:
2993 error hint:
2994
2995      QUERY PLAN     
2996 --------------------
2997  Seq Scan on t1
2998    Filter: (c1 = 1)
2999 (2 rows)
3000
3001 -- No. S-3-1-3
3002 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3003           QUERY PLAN          
3004 ------------------------------
3005  Index Scan using t1_i1 on t1
3006    Index Cond: (c1 = 1)
3007 (2 rows)
3008
3009 /*+IndexScan(t1)*/
3010 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3011 LOG:  pg_hint_plan:
3012 used hint:
3013 IndexScan(t1)
3014 not used hint:
3015 duplication hint:
3016 error hint:
3017
3018           QUERY PLAN          
3019 ------------------------------
3020  Index Scan using t1_i1 on t1
3021    Index Cond: (c1 = 1)
3022 (2 rows)
3023
3024 -- No. S-3-1-4
3025 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3026      QUERY PLAN      
3027 ---------------------
3028  Seq Scan on t1
3029    Filter: (c1 >= 1)
3030 (2 rows)
3031
3032 /*+IndexScan(t1)*/
3033 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3034 LOG:  pg_hint_plan:
3035 used hint:
3036 IndexScan(t1)
3037 not used hint:
3038 duplication hint:
3039 error hint:
3040
3041           QUERY PLAN          
3042 ------------------------------
3043  Index Scan using t1_i1 on t1
3044    Index Cond: (c1 >= 1)
3045 (2 rows)
3046
3047 -- No. S-3-1-5
3048 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
3049            QUERY PLAN            
3050 ---------------------------------
3051  Bitmap Heap Scan on t1
3052    Recheck Cond: (c3 < 10)
3053    ->  Bitmap Index Scan on t1_i
3054          Index Cond: (c3 < 10)
3055 (4 rows)
3056
3057 /*+BitmapScan(t1)*/
3058 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
3059 LOG:  pg_hint_plan:
3060 used hint:
3061 BitmapScan(t1)
3062 not used hint:
3063 duplication hint:
3064 error hint:
3065
3066            QUERY PLAN            
3067 ---------------------------------
3068  Bitmap Heap Scan on t1
3069    Recheck Cond: (c3 < 10)
3070    ->  Bitmap Index Scan on t1_i
3071          Index Cond: (c3 < 10)
3072 (4 rows)
3073
3074 -- No. S-3-1-6
3075 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3076           QUERY PLAN          
3077 ------------------------------
3078  Index Scan using t1_i1 on t1
3079    Index Cond: (c1 = 1)
3080 (2 rows)
3081
3082 /*+BitmapScan(t1)*/
3083 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3084 LOG:  pg_hint_plan:
3085 used hint:
3086 BitmapScan(t1)
3087 not used hint:
3088 duplication hint:
3089 error hint:
3090
3091             QUERY PLAN            
3092 ----------------------------------
3093  Bitmap Heap Scan on t1
3094    Recheck Cond: (c1 = 1)
3095    ->  Bitmap Index Scan on t1_i1
3096          Index Cond: (c1 = 1)
3097 (4 rows)
3098
3099 -- No. S-3-1-7
3100 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3101             QUERY PLAN             
3102 -----------------------------------
3103  Tid Scan on t1
3104    TID Cond: (ctid = '(1,1)'::tid)
3105    Filter: (c1 = 1)
3106 (3 rows)
3107
3108 /*+TidScan(t1)*/
3109 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3110 LOG:  pg_hint_plan:
3111 used hint:
3112 TidScan(t1)
3113 not used hint:
3114 duplication hint:
3115 error hint:
3116
3117             QUERY PLAN             
3118 -----------------------------------
3119  Tid Scan on t1
3120    TID Cond: (ctid = '(1,1)'::tid)
3121    Filter: (c1 = 1)
3122 (3 rows)
3123
3124 -- No. S-3-1-8
3125 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid IN ('(1,1)', '(2,2)', '(3,3)');
3126                          QUERY PLAN                          
3127 -------------------------------------------------------------
3128  Index Scan using t1_i1 on t1
3129    Index Cond: (c1 = 1)
3130    Filter: (ctid = ANY ('{"(1,1)","(2,2)","(3,3)"}'::tid[]))
3131 (3 rows)
3132
3133 /*+TidScan(t1)*/
3134 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid IN ('(1,1)', '(2,2)', '(3,3)');
3135 LOG:  pg_hint_plan:
3136 used hint:
3137 TidScan(t1)
3138 not used hint:
3139 duplication hint:
3140 error hint:
3141
3142                           QUERY PLAN                           
3143 ---------------------------------------------------------------
3144  Tid Scan on t1
3145    TID Cond: (ctid = ANY ('{"(1,1)","(2,2)","(3,3)"}'::tid[]))
3146    Filter: (c1 = 1)
3147 (3 rows)
3148
3149 -- No. S-3-1-9
3150 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3151      QUERY PLAN      
3152 ---------------------
3153  Seq Scan on t1
3154    Filter: (c1 >= 1)
3155 (2 rows)
3156
3157 /*+NoSeqScan(t1)*/
3158 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3159 LOG:  pg_hint_plan:
3160 used hint:
3161 NoSeqScan(t1)
3162 not used hint:
3163 duplication hint:
3164 error hint:
3165
3166           QUERY PLAN          
3167 ------------------------------
3168  Index Scan using t1_i1 on t1
3169    Index Cond: (c1 >= 1)
3170 (2 rows)
3171
3172 -- No. S-3-1-10
3173 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3174           QUERY PLAN          
3175 ------------------------------
3176  Index Scan using t1_i1 on t1
3177    Index Cond: (c1 = 1)
3178 (2 rows)
3179
3180 /*+NoSeqScan(t1)*/
3181 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3182 LOG:  pg_hint_plan:
3183 used hint:
3184 NoSeqScan(t1)
3185 not used hint:
3186 duplication hint:
3187 error hint:
3188
3189           QUERY PLAN          
3190 ------------------------------
3191  Index Scan using t1_i1 on t1
3192    Index Cond: (c1 = 1)
3193 (2 rows)
3194
3195 -- No. S-3-1-11
3196 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3197           QUERY PLAN          
3198 ------------------------------
3199  Index Scan using t1_i1 on t1
3200    Index Cond: (c1 = 1)
3201 (2 rows)
3202
3203 /*+NoIndexScan(t1)*/
3204 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3205 LOG:  pg_hint_plan:
3206 used hint:
3207 NoIndexScan(t1)
3208 not used hint:
3209 duplication hint:
3210 error hint:
3211
3212             QUERY PLAN            
3213 ----------------------------------
3214  Bitmap Heap Scan on t1
3215    Recheck Cond: (c1 = 1)
3216    ->  Bitmap Index Scan on t1_i1
3217          Index Cond: (c1 = 1)
3218 (4 rows)
3219
3220 -- No. S-3-1-12
3221 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3222      QUERY PLAN      
3223 ---------------------
3224  Seq Scan on t1
3225    Filter: (c1 >= 1)
3226 (2 rows)
3227
3228 /*+NoIndexScan(t1)*/
3229 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3230 LOG:  pg_hint_plan:
3231 used hint:
3232 NoIndexScan(t1)
3233 not used hint:
3234 duplication hint:
3235 error hint:
3236
3237      QUERY PLAN      
3238 ---------------------
3239  Seq Scan on t1
3240    Filter: (c1 >= 1)
3241 (2 rows)
3242
3243 -- No. S-3-1-13
3244 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
3245            QUERY PLAN            
3246 ---------------------------------
3247  Bitmap Heap Scan on t1
3248    Recheck Cond: (c3 < 10)
3249    ->  Bitmap Index Scan on t1_i
3250          Index Cond: (c3 < 10)
3251 (4 rows)
3252
3253 /*+NoBitmapScan(t1)*/
3254 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
3255 LOG:  pg_hint_plan:
3256 used hint:
3257 NoBitmapScan(t1)
3258 not used hint:
3259 duplication hint:
3260 error hint:
3261
3262      QUERY PLAN      
3263 ---------------------
3264  Seq Scan on t1
3265    Filter: (c3 < 10)
3266 (2 rows)
3267
3268 -- No. S-3-1-14
3269 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3270           QUERY PLAN          
3271 ------------------------------
3272  Index Scan using t1_i1 on t1
3273    Index Cond: (c1 = 1)
3274 (2 rows)
3275
3276 /*+NoBitmapScan(t1)*/
3277 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3278 LOG:  pg_hint_plan:
3279 used hint:
3280 NoBitmapScan(t1)
3281 not used hint:
3282 duplication hint:
3283 error hint:
3284
3285           QUERY PLAN          
3286 ------------------------------
3287  Index Scan using t1_i1 on t1
3288    Index Cond: (c1 = 1)
3289 (2 rows)
3290
3291 -- No. S-3-1-15
3292 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3293             QUERY PLAN             
3294 -----------------------------------
3295  Tid Scan on t1
3296    TID Cond: (ctid = '(1,1)'::tid)
3297    Filter: (c1 = 1)
3298 (3 rows)
3299
3300 /*+NoTidScan(t1)*/
3301 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3302 LOG:  pg_hint_plan:
3303 used hint:
3304 NoTidScan(t1)
3305 not used hint:
3306 duplication hint:
3307 error hint:
3308
3309            QUERY PLAN            
3310 ---------------------------------
3311  Index Scan using t1_i1 on t1
3312    Index Cond: (c1 = 1)
3313    Filter: (ctid = '(1,1)'::tid)
3314 (3 rows)
3315
3316 -- No. S-3-1-16
3317 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3318           QUERY PLAN          
3319 ------------------------------
3320  Index Scan using t1_i1 on t1
3321    Index Cond: (c1 = 1)
3322 (2 rows)
3323
3324 /*+NoTidScan(t1)*/
3325 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3326 LOG:  pg_hint_plan:
3327 used hint:
3328 NoTidScan(t1)
3329 not used hint:
3330 duplication hint:
3331 error hint:
3332
3333           QUERY PLAN          
3334 ------------------------------
3335  Index Scan using t1_i1 on t1
3336    Index Cond: (c1 = 1)
3337 (2 rows)
3338
3339 -- No. S-3-1-17
3340 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
3341           QUERY PLAN          
3342 ------------------------------
3343  Index Scan using t1_i1 on t1
3344    Index Cond: (c1 = 1)
3345 (2 rows)
3346
3347 /*+IndexOnlyScan(t1)*/
3348 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
3349 INFO:  hint syntax error at or near "IndexOnlyScan(t1)"
3350 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
3351           QUERY PLAN          
3352 ------------------------------
3353  Index Scan using t1_i1 on t1
3354    Index Cond: (c1 = 1)
3355 (2 rows)
3356
3357 -- No. S-3-1-18
3358 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 >= 1;
3359      QUERY PLAN      
3360 ---------------------
3361  Seq Scan on t1
3362    Filter: (c1 >= 1)
3363 (2 rows)
3364
3365 /*+IndexOnlyScan(t1)*/
3366 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 >= 1;
3367 INFO:  hint syntax error at or near "IndexOnlyScan(t1)"
3368 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
3369      QUERY PLAN      
3370 ---------------------
3371  Seq Scan on t1
3372    Filter: (c1 >= 1)
3373 (2 rows)
3374
3375 -- No. S-3-1-19
3376 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
3377           QUERY PLAN          
3378 ------------------------------
3379  Index Scan using t1_i1 on t1
3380    Index Cond: (c1 = 1)
3381 (2 rows)
3382
3383 /*+NoIndexOnlyScan(t1)*/
3384 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
3385 INFO:  hint syntax error at or near "NoIndexOnlyScan(t1)"
3386 DETAIL:  Unrecognized hint keyword "NoIndexOnlyScan".
3387           QUERY PLAN          
3388 ------------------------------
3389  Index Scan using t1_i1 on t1
3390    Index Cond: (c1 = 1)
3391 (2 rows)
3392
3393 -- No. S-3-1-20
3394 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 >= 1;
3395      QUERY PLAN      
3396 ---------------------
3397  Seq Scan on t1
3398    Filter: (c1 >= 1)
3399 (2 rows)
3400
3401 /*+NoIndexOnlyScan(t1)*/
3402 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 >= 1;
3403 INFO:  hint syntax error at or near "NoIndexOnlyScan(t1)"
3404 DETAIL:  Unrecognized hint keyword "NoIndexOnlyScan".
3405      QUERY PLAN      
3406 ---------------------
3407  Seq Scan on t1
3408    Filter: (c1 >= 1)
3409 (2 rows)
3410
3411 ----
3412 ---- No. S-3-3 index name specified
3413 ----
3414 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3415             QUERY PLAN             
3416 -----------------------------------
3417  Tid Scan on ti1
3418    TID Cond: (ctid = '(1,1)'::tid)
3419    Filter: (c2 = 1)
3420 (3 rows)
3421
3422 SET enable_tidscan TO off;
3423 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3424            QUERY PLAN            
3425 ---------------------------------
3426  Index Scan using ti1_i2 on ti1
3427    Index Cond: (c2 = 1)
3428    Filter: (ctid = '(1,1)'::tid)
3429 (3 rows)
3430
3431 SET enable_indexscan TO off;
3432 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3433             QUERY PLAN             
3434 -----------------------------------
3435  Bitmap Heap Scan on ti1
3436    Recheck Cond: (c2 = 1)
3437    Filter: (ctid = '(1,1)'::tid)
3438    ->  Bitmap Index Scan on ti1_i2
3439          Index Cond: (c2 = 1)
3440 (5 rows)
3441
3442 RESET enable_tidscan;
3443 RESET enable_indexscan;
3444 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE ti1.c2 >= 1;
3445      QUERY PLAN      
3446 ---------------------
3447  Seq Scan on ti1
3448    Filter: (c2 >= 1)
3449 (2 rows)
3450
3451 -- No. S-3-3-1
3452 /*+IndexScan(ti1 ti1_i3)*/
3453 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3454 LOG:  available indexes for IndexScan(ti1): ti1_i3
3455 LOG:  pg_hint_plan:
3456 used hint:
3457 IndexScan(ti1 ti1_i3)
3458 not used hint:
3459 duplication hint:
3460 error hint:
3461
3462            QUERY PLAN            
3463 ---------------------------------
3464  Index Scan using ti1_i3 on ti1
3465    Index Cond: (c2 = 1)
3466    Filter: (ctid = '(1,1)'::tid)
3467 (3 rows)
3468
3469 -- No. S-3-3-2
3470 /*+IndexScan(ti1 ti1_i3 ti1_i2)*/
3471 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3472 LOG:  available indexes for IndexScan(ti1): ti1_i3 ti1_i2
3473 LOG:  pg_hint_plan:
3474 used hint:
3475 IndexScan(ti1 ti1_i3 ti1_i2)
3476 not used hint:
3477 duplication hint:
3478 error hint:
3479
3480            QUERY PLAN            
3481 ---------------------------------
3482  Index Scan using ti1_i2 on ti1
3483    Index Cond: (c2 = 1)
3484    Filter: (ctid = '(1,1)'::tid)
3485 (3 rows)
3486
3487 -- No. S-3-3-3
3488 /*+IndexScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)*/
3489 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3490 LOG:  available indexes for IndexScan(ti1): ti1_i4 ti1_i3 ti1_i2 ti1_i1
3491 LOG:  pg_hint_plan:
3492 used hint:
3493 IndexScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)
3494 not used hint:
3495 duplication hint:
3496 error hint:
3497
3498            QUERY PLAN            
3499 ---------------------------------
3500  Index Scan using ti1_i2 on ti1
3501    Index Cond: (c2 = 1)
3502    Filter: (ctid = '(1,1)'::tid)
3503 (3 rows)
3504
3505 -- No. S-3-3-4
3506 /*+BitmapScan(ti1 ti1_i3)*/
3507 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3508 LOG:  available indexes for BitmapScan(ti1): ti1_i3
3509 LOG:  pg_hint_plan:
3510 used hint:
3511 BitmapScan(ti1 ti1_i3)
3512 not used hint:
3513 duplication hint:
3514 error hint:
3515
3516             QUERY PLAN             
3517 -----------------------------------
3518  Bitmap Heap Scan on ti1
3519    Recheck Cond: (c2 = 1)
3520    Filter: (ctid = '(1,1)'::tid)
3521    ->  Bitmap Index Scan on ti1_i3
3522          Index Cond: (c2 = 1)
3523 (5 rows)
3524
3525 -- No. S-3-3-5
3526 /*+BitmapScan(ti1 ti1_i3 ti1_i2)*/
3527 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3528 LOG:  available indexes for BitmapScan(ti1): ti1_i3 ti1_i2
3529 LOG:  pg_hint_plan:
3530 used hint:
3531 BitmapScan(ti1 ti1_i3 ti1_i2)
3532 not used hint:
3533 duplication hint:
3534 error hint:
3535
3536             QUERY PLAN             
3537 -----------------------------------
3538  Bitmap Heap Scan on ti1
3539    Recheck Cond: (c2 = 1)
3540    Filter: (ctid = '(1,1)'::tid)
3541    ->  Bitmap Index Scan on ti1_i2
3542          Index Cond: (c2 = 1)
3543 (5 rows)
3544
3545 -- No. S-3-3-6
3546 /*+BitmapScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)*/
3547 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3548 LOG:  available indexes for BitmapScan(ti1): ti1_i4 ti1_i3 ti1_i2 ti1_i1
3549 LOG:  pg_hint_plan:
3550 used hint:
3551 BitmapScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)
3552 not used hint:
3553 duplication hint:
3554 error hint:
3555
3556             QUERY PLAN             
3557 -----------------------------------
3558  Bitmap Heap Scan on ti1
3559    Recheck Cond: (c2 = 1)
3560    Filter: (ctid = '(1,1)'::tid)
3561    ->  Bitmap Index Scan on ti1_i2
3562          Index Cond: (c2 = 1)
3563 (5 rows)
3564
3565 -- No. S-3-3-7
3566 /*+IndexOnlyScan(ti1 ti1_i3)*/
3567 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE ti1.c2 >= 1;
3568 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_i3)"
3569 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
3570      QUERY PLAN      
3571 ---------------------
3572  Seq Scan on ti1
3573    Filter: (c2 >= 1)
3574 (2 rows)
3575
3576 -- No. S-3-3-8
3577 /*+IndexOnlyScan(ti1 ti1_i3 ti1_i2)*/
3578 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE ti1.c2 >= 1;
3579 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_i3 ti1_i2)"
3580 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
3581      QUERY PLAN      
3582 ---------------------
3583  Seq Scan on ti1
3584    Filter: (c2 >= 1)
3585 (2 rows)
3586
3587 -- No. S-3-3-9
3588 /*+IndexOnlyScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)*/
3589 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE ti1.c2 >= 1;
3590 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)"
3591 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
3592      QUERY PLAN      
3593 ---------------------
3594  Seq Scan on ti1
3595    Filter: (c2 >= 1)
3596 (2 rows)
3597
3598 ----
3599 ---- No. S-3-4 index type
3600 ----
3601 \d s1.ti1
3602         Table "s1.ti1"
3603  Column |  Type   | Modifiers 
3604 --------+---------+-----------
3605  c1     | integer | not null
3606  c2     | integer | 
3607  c3     | integer | 
3608  c4     | text    | 
3609 Indexes:
3610     "ti1_pkey" PRIMARY KEY, btree (c1)
3611     "ti1_c2_key" UNIQUE CONSTRAINT, btree (c2)
3612     "ti1_uniq" UNIQUE, btree (c1)
3613     "ti1_btree" btree (c1)
3614     "ti1_expr" btree ((c1 < 100))
3615     "ti1_gin" gin (c1)
3616     "ti1_gist" gist (c1)
3617     "ti1_hash" hash (c1)
3618     "ti1_i1" btree (c2)
3619     "ti1_i2" btree (c2, c4)
3620     "ti1_i3" btree (c2, c4, c4)
3621     "ti1_i4" btree (c2, c4, c4, c4)
3622     "ti1_multi" btree (c1, c2, c3, c4)
3623     "ti1_pred" btree (lower(c4))
3624     "ti1_ts" gin (to_tsvector('english'::regconfig, c4))
3625
3626 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)';
3627                                                                QUERY PLAN                                                                
3628 -----------------------------------------------------------------------------------------------------------------------------------------
3629  Tid Scan on ti1
3630    TID Cond: (ctid = '(1,1)'::tid)
3631    Filter: ((c1 < 100) AND (c2 = 1) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3632 (3 rows)
3633
3634 -- No. S-3-4-1
3635 /*+IndexScan(ti1 ti1_btree)*/
3636 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)';
3637 LOG:  available indexes for IndexScan(ti1): ti1_btree
3638 LOG:  pg_hint_plan:
3639 used hint:
3640 IndexScan(ti1 ti1_btree)
3641 not used hint:
3642 duplication hint:
3643 error hint:
3644
3645                                                                      QUERY PLAN                                                                     
3646 ----------------------------------------------------------------------------------------------------------------------------------------------------
3647  Index Scan using ti1_btree on ti1
3648    Index Cond: (c1 < 100)
3649    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3650 (3 rows)
3651
3652 -- No. S-3-4-2
3653 /*+IndexScan(ti1 ti1_hash)*/
3654 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3655 LOG:  available indexes for IndexScan(ti1): ti1_hash
3656 LOG:  pg_hint_plan:
3657 used hint:
3658 IndexScan(ti1 ti1_hash)
3659 not used hint:
3660 duplication hint:
3661 error hint:
3662
3663                                                                      QUERY PLAN                                                                     
3664 ----------------------------------------------------------------------------------------------------------------------------------------------------
3665  Index Scan using ti1_hash on ti1
3666    Index Cond: (c1 = 100)
3667    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3668 (3 rows)
3669
3670 -- No. S-3-4-3
3671 /*+IndexScan(ti1 ti1_gist)*/
3672 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)';
3673 LOG:  available indexes for IndexScan(ti1): ti1_gist
3674 LOG:  pg_hint_plan:
3675 used hint:
3676 IndexScan(ti1 ti1_gist)
3677 not used hint:
3678 duplication hint:
3679 error hint:
3680
3681                                                                      QUERY PLAN                                                                     
3682 ----------------------------------------------------------------------------------------------------------------------------------------------------
3683  Index Scan using ti1_gist on ti1
3684    Index Cond: (c1 < 100)
3685    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3686 (3 rows)
3687
3688 -- No. S-3-4-4
3689 /*+IndexScan(ti1 ti1_gin)*/
3690 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)';
3691 LOG:  available indexes for IndexScan(ti1): ti1_gin
3692 LOG:  pg_hint_plan:
3693 used hint:
3694 IndexScan(ti1 ti1_gin)
3695 not used hint:
3696 duplication hint:
3697 error hint:
3698
3699                                                                QUERY PLAN                                                                
3700 -----------------------------------------------------------------------------------------------------------------------------------------
3701  Tid Scan on ti1
3702    TID Cond: (ctid = '(1,1)'::tid)
3703    Filter: ((c1 < 100) AND (c2 = 1) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3704 (3 rows)
3705
3706 -- No. S-3-4-5
3707 /*+IndexScan(ti1 ti1_expr)*/
3708 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)';
3709 LOG:  available indexes for IndexScan(ti1): ti1_expr
3710 LOG:  pg_hint_plan:
3711 used hint:
3712 IndexScan(ti1 ti1_expr)
3713 not used hint:
3714 duplication hint:
3715 error hint:
3716
3717                                                                             QUERY PLAN                                                                             
3718 -------------------------------------------------------------------------------------------------------------------------------------------------------------------
3719  Index Scan using ti1_expr on ti1
3720    Index Cond: ((c1 < 100) = true)
3721    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))
3722 (3 rows)
3723
3724 -- No. S-3-4-6
3725 /*+IndexScan(ti1 ti1_pred)*/
3726 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)';
3727 LOG:  available indexes for IndexScan(ti1): ti1_pred
3728 LOG:  pg_hint_plan:
3729 used hint:
3730 IndexScan(ti1 ti1_pred)
3731 not used hint:
3732 duplication hint:
3733 error hint:
3734
3735                                                               QUERY PLAN                                                               
3736 ---------------------------------------------------------------------------------------------------------------------------------------
3737  Index Scan using ti1_pred on ti1
3738    Index Cond: (lower(c4) = '1'::text)
3739    Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
3740 (3 rows)
3741
3742 -- No. S-3-4-7
3743 /*+IndexScan(ti1 ti1_uniq)*/
3744 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)';
3745 LOG:  available indexes for IndexScan(ti1): ti1_uniq
3746 LOG:  pg_hint_plan:
3747 used hint:
3748 IndexScan(ti1 ti1_uniq)
3749 not used hint:
3750 duplication hint:
3751 error hint:
3752
3753                                                                      QUERY PLAN                                                                     
3754 ----------------------------------------------------------------------------------------------------------------------------------------------------
3755  Index Scan using ti1_uniq on ti1
3756    Index Cond: (c1 < 100)
3757    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3758 (3 rows)
3759
3760 -- No. S-3-4-8
3761 /*+IndexScan(ti1 ti1_multi)*/
3762 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)';
3763 LOG:  available indexes for IndexScan(ti1): ti1_multi
3764 LOG:  pg_hint_plan:
3765 used hint:
3766 IndexScan(ti1 ti1_multi)
3767 not used hint:
3768 duplication hint:
3769 error hint:
3770
3771                                                               QUERY PLAN                                                               
3772 ---------------------------------------------------------------------------------------------------------------------------------------
3773  Index Scan using ti1_multi on ti1
3774    Index Cond: ((c1 < 100) AND (c2 = 1))
3775    Filter: ((ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3776 (3 rows)
3777
3778 -- No. S-3-4-9
3779 /*+IndexScan(ti1 ti1_ts)*/
3780 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)';
3781 LOG:  available indexes for IndexScan(ti1): ti1_ts
3782 LOG:  pg_hint_plan:
3783 used hint:
3784 IndexScan(ti1 ti1_ts)
3785 not used hint:
3786 duplication hint:
3787 error hint:
3788
3789                                                                QUERY PLAN                                                                
3790 -----------------------------------------------------------------------------------------------------------------------------------------
3791  Tid Scan on ti1
3792    TID Cond: (ctid = '(1,1)'::tid)
3793    Filter: ((c1 < 100) AND (c2 = 1) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3794 (3 rows)
3795
3796 -- No. S-3-4-10
3797 /*+IndexScan(ti1 ti1_pkey)*/
3798 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)';
3799 LOG:  available indexes for IndexScan(ti1): ti1_pkey
3800 LOG:  pg_hint_plan:
3801 used hint:
3802 IndexScan(ti1 ti1_pkey)
3803 not used hint:
3804 duplication hint:
3805 error hint:
3806
3807                                                                      QUERY PLAN                                                                     
3808 ----------------------------------------------------------------------------------------------------------------------------------------------------
3809  Index Scan using ti1_pkey on ti1
3810    Index Cond: (c1 < 100)
3811    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3812 (3 rows)
3813
3814 -- No. S-3-4-11
3815 /*+IndexScan(ti1 ti1_c2_key)*/
3816 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)';
3817 LOG:  available indexes for IndexScan(ti1): ti1_c2_key
3818 LOG:  pg_hint_plan:
3819 used hint:
3820 IndexScan(ti1 ti1_c2_key)
3821 not used hint:
3822 duplication hint:
3823 error hint:
3824
3825                                                                       QUERY PLAN                                                                      
3826 ------------------------------------------------------------------------------------------------------------------------------------------------------
3827  Index Scan using ti1_c2_key on ti1
3828    Index Cond: (c2 = 1)
3829    Filter: ((c1 < 100) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3830 (3 rows)
3831
3832 -- No. S-3-4-12
3833 /*+BitmapScan(ti1 ti1_btree)*/
3834 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)';
3835 LOG:  available indexes for BitmapScan(ti1): ti1_btree
3836 LOG:  pg_hint_plan:
3837 used hint:
3838 BitmapScan(ti1 ti1_btree)
3839 not used hint:
3840 duplication hint:
3841 error hint:
3842
3843                                                                      QUERY PLAN                                                                     
3844 ----------------------------------------------------------------------------------------------------------------------------------------------------
3845  Bitmap Heap Scan on ti1
3846    Recheck Cond: (c1 < 100)
3847    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3848    ->  Bitmap Index Scan on ti1_btree
3849          Index Cond: (c1 < 100)
3850 (5 rows)
3851
3852 -- No. S-3-4-13
3853 /*+BitmapScan(ti1 ti1_hash)*/
3854 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)';
3855 LOG:  available indexes for BitmapScan(ti1): ti1_hash
3856 LOG:  pg_hint_plan:
3857 used hint:
3858 BitmapScan(ti1 ti1_hash)
3859 not used hint:
3860 duplication hint:
3861 error hint:
3862
3863                                                                      QUERY PLAN                                                                     
3864 ----------------------------------------------------------------------------------------------------------------------------------------------------
3865  Bitmap Heap Scan on ti1
3866    Recheck Cond: (c1 = 100)
3867    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3868    ->  Bitmap Index Scan on ti1_hash
3869          Index Cond: (c1 = 100)
3870 (5 rows)
3871
3872 -- No. S-3-4-14
3873 /*+BitmapScan(ti1 ti1_gist)*/
3874 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)';
3875 LOG:  available indexes for BitmapScan(ti1): ti1_gist
3876 LOG:  pg_hint_plan:
3877 used hint:
3878 BitmapScan(ti1 ti1_gist)
3879 not used hint:
3880 duplication hint:
3881 error hint:
3882
3883                                                                      QUERY PLAN                                                                     
3884 ----------------------------------------------------------------------------------------------------------------------------------------------------
3885  Bitmap Heap Scan on ti1
3886    Recheck Cond: (c1 < 100)
3887    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3888    ->  Bitmap Index Scan on ti1_gist
3889          Index Cond: (c1 < 100)
3890 (5 rows)
3891
3892 -- No. S-3-4-15
3893 /*+BitmapScan(ti1 ti1_gin)*/
3894 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)';
3895 LOG:  available indexes for BitmapScan(ti1): ti1_gin
3896 LOG:  pg_hint_plan:
3897 used hint:
3898 BitmapScan(ti1 ti1_gin)
3899 not used hint:
3900 duplication hint:
3901 error hint:
3902
3903                                                                      QUERY PLAN                                                                     
3904 ----------------------------------------------------------------------------------------------------------------------------------------------------
3905  Bitmap Heap Scan on ti1
3906    Recheck Cond: (c1 < 100)
3907    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3908    ->  Bitmap Index Scan on ti1_gin
3909          Index Cond: (c1 < 100)
3910 (5 rows)
3911
3912 -- No. S-3-4-16
3913 /*+BitmapScan(ti1 ti1_expr)*/
3914 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)';
3915 LOG:  available indexes for BitmapScan(ti1): ti1_expr
3916 LOG:  pg_hint_plan:
3917 used hint:
3918 BitmapScan(ti1 ti1_expr)
3919 not used hint:
3920 duplication hint:
3921 error hint:
3922
3923                                                                             QUERY PLAN                                                                             
3924 -------------------------------------------------------------------------------------------------------------------------------------------------------------------
3925  Bitmap Heap Scan on ti1
3926    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))
3927    ->  Bitmap Index Scan on ti1_expr
3928          Index Cond: ((c1 < 100) = true)
3929 (4 rows)
3930
3931 -- No. S-3-4-17
3932 /*+BitmapScan(ti1 ti1_pred)*/
3933 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)';
3934 LOG:  available indexes for BitmapScan(ti1): ti1_pred
3935 LOG:  pg_hint_plan:
3936 used hint:
3937 BitmapScan(ti1 ti1_pred)
3938 not used hint:
3939 duplication hint:
3940 error hint:
3941
3942                                                               QUERY PLAN                                                               
3943 ---------------------------------------------------------------------------------------------------------------------------------------
3944  Bitmap Heap Scan on ti1
3945    Recheck Cond: (lower(c4) = '1'::text)
3946    Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
3947    ->  Bitmap Index Scan on ti1_pred
3948          Index Cond: (lower(c4) = '1'::text)
3949 (5 rows)
3950
3951 -- No. S-3-4-18
3952 /*+BitmapScan(ti1 ti1_uniq)*/
3953 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)';
3954 LOG:  available indexes for BitmapScan(ti1): ti1_uniq
3955 LOG:  pg_hint_plan:
3956 used hint:
3957 BitmapScan(ti1 ti1_uniq)
3958 not used hint:
3959 duplication hint:
3960 error hint:
3961
3962                                                                      QUERY PLAN                                                                     
3963 ----------------------------------------------------------------------------------------------------------------------------------------------------
3964  Bitmap Heap Scan on ti1
3965    Recheck Cond: (c1 < 100)
3966    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3967    ->  Bitmap Index Scan on ti1_uniq
3968          Index Cond: (c1 < 100)
3969 (5 rows)
3970
3971 -- No. S-3-4-19
3972 /*+BitmapScan(ti1 ti1_multi)*/
3973 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)';
3974 LOG:  available indexes for BitmapScan(ti1): ti1_multi
3975 LOG:  pg_hint_plan:
3976 used hint:
3977 BitmapScan(ti1 ti1_multi)
3978 not used hint:
3979 duplication hint:
3980 error hint:
3981
3982                                                               QUERY PLAN                                                               
3983 ---------------------------------------------------------------------------------------------------------------------------------------
3984  Bitmap Heap Scan on ti1
3985    Recheck Cond: ((c1 < 100) AND (c2 = 1))
3986    Filter: ((ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3987    ->  Bitmap Index Scan on ti1_multi
3988          Index Cond: ((c1 < 100) AND (c2 = 1))
3989 (5 rows)
3990
3991 -- No. S-3-4-20
3992 /*+BitmapScan(ti1 ti1_ts)*/
3993 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)';
3994 LOG:  available indexes for BitmapScan(ti1): ti1_ts
3995 LOG:  pg_hint_plan:
3996 used hint:
3997 BitmapScan(ti1 ti1_ts)
3998 not used hint:
3999 duplication hint:
4000 error hint:
4001
4002                                         QUERY PLAN                                         
4003 -------------------------------------------------------------------------------------------
4004  Bitmap Heap Scan on ti1
4005    Recheck Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
4006    Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (lower(c4) = '1'::text))
4007    ->  Bitmap Index Scan on ti1_ts
4008          Index Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
4009 (5 rows)
4010
4011 -- No. S-3-4-10
4012 /*+BitmapScan(ti1 ti1_pkey)*/
4013 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)';
4014 LOG:  available indexes for BitmapScan(ti1): ti1_pkey
4015 LOG:  pg_hint_plan:
4016 used hint:
4017 BitmapScan(ti1 ti1_pkey)
4018 not used hint:
4019 duplication hint:
4020 error hint:
4021
4022                                                                      QUERY PLAN                                                                     
4023 ----------------------------------------------------------------------------------------------------------------------------------------------------
4024  Bitmap Heap Scan on ti1
4025    Recheck Cond: (c1 < 100)
4026    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
4027    ->  Bitmap Index Scan on ti1_pkey
4028          Index Cond: (c1 < 100)
4029 (5 rows)
4030
4031 -- No. S-3-4-11
4032 /*+BitmapScan(ti1 ti1_c2_key)*/
4033 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)';
4034 LOG:  available indexes for BitmapScan(ti1): ti1_c2_key
4035 LOG:  pg_hint_plan:
4036 used hint:
4037 BitmapScan(ti1 ti1_c2_key)
4038 not used hint:
4039 duplication hint:
4040 error hint:
4041
4042                                                                       QUERY PLAN                                                                      
4043 ------------------------------------------------------------------------------------------------------------------------------------------------------
4044  Bitmap Heap Scan on ti1
4045    Recheck Cond: (c2 = 1)
4046    Filter: ((c1 < 100) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
4047    ->  Bitmap Index Scan on ti1_c2_key
4048          Index Cond: (c2 = 1)
4049 (5 rows)
4050
4051 -- No. S-3-4-23
4052 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4053      QUERY PLAN      
4054 ---------------------
4055  Seq Scan on ti1
4056    Filter: (c1 >= 1)
4057 (2 rows)
4058
4059 /*+IndexOnlyScan(ti1 ti1_btree)*/
4060 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4061 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_btree)"
4062 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4063      QUERY PLAN      
4064 ---------------------
4065  Seq Scan on ti1
4066    Filter: (c1 >= 1)
4067 (2 rows)
4068
4069 -- No. S-3-4-24
4070 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
4071             QUERY PLAN            
4072 ----------------------------------
4073  Index Scan using ti1_uniq on ti1
4074    Index Cond: (c1 = 1)
4075 (2 rows)
4076
4077 /*+IndexOnlyScan(ti1 ti1_hash)*/
4078 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
4079 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_hash)"
4080 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4081             QUERY PLAN            
4082 ----------------------------------
4083  Index Scan using ti1_uniq on ti1
4084    Index Cond: (c1 = 1)
4085 (2 rows)
4086
4087 -- No. S-3-4-25
4088 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 < 1;
4089             QUERY PLAN            
4090 ----------------------------------
4091  Index Scan using ti1_uniq on ti1
4092    Index Cond: (c1 < 1)
4093 (2 rows)
4094
4095 /*+IndexOnlyScan(ti1 ti1_gist)*/
4096 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 < 1;
4097 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_gist)"
4098 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4099             QUERY PLAN            
4100 ----------------------------------
4101  Index Scan using ti1_uniq on ti1
4102    Index Cond: (c1 < 1)
4103 (2 rows)
4104
4105 -- No. S-3-4-26
4106 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
4107             QUERY PLAN            
4108 ----------------------------------
4109  Index Scan using ti1_uniq on ti1
4110    Index Cond: (c1 = 1)
4111 (2 rows)
4112
4113 /*+IndexOnlyScan(ti1 ti1_gin)*/
4114 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
4115 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_gin)"
4116 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4117             QUERY PLAN            
4118 ----------------------------------
4119  Index Scan using ti1_uniq on ti1
4120    Index Cond: (c1 = 1)
4121 (2 rows)
4122
4123 -- No. S-3-4-27
4124 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 < 100;
4125             QUERY PLAN            
4126 ----------------------------------
4127  Index Scan using ti1_uniq on ti1
4128    Index Cond: (c1 < 100)
4129 (2 rows)
4130
4131 /*+IndexOnlyScan(ti1 ti1_expr)*/
4132 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 < 100;
4133 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_expr)"
4134 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4135             QUERY PLAN            
4136 ----------------------------------
4137  Index Scan using ti1_uniq on ti1
4138    Index Cond: (c1 < 100)
4139 (2 rows)
4140
4141 -- No. S-3-4-28
4142 EXPLAIN (COSTS false) SELECT c4 FROM s1.ti1 WHERE lower(c4) >= '1';
4143              QUERY PLAN             
4144 ------------------------------------
4145  Seq Scan on ti1
4146    Filter: (lower(c4) >= '1'::text)
4147 (2 rows)
4148
4149 /*+IndexOnlyScan(ti1 ti1_pred)*/
4150 EXPLAIN (COSTS false) SELECT c4 FROM s1.ti1 WHERE lower(c4) >= '1';
4151 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_pred)"
4152 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4153              QUERY PLAN             
4154 ------------------------------------
4155  Seq Scan on ti1
4156    Filter: (lower(c4) >= '1'::text)
4157 (2 rows)
4158
4159 -- No. S-3-4-29
4160 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4161      QUERY PLAN      
4162 ---------------------
4163  Seq Scan on ti1
4164    Filter: (c1 >= 1)
4165 (2 rows)
4166
4167 /*+IndexOnlyScan(ti1 ti1_uniq)*/
4168 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4169 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_uniq)"
4170 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4171      QUERY PLAN      
4172 ---------------------
4173  Seq Scan on ti1
4174    Filter: (c1 >= 1)
4175 (2 rows)
4176
4177 -- No. S-3-4-30
4178 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4179      QUERY PLAN      
4180 ---------------------
4181  Seq Scan on ti1
4182    Filter: (c1 >= 1)
4183 (2 rows)
4184
4185 /*+IndexOnlyScan(ti1 ti1_multi)*/
4186 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4187 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_multi)"
4188 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4189      QUERY PLAN      
4190 ---------------------
4191  Seq Scan on ti1
4192    Filter: (c1 >= 1)
4193 (2 rows)
4194
4195 -- No. S-3-4-31
4196 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE to_tsvector('english', c4) @@ 'a & b';
4197                                        QUERY PLAN                                        
4198 -----------------------------------------------------------------------------------------
4199  Bitmap Heap Scan on ti1
4200    Recheck Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
4201    ->  Bitmap Index Scan on ti1_ts
4202          Index Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
4203 (4 rows)
4204
4205 /*+IndexOnlyScan(ti1 ti1_ts)*/
4206 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE to_tsvector('english', c4) @@ 'a & b';
4207 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_ts)"
4208 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4209                                        QUERY PLAN                                        
4210 -----------------------------------------------------------------------------------------
4211  Bitmap Heap Scan on ti1
4212    Recheck Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
4213    ->  Bitmap Index Scan on ti1_ts
4214          Index Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
4215 (4 rows)
4216
4217 -- No. S-3-4-32
4218 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4219      QUERY PLAN      
4220 ---------------------
4221  Seq Scan on ti1
4222    Filter: (c1 >= 1)
4223 (2 rows)
4224
4225 /*+IndexOnlyScan(ti1 ti1_pkey)*/
4226 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4227 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_pkey)"
4228 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4229      QUERY PLAN      
4230 ---------------------
4231  Seq Scan on ti1
4232    Filter: (c1 >= 1)
4233 (2 rows)
4234
4235 -- No. S-3-4-33
4236 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE c2 >= 1;
4237      QUERY PLAN      
4238 ---------------------
4239  Seq Scan on ti1
4240    Filter: (c2 >= 1)
4241 (2 rows)
4242
4243 /*+IndexOnlyScan(ti1 ti1_c2_key)*/
4244 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE c2 >= 1;
4245 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_c2_key)"
4246 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4247      QUERY PLAN      
4248 ---------------------
4249  Seq Scan on ti1
4250    Filter: (c2 >= 1)
4251 (2 rows)
4252
4253 ----
4254 ---- No. S-3-5 not used index
4255 ----
4256 -- No. S-3-5-1
4257 /*+IndexScan(ti1 ti1_pred)*/
4258 EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
4259 LOG:  available indexes for IndexScan(ti1): ti1_pred
4260 LOG:  pg_hint_plan:
4261 used hint:
4262 IndexScan(ti1 ti1_pred)
4263 not used hint:
4264 duplication hint:
4265 error hint:
4266
4267                                QUERY PLAN                               
4268 ------------------------------------------------------------------------
4269  Seq Scan on ti1  (cost=10000000000.00..10000000018.50 rows=1 width=15)
4270    Filter: (c1 = 100)
4271 (2 rows)
4272
4273 -- No. S-3-5-2
4274 /*+BitmapScan(ti1 ti1_pred)*/
4275 EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
4276 LOG:  available indexes for BitmapScan(ti1): ti1_pred
4277 LOG:  pg_hint_plan:
4278 used hint:
4279 BitmapScan(ti1 ti1_pred)
4280 not used hint:
4281 duplication hint:
4282 error hint:
4283
4284                                QUERY PLAN                               
4285 ------------------------------------------------------------------------
4286  Seq Scan on ti1  (cost=10000000000.00..10000000018.50 rows=1 width=15)
4287    Filter: (c1 = 100)
4288 (2 rows)
4289
4290 -- No. S-3-5-3
4291 /*+IndexOnlyScan(ti1 ti1_pred)*/
4292 EXPLAIN (COSTS true) SELECT c1 FROM s1.ti1 WHERE c1 = 100;
4293 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_pred)"
4294 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4295                              QUERY PLAN                             
4296 --------------------------------------------------------------------
4297  Index Scan using ti1_uniq on ti1  (cost=0.00..8.27 rows=1 width=4)
4298    Index Cond: (c1 = 100)
4299 (2 rows)
4300
4301 ----
4302 ---- No. S-3-6 not exist index
4303 ----
4304 -- No. S-3-6-1
4305 /*+IndexScan(ti1 not_exist)*/
4306 EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
4307 LOG:  available indexes for IndexScan(ti1):
4308 LOG:  pg_hint_plan:
4309 used hint:
4310 IndexScan(ti1 not_exist)
4311 not used hint:
4312 duplication hint:
4313 error hint:
4314
4315                                QUERY PLAN                               
4316 ------------------------------------------------------------------------
4317  Seq Scan on ti1  (cost=10000000000.00..10000000018.50 rows=1 width=15)
4318    Filter: (c1 = 100)
4319 (2 rows)
4320
4321 -- No. S-3-6-2
4322 /*+BitmapScan(ti1 not_exist)*/
4323 EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
4324 LOG:  available indexes for BitmapScan(ti1):
4325 LOG:  pg_hint_plan:
4326 used hint:
4327 BitmapScan(ti1 not_exist)
4328 not used hint:
4329 duplication hint:
4330 error hint:
4331
4332                                QUERY PLAN                               
4333 ------------------------------------------------------------------------
4334  Seq Scan on ti1  (cost=10000000000.00..10000000018.50 rows=1 width=15)
4335    Filter: (c1 = 100)
4336 (2 rows)
4337
4338 -- No. S-3-6-3
4339 /*+IndexOnlyScan(ti1 not_exist)*/
4340 EXPLAIN (COSTS true) SELECT c1 FROM s1.ti1 WHERE c1 = 100;
4341 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 not_exist)"
4342 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4343                              QUERY PLAN                             
4344 --------------------------------------------------------------------
4345  Index Scan using ti1_uniq on ti1  (cost=0.00..8.27 rows=1 width=4)
4346    Index Cond: (c1 = 100)
4347 (2 rows)
4348
4349 ----
4350 ---- No. S-3-7 query structure
4351 ----
4352 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
4353                   QUERY PLAN                   
4354 -----------------------------------------------
4355  Hash Join
4356    Hash Cond: (t2.c1 = t1.c1)
4357    ->  Seq Scan on t2
4358    ->  Hash
4359          ->  Tid Scan on t1
4360                TID Cond: (ctid = '(1,1)'::tid)
4361 (6 rows)
4362
4363 -- No. S-3-7-1
4364 /*+SeqScan(t1)*/
4365 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE c1 = 100;
4366 LOG:  pg_hint_plan:
4367 used hint:
4368 SeqScan(t1)
4369 not used hint:
4370 duplication hint:
4371 error hint:
4372
4373       QUERY PLAN      
4374 ----------------------
4375  Seq Scan on t1
4376    Filter: (c1 = 100)
4377 (2 rows)
4378
4379 -- No. S-3-7-2
4380 /*+SeqScan(t1)BitmapScan(t2)*/
4381 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
4382 LOG:  pg_hint_plan:
4383 used hint:
4384 SeqScan(t1)
4385 BitmapScan(t2)
4386 not used hint:
4387 duplication hint:
4388 error hint:
4389
4390                QUERY PLAN               
4391 ----------------------------------------
4392  Nested Loop
4393    ->  Seq Scan on t1
4394          Filter: (ctid = '(1,1)'::tid)
4395    ->  Bitmap Heap Scan on t2
4396          Recheck Cond: (c1 = t1.c1)
4397          ->  Bitmap Index Scan on t2_i1
4398                Index Cond: (c1 = t1.c1)
4399 (7 rows)
4400
4401 -- No. S-3-7-3
4402 /*+SeqScan(t1)*/
4403 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
4404 LOG:  pg_hint_plan:
4405 used hint:
4406 SeqScan(t1)
4407 not used hint:
4408 duplication hint:
4409 error hint:
4410
4411                  QUERY PLAN                  
4412 ---------------------------------------------
4413  Hash Join
4414    Hash Cond: (t2.c1 = t1.c1)
4415    ->  Seq Scan on t2
4416    ->  Hash
4417          ->  Seq Scan on t1
4418                Filter: (ctid = '(1,1)'::tid)
4419 (6 rows)
4420
4421 ----
4422 ---- No. S-3-8 query structure
4423 ----
4424 -- No. S-3-8-1
4425 EXPLAIN (COSTS false) 
4426 WITH c1 (c1) AS (
4427 SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.c1 = 1)
4428 SELECT max(b3t1.c1), (
4429 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
4430                   ) FROM s1.t1 b3t1 WHERE b3t1.c1 = (
4431 SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
4432                              QUERY PLAN                              
4433 ---------------------------------------------------------------------
4434  Result
4435    InitPlan 2 (returns $1)
4436      ->  Result
4437            InitPlan 1 (returns $0)
4438              ->  Limit
4439                    ->  Index Scan using t1_i1 on t1 b2t1
4440                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4441    InitPlan 4 (returns $3)
4442      ->  Result
4443            InitPlan 3 (returns $2)
4444              ->  Limit
4445                    ->  Index Scan using t1_i1 on t1 b4t1
4446                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4447    InitPlan 5 (returns $4)
4448      ->  Limit
4449            ->  Index Scan using t1_i1 on t1 b3t1
4450                  Index Cond: ((c1 IS NOT NULL) AND (c1 = $3))
4451 (17 rows)
4452
4453 /*+SeqScan(b1t1)IndexScan(b2t1 t1_pkey)BitmapScan(b3t1 t1_pkey)TidScan(b4t1)
4454 */
4455 EXPLAIN (COSTS false) 
4456 WITH c1 (c1) AS (
4457 SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.c1 = 1)
4458 SELECT max(b3t1.c1), (
4459 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
4460                   ) FROM s1.t1 b3t1 WHERE b3t1.c1 = (
4461 SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
4462 LOG:  available indexes for IndexScan(b2t1): t1_pkey
4463 LOG:  available indexes for IndexScan(b2t1): t1_pkey
4464 LOG:  available indexes for BitmapScan(b3t1): t1_pkey
4465 LOG:  available indexes for BitmapScan(b3t1): t1_pkey
4466 LOG:  pg_hint_plan:
4467 used hint:
4468 IndexScan(b2t1 t1_pkey)
4469 BitmapScan(b3t1 t1_pkey)
4470 TidScan(b4t1)
4471 not used hint:
4472 SeqScan(b1t1)
4473 duplication hint:
4474 error hint:
4475
4476                              QUERY PLAN                              
4477 ---------------------------------------------------------------------
4478  Result
4479    InitPlan 2 (returns $1)
4480      ->  Result
4481            InitPlan 1 (returns $0)
4482              ->  Limit
4483                    ->  Index Scan using t1_pkey on t1 b2t1
4484                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4485    InitPlan 4 (returns $3)
4486      ->  Result
4487            InitPlan 3 (returns $2)
4488              ->  Limit
4489                    ->  Seq Scan on t1 b4t1
4490                          Filter: ((c1 IS NOT NULL) AND (c1 = 1))
4491    InitPlan 5 (returns $4)
4492      ->  Limit
4493            ->  Bitmap Heap Scan on t1 b3t1
4494                  Recheck Cond: ((c1 IS NOT NULL) AND (c1 = $3))
4495                  ->  Bitmap Index Scan on t1_pkey
4496                        Index Cond: ((c1 IS NOT NULL) AND (c1 = $3))
4497 (19 rows)
4498
4499 -- No. S-3-8-2
4500 EXPLAIN (COSTS false) 
4501 WITH cte1 (c1) AS (
4502 SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
4503 SELECT max(b3t1.c1), (
4504 SELECT max(b2t1.c1) FROM s1.t1 b2t1 JOIN s1.t2 b2t2 ON(b2t1.c1 = b2t2.c1) WHERE b2t1.c1 = 1
4505                   ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
4506 SELECT max(b4t1.c1) FROM s1.t1 b4t1 JOIN s1.t2 b4t2 ON(b4t1.c1 = b4t2.c1) WHERE b4t1.c1 = 1);
4507                       QUERY PLAN                       
4508 -------------------------------------------------------
4509  Aggregate
4510    CTE cte1
4511      ->  Aggregate
4512            ->  Nested Loop
4513                  ->  Index Scan using t1_i1 on t1 b1t1
4514                        Index Cond: (c1 = 1)
4515                  ->  Seq Scan on t2 b1t2
4516                        Filter: (c1 = 1)
4517    InitPlan 2 (returns $1)
4518      ->  Aggregate
4519            ->  Nested Loop
4520                  ->  Index Scan using t1_i1 on t1 b2t1
4521                        Index Cond: (c1 = 1)
4522                  ->  Seq Scan on t2 b2t2
4523                        Filter: (c1 = 1)
4524    InitPlan 3 (returns $2)
4525      ->  Aggregate
4526            ->  Nested Loop
4527                  ->  Index Scan using t1_i1 on t1 b4t1
4528                        Index Cond: (c1 = 1)
4529                  ->  Seq Scan on t2 b4t2
4530                        Filter: (c1 = 1)
4531    ->  Nested Loop
4532          ->  Nested Loop
4533                ->  Index Scan using t1_i1 on t1 b3t1
4534                      Index Cond: (c1 = $2)
4535                ->  Seq Scan on t2 b3t2
4536                      Filter: (c1 = $2)
4537          ->  CTE Scan on cte1
4538                Filter: (c1 = $2)
4539 (30 rows)
4540
4541 /*+SeqScan(b1t1)IndexScan(b2t1 t1_pkey)BitmapScan(b3t1 t1_pkey)TidScan(b4t1)
4542 TidScan(b1t2)SeqScan(b2t2)IndexScan(b3t2 t2_pkey)BitmapScan(b4t2 t2_pkey)
4543 */
4544 EXPLAIN (COSTS false) 
4545 WITH cte1 (c1) AS (
4546 SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
4547 SELECT max(b3t1.c1), (
4548 SELECT max(b2t1.c1) FROM s1.t1 b2t1 JOIN s1.t2 b2t2 ON(b2t1.c1 = b2t2.c1) WHERE b2t1.c1 = 1
4549                   ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
4550 SELECT max(b4t1.c1) FROM s1.t1 b4t1 JOIN s1.t2 b4t2 ON(b4t1.c1 = b4t2.c1) WHERE b4t1.c1 = 1);
4551 LOG:  available indexes for IndexScan(b2t1): t1_pkey
4552 LOG:  available indexes for BitmapScan(b4t2): t2_pkey
4553 LOG:  available indexes for BitmapScan(b3t1): t1_pkey
4554 LOG:  available indexes for IndexScan(b3t2): t2_pkey
4555 LOG:  pg_hint_plan:
4556 used hint:
4557 SeqScan(b1t1)
4558 TidScan(b1t2)
4559 IndexScan(b2t1 t1_pkey)
4560 SeqScan(b2t2)
4561 BitmapScan(b3t1 t1_pkey)
4562 IndexScan(b3t2 t2_pkey)
4563 TidScan(b4t1)
4564 BitmapScan(b4t2 t2_pkey)
4565 not used hint:
4566 duplication hint:
4567 error hint:
4568
4569                        QUERY PLAN                        
4570 ---------------------------------------------------------
4571  Aggregate
4572    CTE cte1
4573      ->  Aggregate
4574            ->  Nested Loop
4575                  ->  Seq Scan on t1 b1t1
4576                        Filter: (c1 = 1)
4577                  ->  Seq Scan on t2 b1t2
4578                        Filter: (c1 = 1)
4579    InitPlan 2 (returns $1)
4580      ->  Aggregate
4581            ->  Nested Loop
4582                  ->  Index Scan using t1_pkey on t1 b2t1
4583                        Index Cond: (c1 = 1)
4584                  ->  Seq Scan on t2 b2t2
4585                        Filter: (c1 = 1)
4586    InitPlan 3 (returns $2)
4587      ->  Aggregate
4588            ->  Nested Loop
4589                  ->  Seq Scan on t1 b4t1
4590                        Filter: (c1 = 1)
4591                  ->  Bitmap Heap Scan on t2 b4t2
4592                        Recheck Cond: (c1 = 1)
4593                        ->  Bitmap Index Scan on t2_pkey
4594                              Index Cond: (c1 = 1)
4595    ->  Nested Loop
4596          ->  Nested Loop
4597                ->  Bitmap Heap Scan on t1 b3t1
4598                      Recheck Cond: (c1 = $2)
4599                      ->  Bitmap Index Scan on t1_pkey
4600                            Index Cond: (c1 = $2)
4601                ->  CTE Scan on cte1
4602                      Filter: (c1 = $2)
4603          ->  Index Scan using t2_pkey on t2 b3t2
4604                Index Cond: (c1 = $2)
4605 (34 rows)
4606
4607 -- No. S-3-8-3
4608 EXPLAIN (COSTS false) 
4609 WITH cte1 (c1) AS (
4610 SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
4611 SELECT max(b3t1.c1), (
4612 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
4613                   ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
4614 SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
4615                              QUERY PLAN                              
4616 ---------------------------------------------------------------------
4617  Aggregate
4618    CTE cte1
4619      ->  Aggregate
4620            ->  Nested Loop
4621                  ->  Index Scan using t1_i1 on t1 b1t1
4622                        Index Cond: (c1 = 1)
4623                  ->  Seq Scan on t2 b1t2
4624                        Filter: (c1 = 1)
4625    InitPlan 3 (returns $2)
4626      ->  Result
4627            InitPlan 2 (returns $1)
4628              ->  Limit
4629                    ->  Index Scan using t1_i1 on t1 b2t1
4630                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4631    InitPlan 5 (returns $4)
4632      ->  Result
4633            InitPlan 4 (returns $3)
4634              ->  Limit
4635                    ->  Index Scan using t1_i1 on t1 b4t1
4636                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4637    ->  Nested Loop
4638          ->  Nested Loop
4639                ->  Index Scan using t1_i1 on t1 b3t1
4640                      Index Cond: (c1 = $4)
4641                ->  Seq Scan on t2 b3t2
4642                      Filter: (c1 = $4)
4643          ->  CTE Scan on cte1
4644                Filter: (c1 = $4)
4645 (28 rows)
4646
4647 /*+SeqScan(b1t1)IndexScan(b2t1 t1_pkey)BitmapScan(b3t1 t1_pkey)TidScan(b4t1)
4648 TidScan(b1t2)IndexScan(b3t2 t2_pkey)
4649 */
4650 EXPLAIN (COSTS false) 
4651 WITH cte1 (c1) AS (
4652 SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
4653 SELECT max(b3t1.c1), (
4654 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
4655                   ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
4656 SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
4657 LOG:  available indexes for IndexScan(b2t1): t1_pkey
4658 LOG:  available indexes for IndexScan(b2t1): t1_pkey
4659 LOG:  available indexes for BitmapScan(b3t1): t1_pkey
4660 LOG:  available indexes for IndexScan(b3t2): t2_pkey
4661 LOG:  pg_hint_plan:
4662 used hint:
4663 SeqScan(b1t1)
4664 TidScan(b1t2)
4665 IndexScan(b2t1 t1_pkey)
4666 BitmapScan(b3t1 t1_pkey)
4667 IndexScan(b3t2 t2_pkey)
4668 TidScan(b4t1)
4669 not used hint:
4670 duplication hint:
4671 error hint:
4672
4673                              QUERY PLAN                              
4674 ---------------------------------------------------------------------
4675  Aggregate
4676    CTE cte1
4677      ->  Aggregate
4678            ->  Nested Loop
4679                  ->  Seq Scan on t1 b1t1
4680                        Filter: (c1 = 1)
4681                  ->  Seq Scan on t2 b1t2
4682                        Filter: (c1 = 1)
4683    InitPlan 3 (returns $2)
4684      ->  Result
4685            InitPlan 2 (returns $1)
4686              ->  Limit
4687                    ->  Index Scan using t1_pkey on t1 b2t1
4688                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4689    InitPlan 5 (returns $4)
4690      ->  Result
4691            InitPlan 4 (returns $3)
4692              ->  Limit
4693                    ->  Seq Scan on t1 b4t1
4694                          Filter: ((c1 IS NOT NULL) AND (c1 = 1))
4695    ->  Nested Loop
4696          ->  Nested Loop
4697                ->  Bitmap Heap Scan on t1 b3t1
4698                      Recheck Cond: (c1 = $4)
4699                      ->  Bitmap Index Scan on t1_pkey
4700                            Index Cond: (c1 = $4)
4701                ->  CTE Scan on cte1
4702                      Filter: (c1 = $4)
4703          ->  Index Scan using t2_pkey on t2 b3t2
4704                Index Cond: (c1 = $4)
4705 (30 rows)
4706
4707 ----
4708 ---- No. S-3-9 inheritance table select type
4709 ----
4710 -- No. S-3-9-1
4711 EXPLAIN (COSTS false) SELECT * FROM ONLY s1.p1 WHERE c1 = 1;
4712      QUERY PLAN     
4713 --------------------
4714  Seq Scan on p1
4715    Filter: (c1 = 1)
4716 (2 rows)
4717
4718 /*+IndexScan(p1)*/
4719 EXPLAIN (COSTS false) SELECT * FROM ONLY s1.p1 WHERE c1 = 1;
4720 LOG:  pg_hint_plan:
4721 used hint:
4722 IndexScan(p1)
4723 not used hint:
4724 duplication hint:
4725 error hint:
4726
4727          QUERY PLAN          
4728 -----------------------------
4729  Index Scan using p1_i on p1
4730    Index Cond: (c1 = 1)
4731 (2 rows)
4732
4733 -- No. S-3-9-2
4734 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
4735            QUERY PLAN            
4736 ---------------------------------
4737  Result
4738    ->  Append
4739          ->  Seq Scan on p1
4740                Filter: (c1 = 1)
4741          ->  Seq Scan on p1c1 p1
4742                Filter: (c1 = 1)
4743 (6 rows)
4744
4745 /*+IndexScan(p1)*/
4746 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
4747 LOG:  pg_hint_plan:
4748 used hint:
4749 IndexScan(p1)
4750 not used hint:
4751 duplication hint:
4752 error hint:
4753
4754                    QUERY PLAN                   
4755 ------------------------------------------------
4756  Result
4757    ->  Append
4758          ->  Index Scan using p1_i on p1
4759                Index Cond: (c1 = 1)
4760          ->  Index Scan using p1c1_i on p1c1 p1
4761                Index Cond: (c1 = 1)
4762 (6 rows)
4763
4764 ----
4765 ---- No. S-3-10 inheritance table number
4766 ----
4767 -- No. S-3-10-1
4768 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
4769            QUERY PLAN            
4770 ---------------------------------
4771  Result
4772    ->  Append
4773          ->  Seq Scan on p1
4774                Filter: (c1 = 1)
4775          ->  Seq Scan on p1c1 p1
4776                Filter: (c1 = 1)
4777 (6 rows)
4778
4779 /*+IndexScan(p1)*/
4780 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
4781 LOG:  pg_hint_plan:
4782 used hint:
4783 IndexScan(p1)
4784 not used hint:
4785 duplication hint:
4786 error hint:
4787
4788                    QUERY PLAN                   
4789 ------------------------------------------------
4790  Result
4791    ->  Append
4792          ->  Index Scan using p1_i on p1
4793                Index Cond: (c1 = 1)
4794          ->  Index Scan using p1c1_i on p1c1 p1
4795                Index Cond: (c1 = 1)
4796 (6 rows)
4797
4798 -- No. S-3-10-2
4799 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4800             QUERY PLAN             
4801 -----------------------------------
4802  Result
4803    ->  Append
4804          ->  Seq Scan on p2
4805                Filter: (c1 = 1)
4806          ->  Seq Scan on p2c1 p2
4807                Filter: (c1 = 1)
4808          ->  Seq Scan on p2c1c1 p2
4809                Filter: (c1 = 1)
4810 (8 rows)
4811
4812 /*+IndexScan(p2)*/
4813 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4814 LOG:  pg_hint_plan:
4815 used hint:
4816 IndexScan(p2)
4817 not used hint:
4818 duplication hint:
4819 error hint:
4820
4821                      QUERY PLAN                     
4822 ----------------------------------------------------
4823  Result
4824    ->  Append
4825          ->  Index Scan using p2_i on p2
4826                Index Cond: (c1 = 1)
4827          ->  Index Scan using p2c1_i on p2c1 p2
4828                Index Cond: (c1 = 1)
4829          ->  Index Scan using p2c1c1_i on p2c1c1 p2
4830                Index Cond: (c1 = 1)
4831 (8 rows)
4832
4833 ----
4834 ---- No. S-3-11 inheritance table specified table
4835 ----
4836 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4837             QUERY PLAN             
4838 -----------------------------------
4839  Result
4840    ->  Append
4841          ->  Seq Scan on p2
4842                Filter: (c1 = 1)
4843          ->  Seq Scan on p2c1 p2
4844                Filter: (c1 = 1)
4845          ->  Seq Scan on p2c1c1 p2
4846                Filter: (c1 = 1)
4847 (8 rows)
4848
4849 -- No. S-3-11-1
4850 /*+IndexScan(p2)*/
4851 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4852 LOG:  pg_hint_plan:
4853 used hint:
4854 IndexScan(p2)
4855 not used hint:
4856 duplication hint:
4857 error hint:
4858
4859                      QUERY PLAN                     
4860 ----------------------------------------------------
4861  Result
4862    ->  Append
4863          ->  Index Scan using p2_i on p2
4864                Index Cond: (c1 = 1)
4865          ->  Index Scan using p2c1_i on p2c1 p2
4866                Index Cond: (c1 = 1)
4867          ->  Index Scan using p2c1c1_i on p2c1c1 p2
4868                Index Cond: (c1 = 1)
4869 (8 rows)
4870
4871 -- No. S-3-11-2
4872 /*+IndexScan(p2c1)*/
4873 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4874 LOG:  pg_hint_plan:
4875 used hint:
4876 not used hint:
4877 IndexScan(p2c1)
4878 duplication hint:
4879 error hint:
4880
4881             QUERY PLAN             
4882 -----------------------------------
4883  Result
4884    ->  Append
4885          ->  Seq Scan on p2
4886                Filter: (c1 = 1)
4887          ->  Seq Scan on p2c1 p2
4888                Filter: (c1 = 1)
4889          ->  Seq Scan on p2c1c1 p2
4890                Filter: (c1 = 1)
4891 (8 rows)
4892
4893 -- No. S-3-11-3
4894 /*+IndexScan(p2 p2_pkey p2c1_pkey p2c1c1_pkey)*/
4895 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4896 LOG:  available indexes for IndexScan(p2): p2_pkey
4897 LOG:  available indexes for IndexScan(p2c1): p2c1_pkey
4898 LOG:  available indexes for IndexScan(p2c2):
4899 LOG:  available indexes for IndexScan(p2c3):
4900 LOG:  available indexes for IndexScan(p2c1c1): p2c1c1_pkey
4901 LOG:  available indexes for IndexScan(p2c1c2):
4902 LOG:  available indexes for IndexScan(p2c2c1):
4903 LOG:  available indexes for IndexScan(p2c2c2):
4904 LOG:  available indexes for IndexScan(p2c3c1):
4905 LOG:  available indexes for IndexScan(p2c3c2):
4906 LOG:  pg_hint_plan:
4907 used hint:
4908 IndexScan(p2 p2_pkey p2c1_pkey p2c1c1_pkey)
4909 not used hint:
4910 duplication hint:
4911 error hint:
4912
4913                       QUERY PLAN                       
4914 -------------------------------------------------------
4915  Result
4916    ->  Append
4917          ->  Index Scan using p2_pkey on p2
4918                Index Cond: (c1 = 1)
4919          ->  Index Scan using p2c1_pkey on p2c1 p2
4920                Index Cond: (c1 = 1)
4921          ->  Index Scan using p2c1c1_pkey on p2c1c1 p2
4922                Index Cond: (c1 = 1)
4923 (8 rows)
4924
4925 -- No. S-3-11-4
4926 /*+IndexScan(p2 p2c1_pkey)*/
4927 EXPLAIN (COSTS true) SELECT * FROM s1.p2 WHERE c1 = 1;
4928 LOG:  available indexes for IndexScan(p2):
4929 LOG:  available indexes for IndexScan(p2c1): p2c1_pkey
4930 LOG:  available indexes for IndexScan(p2c2):
4931 LOG:  available indexes for IndexScan(p2c3):
4932 LOG:  available indexes for IndexScan(p2c1c1):
4933 LOG:  available indexes for IndexScan(p2c1c2):
4934 LOG:  available indexes for IndexScan(p2c2c1):
4935 LOG:  available indexes for IndexScan(p2c2c2):
4936 LOG:  available indexes for IndexScan(p2c3c1):
4937 LOG:  available indexes for IndexScan(p2c3c2):
4938 LOG:  pg_hint_plan:
4939 used hint:
4940 IndexScan(p2 p2c1_pkey)
4941 not used hint:
4942 duplication hint:
4943 error hint:
4944
4945                                         QUERY PLAN                                        
4946 ------------------------------------------------------------------------------------------
4947  Result  (cost=10000000000.00..20000000009.89 rows=3 width=34)
4948    ->  Append  (cost=10000000000.00..20000000009.89 rows=3 width=34)
4949          ->  Seq Scan on p2  (cost=10000000000.00..10000000000.00 rows=1 width=44)
4950                Filter: (c1 = 1)
4951          ->  Index Scan using p2c1_pkey on p2c1 p2  (cost=0.00..8.27 rows=1 width=44)
4952                Index Cond: (c1 = 1)
4953          ->  Seq Scan on p2c1c1 p2  (cost=10000000000.00..10000000001.62 rows=1 width=14)
4954                Filter: (c1 = 1)
4955 (8 rows)
4956
4957 ----
4958 ---- No. S-3-12 specified same table
4959 ----
4960 -- No. S-3-12-1
4961 /*+IndexScan(ti1) BitmapScan(ti1)*/
4962 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4963 INFO:  hint syntax error at or near "IndexScan(ti1) BitmapScan(ti1)"
4964 DETAIL:  Conflict scan method hint.
4965 LOG:  pg_hint_plan:
4966 used hint:
4967 BitmapScan(ti1)
4968 not used hint:
4969 duplication hint:
4970 IndexScan(ti1)
4971 error hint:
4972
4973              QUERY PLAN              
4974 -------------------------------------
4975  Bitmap Heap Scan on ti1
4976    Recheck Cond: (c1 = 1)
4977    Filter: (ctid = '(1,1)'::tid)
4978    ->  Bitmap Index Scan on ti1_uniq
4979          Index Cond: (c1 = 1)
4980 (5 rows)
4981
4982 -- No. S-3-12-2
4983 /*+IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)*/
4984 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4985 INFO:  hint syntax error at or near "IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
4986 DETAIL:  Conflict scan method hint.
4987 LOG:  available indexes for BitmapScan(ti1): ti1_btree
4988 LOG:  pg_hint_plan:
4989 used hint:
4990 BitmapScan(ti1 ti1_btree)
4991 not used hint:
4992 duplication hint:
4993 IndexScan(ti1 ti1_pkey)
4994 error hint:
4995
4996               QUERY PLAN              
4997 --------------------------------------
4998  Bitmap Heap Scan on ti1
4999    Recheck Cond: (c1 = 1)
5000    Filter: (ctid = '(1,1)'::tid)
5001    ->  Bitmap Index Scan on ti1_btree
5002          Index Cond: (c1 = 1)
5003 (5 rows)
5004
5005 -- No. S-3-12-3
5006 /*+BitmapScan(ti1) IndexScan(ti1) BitmapScan(ti1)*/
5007 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5008 INFO:  hint syntax error at or near "BitmapScan(ti1) IndexScan(ti1) BitmapScan(ti1)"
5009 DETAIL:  Conflict scan method hint.
5010 INFO:  hint syntax error at or near "IndexScan(ti1) BitmapScan(ti1)"
5011 DETAIL:  Conflict scan method hint.
5012 LOG:  pg_hint_plan:
5013 used hint:
5014 BitmapScan(ti1)
5015 not used hint:
5016 duplication hint:
5017 BitmapScan(ti1)
5018 IndexScan(ti1)
5019 error hint:
5020
5021              QUERY PLAN              
5022 -------------------------------------
5023  Bitmap Heap Scan on ti1
5024    Recheck Cond: (c1 = 1)
5025    Filter: (ctid = '(1,1)'::tid)
5026    ->  Bitmap Index Scan on ti1_uniq
5027          Index Cond: (c1 = 1)
5028 (5 rows)
5029
5030 -- No. S-3-12-4
5031 /*+BitmapScan(ti1 ti1_hash) IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)*/
5032 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5033 INFO:  hint syntax error at or near "BitmapScan(ti1 ti1_hash) IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
5034 DETAIL:  Conflict scan method hint.
5035 INFO:  hint syntax error at or near "IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
5036 DETAIL:  Conflict scan method hint.
5037 LOG:  available indexes for BitmapScan(ti1): ti1_btree
5038 LOG:  pg_hint_plan:
5039 used hint:
5040 BitmapScan(ti1 ti1_btree)
5041 not used hint:
5042 duplication hint:
5043 BitmapScan(ti1 ti1_hash)
5044 IndexScan(ti1 ti1_pkey)
5045 error hint:
5046
5047               QUERY PLAN              
5048 --------------------------------------
5049  Bitmap Heap Scan on ti1
5050    Recheck Cond: (c1 = 1)
5051    Filter: (ctid = '(1,1)'::tid)
5052    ->  Bitmap Index Scan on ti1_btree
5053          Index Cond: (c1 = 1)
5054 (5 rows)
5055
5056 ----
5057 ---- No. S-3-13 message output
5058 ----
5059 -- No. S-3-13-1
5060 /*+SeqScan(ti1)*/
5061 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5062 LOG:  pg_hint_plan:
5063 used hint:
5064 SeqScan(ti1)
5065 not used hint:
5066 duplication hint:
5067 error hint:
5068
5069                    QUERY PLAN                   
5070 ------------------------------------------------
5071  Seq Scan on ti1
5072    Filter: ((c1 = 1) AND (ctid = '(1,1)'::tid))
5073 (2 rows)
5074
5075 -- No. S-3-13-2
5076 /*+SeqScan(ti1 ti1_pkey)*/
5077 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5078 INFO:  hint syntax error at or near ""
5079 DETAIL:  SeqScan hint accepts only one relation.
5080 LOG:  pg_hint_plan:
5081 used hint:
5082 not used hint:
5083 duplication hint:
5084 error hint:
5085 SeqScan(ti1 ti1_pkey)
5086
5087             QUERY PLAN             
5088 -----------------------------------
5089  Tid Scan on ti1
5090    TID Cond: (ctid = '(1,1)'::tid)
5091    Filter: (c1 = 1)
5092 (3 rows)
5093
5094 -- No. S-3-13-3
5095 /*+SeqScan(ti1 ti1_pkey ti1_btree)*/
5096 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5097 INFO:  hint syntax error at or near ""
5098 DETAIL:  SeqScan hint accepts only one relation.
5099 LOG:  pg_hint_plan:
5100 used hint:
5101 not used hint:
5102 duplication hint:
5103 error hint:
5104 SeqScan(ti1 ti1_pkey ti1_btree)
5105
5106             QUERY PLAN             
5107 -----------------------------------
5108  Tid Scan on ti1
5109    TID Cond: (ctid = '(1,1)'::tid)
5110    Filter: (c1 = 1)
5111 (3 rows)
5112
5113 -- No. S-3-13-4
5114 /*+IndexScan(ti1)*/
5115 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5116 LOG:  pg_hint_plan:
5117 used hint:
5118 IndexScan(ti1)
5119 not used hint:
5120 duplication hint:
5121 error hint:
5122
5123             QUERY PLAN            
5124 ----------------------------------
5125  Index Scan using ti1_uniq on ti1
5126    Index Cond: (c1 = 1)
5127    Filter: (ctid = '(1,1)'::tid)
5128 (3 rows)
5129
5130 -- No. S-3-13-5
5131 /*+IndexScan(ti1 ti1_pkey)*/
5132 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5133 LOG:  available indexes for IndexScan(ti1): ti1_pkey
5134 LOG:  pg_hint_plan:
5135 used hint:
5136 IndexScan(ti1 ti1_pkey)
5137 not used hint:
5138 duplication hint:
5139 error hint:
5140
5141             QUERY PLAN            
5142 ----------------------------------
5143  Index Scan using ti1_pkey on ti1
5144    Index Cond: (c1 = 1)
5145    Filter: (ctid = '(1,1)'::tid)
5146 (3 rows)
5147
5148 -- No. S-3-13-6
5149 /*+IndexScan(ti1 ti1_pkey ti1_btree)*/
5150 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5151 LOG:  available indexes for IndexScan(ti1): ti1_btree ti1_pkey
5152 LOG:  pg_hint_plan:
5153 used hint:
5154 IndexScan(ti1 ti1_pkey ti1_btree)
5155 not used hint:
5156 duplication hint:
5157 error hint:
5158
5159             QUERY PLAN             
5160 -----------------------------------
5161  Index Scan using ti1_btree on ti1
5162    Index Cond: (c1 = 1)
5163    Filter: (ctid = '(1,1)'::tid)
5164 (3 rows)
5165
5166 -- No. S-3-13-7
5167 /*+BitmapScan(ti1)*/
5168 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5169 LOG:  pg_hint_plan:
5170 used hint:
5171 BitmapScan(ti1)
5172 not used hint:
5173 duplication hint:
5174 error hint:
5175
5176              QUERY PLAN              
5177 -------------------------------------
5178  Bitmap Heap Scan on ti1
5179    Recheck Cond: (c1 = 1)
5180    Filter: (ctid = '(1,1)'::tid)
5181    ->  Bitmap Index Scan on ti1_uniq
5182          Index Cond: (c1 = 1)
5183 (5 rows)
5184
5185 -- No. S-3-13-8
5186 /*+BitmapScan(ti1 ti1_pkey)*/
5187 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5188 LOG:  available indexes for BitmapScan(ti1): ti1_pkey
5189 LOG:  pg_hint_plan:
5190 used hint:
5191 BitmapScan(ti1 ti1_pkey)
5192 not used hint:
5193 duplication hint:
5194 error hint:
5195
5196              QUERY PLAN              
5197 -------------------------------------
5198  Bitmap Heap Scan on ti1
5199    Recheck Cond: (c1 = 1)
5200    Filter: (ctid = '(1,1)'::tid)
5201    ->  Bitmap Index Scan on ti1_pkey
5202          Index Cond: (c1 = 1)
5203 (5 rows)
5204
5205 -- No. S-3-13-9
5206 /*+BitmapScan(ti1 ti1_pkey ti1_btree)*/
5207 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5208 LOG:  available indexes for BitmapScan(ti1): ti1_btree ti1_pkey
5209 LOG:  pg_hint_plan:
5210 used hint:
5211 BitmapScan(ti1 ti1_pkey ti1_btree)
5212 not used hint:
5213 duplication hint:
5214 error hint:
5215
5216               QUERY PLAN              
5217 --------------------------------------
5218  Bitmap Heap Scan on ti1
5219    Recheck Cond: (c1 = 1)
5220    Filter: (ctid = '(1,1)'::tid)
5221    ->  Bitmap Index Scan on ti1_btree
5222          Index Cond: (c1 = 1)
5223 (5 rows)
5224
5225 -- No. S-3-13-10
5226 /*+TidScan(ti1)*/
5227 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5228 LOG:  pg_hint_plan:
5229 used hint:
5230 TidScan(ti1)
5231 not used hint:
5232 duplication hint:
5233 error hint:
5234
5235             QUERY PLAN             
5236 -----------------------------------
5237  Tid Scan on ti1
5238    TID Cond: (ctid = '(1,1)'::tid)
5239    Filter: (c1 = 1)
5240 (3 rows)
5241
5242 -- No. S-3-13-11
5243 /*+TidScan(ti1 ti1_pkey)*/
5244 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5245 INFO:  hint syntax error at or near ""
5246 DETAIL:  TidScan hint accepts only one relation.
5247 LOG:  pg_hint_plan:
5248 used hint:
5249 not used hint:
5250 duplication hint:
5251 error hint:
5252 TidScan(ti1 ti1_pkey)
5253
5254             QUERY PLAN             
5255 -----------------------------------
5256  Tid Scan on ti1
5257    TID Cond: (ctid = '(1,1)'::tid)
5258    Filter: (c1 = 1)
5259 (3 rows)
5260
5261 -- No. S-3-13-12
5262 /*+TidScan(ti1 ti1_pkey ti1_btree)*/
5263 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5264 INFO:  hint syntax error at or near ""
5265 DETAIL:  TidScan hint accepts only one relation.
5266 LOG:  pg_hint_plan:
5267 used hint:
5268 not used hint:
5269 duplication hint:
5270 error hint:
5271 TidScan(ti1 ti1_pkey ti1_btree)
5272
5273             QUERY PLAN             
5274 -----------------------------------
5275  Tid Scan on ti1
5276    TID Cond: (ctid = '(1,1)'::tid)
5277    Filter: (c1 = 1)
5278 (3 rows)
5279
5280 -- No. S-3-13-13
5281 /*+NoSeqScan(ti1)*/
5282 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5283 LOG:  pg_hint_plan:
5284 used hint:
5285 NoSeqScan(ti1)
5286 not used hint:
5287 duplication hint:
5288 error hint:
5289
5290             QUERY PLAN             
5291 -----------------------------------
5292  Tid Scan on ti1
5293    TID Cond: (ctid = '(1,1)'::tid)
5294    Filter: (c1 = 1)
5295 (3 rows)
5296
5297 -- No. S-3-13-14
5298 /*+NoSeqScan(ti1 ti1_pkey)*/
5299 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5300 INFO:  hint syntax error at or near ""
5301 DETAIL:  NoSeqScan hint accepts only one relation.
5302 LOG:  pg_hint_plan:
5303 used hint:
5304 not used hint:
5305 duplication hint:
5306 error hint:
5307 NoSeqScan(ti1 ti1_pkey)
5308
5309             QUERY PLAN             
5310 -----------------------------------
5311  Tid Scan on ti1
5312    TID Cond: (ctid = '(1,1)'::tid)
5313    Filter: (c1 = 1)
5314 (3 rows)
5315
5316 -- No. S-3-13-15
5317 /*+NoSeqScan(ti1 ti1_pkey ti1_btree)*/
5318 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5319 INFO:  hint syntax error at or near ""
5320 DETAIL:  NoSeqScan hint accepts only one relation.
5321 LOG:  pg_hint_plan:
5322 used hint:
5323 not used hint:
5324 duplication hint:
5325 error hint:
5326 NoSeqScan(ti1 ti1_pkey ti1_btree)
5327
5328             QUERY PLAN             
5329 -----------------------------------
5330  Tid Scan on ti1
5331    TID Cond: (ctid = '(1,1)'::tid)
5332    Filter: (c1 = 1)
5333 (3 rows)
5334
5335 -- No. S-3-13-16
5336 /*+NoIndexScan(ti1)*/
5337 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5338 LOG:  pg_hint_plan:
5339 used hint:
5340 NoIndexScan(ti1)
5341 not used hint:
5342 duplication hint:
5343 error hint:
5344
5345             QUERY PLAN             
5346 -----------------------------------
5347  Tid Scan on ti1
5348    TID Cond: (ctid = '(1,1)'::tid)
5349    Filter: (c1 = 1)
5350 (3 rows)
5351
5352 -- No. S-3-13-17
5353 /*+NoIndexScan(ti1 ti1_pkey)*/
5354 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5355 INFO:  hint syntax error at or near ""
5356 DETAIL:  NoIndexScan hint accepts only one relation.
5357 LOG:  pg_hint_plan:
5358 used hint:
5359 not used hint:
5360 duplication hint:
5361 error hint:
5362 NoIndexScan(ti1 ti1_pkey)
5363
5364             QUERY PLAN             
5365 -----------------------------------
5366  Tid Scan on ti1
5367    TID Cond: (ctid = '(1,1)'::tid)
5368    Filter: (c1 = 1)
5369 (3 rows)
5370
5371 -- No. S-3-13-18
5372 /*+NoIndexScan(ti1 ti1_pkey ti1_btree)*/
5373 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5374 INFO:  hint syntax error at or near ""
5375 DETAIL:  NoIndexScan hint accepts only one relation.
5376 LOG:  pg_hint_plan:
5377 used hint:
5378 not used hint:
5379 duplication hint:
5380 error hint:
5381 NoIndexScan(ti1 ti1_pkey ti1_btree)
5382
5383             QUERY PLAN             
5384 -----------------------------------
5385  Tid Scan on ti1
5386    TID Cond: (ctid = '(1,1)'::tid)
5387    Filter: (c1 = 1)
5388 (3 rows)
5389
5390 -- No. S-3-13-19
5391 /*+NoBitmapScan(ti1)*/
5392 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5393 LOG:  pg_hint_plan:
5394 used hint:
5395 NoBitmapScan(ti1)
5396 not used hint:
5397 duplication hint:
5398 error hint:
5399
5400             QUERY PLAN             
5401 -----------------------------------
5402  Tid Scan on ti1
5403    TID Cond: (ctid = '(1,1)'::tid)
5404    Filter: (c1 = 1)
5405 (3 rows)
5406
5407 -- No. S-3-13-20
5408 /*+NoBitmapScan(ti1 ti1_pkey)*/
5409 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5410 INFO:  hint syntax error at or near ""
5411 DETAIL:  NoBitmapScan hint accepts only one relation.
5412 LOG:  pg_hint_plan:
5413 used hint:
5414 not used hint:
5415 duplication hint:
5416 error hint:
5417 NoBitmapScan(ti1 ti1_pkey)
5418
5419             QUERY PLAN             
5420 -----------------------------------
5421  Tid Scan on ti1
5422    TID Cond: (ctid = '(1,1)'::tid)
5423    Filter: (c1 = 1)
5424 (3 rows)
5425
5426 -- No. S-3-13-21
5427 /*+NoBitmapScan(ti1 ti1_pkey ti1_btree)*/
5428 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5429 INFO:  hint syntax error at or near ""
5430 DETAIL:  NoBitmapScan hint accepts only one relation.
5431 LOG:  pg_hint_plan:
5432 used hint:
5433 not used hint:
5434 duplication hint:
5435 error hint:
5436 NoBitmapScan(ti1 ti1_pkey ti1_btree)
5437
5438             QUERY PLAN             
5439 -----------------------------------
5440  Tid Scan on ti1
5441    TID Cond: (ctid = '(1,1)'::tid)
5442    Filter: (c1 = 1)
5443 (3 rows)
5444
5445 -- No. S-3-13-22
5446 /*+NoTidScan(ti1)*/
5447 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5448 LOG:  pg_hint_plan:
5449 used hint:
5450 NoTidScan(ti1)
5451 not used hint:
5452 duplication hint:
5453 error hint:
5454
5455             QUERY PLAN            
5456 ----------------------------------
5457  Index Scan using ti1_uniq on ti1
5458    Index Cond: (c1 = 1)
5459    Filter: (ctid = '(1,1)'::tid)
5460 (3 rows)
5461
5462 -- No. S-3-13-23
5463 /*+NoTidScan(ti1 ti1_pkey)*/
5464 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5465 INFO:  hint syntax error at or near ""
5466 DETAIL:  NoTidScan hint accepts only one relation.
5467 LOG:  pg_hint_plan:
5468 used hint:
5469 not used hint:
5470 duplication hint:
5471 error hint:
5472 NoTidScan(ti1 ti1_pkey)
5473
5474             QUERY PLAN             
5475 -----------------------------------
5476  Tid Scan on ti1
5477    TID Cond: (ctid = '(1,1)'::tid)
5478    Filter: (c1 = 1)
5479 (3 rows)
5480
5481 -- No. S-3-13-24
5482 /*+NoTidScan(ti1 ti1_pkey ti1_btree)*/
5483 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5484 INFO:  hint syntax error at or near ""
5485 DETAIL:  NoTidScan hint accepts only one relation.
5486 LOG:  pg_hint_plan:
5487 used hint:
5488 not used hint:
5489 duplication hint:
5490 error hint:
5491 NoTidScan(ti1 ti1_pkey ti1_btree)
5492
5493             QUERY PLAN             
5494 -----------------------------------
5495  Tid Scan on ti1
5496    TID Cond: (ctid = '(1,1)'::tid)
5497    Filter: (c1 = 1)
5498 (3 rows)
5499
5500 -- No. S-3-13-25
5501 /*+IndexOnlyScan(ti1)*/
5502 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
5503 INFO:  hint syntax error at or near "IndexOnlyScan(ti1)"
5504 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
5505      QUERY PLAN      
5506 ---------------------
5507  Seq Scan on ti1
5508    Filter: (c1 >= 1)
5509 (2 rows)
5510
5511 -- No. S-3-13-26
5512 /*+IndexOnlyScan(ti1 ti1_pkey)*/
5513 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
5514 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_pkey)"
5515 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
5516      QUERY PLAN      
5517 ---------------------
5518  Seq Scan on ti1
5519    Filter: (c1 >= 1)
5520 (2 rows)
5521
5522 -- No. S-3-13-27
5523 /*+IndexOnlyScan(ti1 ti1_pkey ti1_btree)*/
5524 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
5525 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_pkey ti1_btree)"
5526 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
5527      QUERY PLAN      
5528 ---------------------
5529  Seq Scan on ti1
5530    Filter: (c1 >= 1)
5531 (2 rows)
5532
5533 -- No. S-3-13-28
5534 /*+NoIndexOnlyScan(ti1)*/
5535 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
5536 INFO:  hint syntax error at or near "NoIndexOnlyScan(ti1)"
5537 DETAIL:  Unrecognized hint keyword "NoIndexOnlyScan".
5538             QUERY PLAN            
5539 ----------------------------------
5540  Index Scan using ti1_uniq on ti1
5541    Index Cond: (c1 = 1)
5542 (2 rows)
5543
5544 -- No. S-3-13-29
5545 /*+NoIndexOnlyScan(ti1 ti1_pkey)*/
5546 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
5547 INFO:  hint syntax error at or near "NoIndexOnlyScan(ti1 ti1_pkey)"
5548 DETAIL:  Unrecognized hint keyword "NoIndexOnlyScan".
5549             QUERY PLAN            
5550 ----------------------------------
5551  Index Scan using ti1_uniq on ti1
5552    Index Cond: (c1 = 1)
5553 (2 rows)
5554
5555 -- No. S-3-13-30
5556 /*+NoIndexOnlyScan(ti1 ti1_pkey ti1_btree)*/
5557 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
5558 INFO:  hint syntax error at or near "NoIndexOnlyScan(ti1 ti1_pkey ti1_btree)"
5559 DETAIL:  Unrecognized hint keyword "NoIndexOnlyScan".
5560             QUERY PLAN            
5561 ----------------------------------
5562  Index Scan using ti1_uniq on ti1
5563    Index Cond: (c1 = 1)
5564 (2 rows)
5565