OSDN Git Service

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