OSDN Git Service

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