OSDN Git Service

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