OSDN Git Service

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