OSDN Git Service

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