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