OSDN Git Service

エラーメッセージの改定に伴い、リグレッションテストの予想結果を修正した。
[pghintplan/pg_hint_plan.git] / expected / ut-S-9.1.out
1 LOAD 'pg_hint_plan';
2 SET pg_hint_plan.enable_hint TO on;
3 SET pg_hint_plan.debug_print TO on;
4 SET client_min_messages TO LOG;
5 SET search_path TO public;
6 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
7      QUERY PLAN      
8 ---------------------
9  Seq Scan on t1
10    Filter: (c1 >= 1)
11 (2 rows)
12
13 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
14           QUERY PLAN          
15 ------------------------------
16  Index Scan using t1_i1 on t1
17    Index Cond: (c1 = 1)
18 (2 rows)
19
20 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
21            QUERY PLAN            
22 ---------------------------------
23  Bitmap Heap Scan on t1
24    Recheck Cond: (c3 < 10)
25    ->  Bitmap Index Scan on t1_i
26          Index Cond: (c3 < 10)
27 (4 rows)
28
29 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
30             QUERY PLAN             
31 -----------------------------------
32  Tid Scan on t1
33    TID Cond: (ctid = '(1,1)'::tid)
34    Filter: (c1 = 1)
35 (3 rows)
36
37 ----
38 ---- No. S-1-1 specified pattern of the object name
39 ----
40 -- No. S-1-1-1
41 /*+SeqScan(t1)*/
42 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
43 LOG:  pg_hint_plan:
44 used hint:
45 SeqScan(t1)
46 not used hint:
47 duplication hint:
48 error hint:
49
50      QUERY PLAN     
51 --------------------
52  Seq Scan on t1
53    Filter: (c1 = 1)
54 (2 rows)
55
56 -- No. S-1-1-2
57 /*+SeqScan(t1)*/
58 EXPLAIN (COSTS false) SELECT * FROM s1.t1 t_1 WHERE t_1.c1 = 1;
59 LOG:  pg_hint_plan:
60 used hint:
61 not used hint:
62 SeqScan(t1)
63 duplication hint:
64 error hint:
65
66             QUERY PLAN            
67 ----------------------------------
68  Index Scan using t1_i1 on t1 t_1
69    Index Cond: (c1 = 1)
70 (2 rows)
71
72 -- No. S-1-1-3
73 /*+SeqScan(t_1)*/
74 EXPLAIN (COSTS false) SELECT * FROM s1.t1 t_1 WHERE t_1.c1 = 1;
75 LOG:  pg_hint_plan:
76 used hint:
77 SeqScan(t_1)
78 not used hint:
79 duplication hint:
80 error hint:
81
82      QUERY PLAN     
83 --------------------
84  Seq Scan on t1 t_1
85    Filter: (c1 = 1)
86 (2 rows)
87
88 ----
89 ---- No. S-1-2 specified schema name in the hint option
90 ----
91 -- No. S-1-2-1
92 /*+SeqScan(t1)*/
93 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
94 LOG:  pg_hint_plan:
95 used hint:
96 SeqScan(t1)
97 not used hint:
98 duplication hint:
99 error hint:
100
101      QUERY PLAN     
102 --------------------
103  Seq Scan on t1
104    Filter: (c1 = 1)
105 (2 rows)
106
107 -- No. S-1-2-2
108 /*+SeqScan(s1.t1)*/
109 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
110 LOG:  pg_hint_plan:
111 used hint:
112 not used hint:
113 SeqScan(s1.t1)
114 duplication hint:
115 error hint:
116
117           QUERY PLAN          
118 ------------------------------
119  Index Scan using t1_i1 on t1
120    Index Cond: (c1 = 1)
121 (2 rows)
122
123 ----
124 ---- No. S-1-3 table doesn't exist in the hint option
125 ----
126 -- No. S-1-3-1
127 /*+SeqScan(t1)*/
128 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
129 LOG:  pg_hint_plan:
130 used hint:
131 SeqScan(t1)
132 not used hint:
133 duplication hint:
134 error hint:
135
136      QUERY PLAN     
137 --------------------
138  Seq Scan on t1
139    Filter: (c1 = 1)
140 (2 rows)
141
142 -- No. S-1-3-2
143 /*+SeqScan(t2)*/
144 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
145 LOG:  pg_hint_plan:
146 used hint:
147 not used hint:
148 SeqScan(t2)
149 duplication hint:
150 error hint:
151
152           QUERY PLAN          
153 ------------------------------
154  Index Scan using t1_i1 on t1
155    Index Cond: (c1 = 1)
156 (2 rows)
157
158 ----
159 ---- No. S-1-4 conflict table name
160 ----
161 -- No. S-1-4-1
162 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = 1 AND t1.c1 = t2.c1;
163              QUERY PLAN             
164 ------------------------------------
165  Nested Loop
166    ->  Index Scan using t1_i1 on t1
167          Index Cond: (c1 = 1)
168    ->  Seq Scan on t2
169          Filter: (c1 = 1)
170 (5 rows)
171
172 /*+SeqScan(t1)*/
173 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = 1 AND t1.c1 = t2.c1;
174 LOG:  pg_hint_plan:
175 used hint:
176 SeqScan(t1)
177 not used hint:
178 duplication hint:
179 error hint:
180
181         QUERY PLAN        
182 --------------------------
183  Nested Loop
184    ->  Seq Scan on t1
185          Filter: (c1 = 1)
186    ->  Seq Scan on t2
187          Filter: (c1 = 1)
188 (5 rows)
189
190 -- No. S-1-4-2
191 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = 1 AND s1.t1.c1 = s2.t1.c1;
192              QUERY PLAN             
193 ------------------------------------
194  Nested Loop
195    ->  Index Scan using t1_i1 on t1
196          Index Cond: (c1 = 1)
197    ->  Seq Scan on t1
198          Filter: (c1 = 1)
199 (5 rows)
200
201 /*+BitmapScan(t1)*/
202 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = 1 AND s1.t1.c1 = s2.t1.c1;
203 LOG:  pg_hint_plan:
204 used hint:
205 BitmapScan(t1)
206 not used hint:
207 duplication hint:
208 error hint:
209
210                 QUERY PLAN                
211 ------------------------------------------
212  Nested Loop
213    ->  Bitmap Heap Scan on t1
214          Recheck Cond: (c1 = 1)
215          ->  Bitmap Index Scan on t1_i1
216                Index Cond: (c1 = 1)
217    ->  Bitmap Heap Scan on t1
218          Recheck Cond: (c1 = 1)
219          ->  Bitmap Index Scan on t1_pkey
220                Index Cond: (c1 = 1)
221 (9 rows)
222
223 /*+BitmapScan(t1)*/
224 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = 1 AND s1.t1.c1 = s2t1.c1;
225 LOG:  pg_hint_plan:
226 used hint:
227 BitmapScan(t1)
228 not used hint:
229 duplication hint:
230 error hint:
231
232                QUERY PLAN               
233 ----------------------------------------
234  Nested Loop
235    ->  Bitmap Heap Scan on t1
236          Recheck Cond: (c1 = 1)
237          ->  Bitmap Index Scan on t1_i1
238                Index Cond: (c1 = 1)
239    ->  Seq Scan on t1 s2t1
240          Filter: (c1 = 1)
241 (7 rows)
242
243 /*+BitmapScan(s2t1)*/
244 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = 1 AND s1.t1.c1 = s2t1.c1;
245 LOG:  pg_hint_plan:
246 used hint:
247 BitmapScan(s2t1)
248 not used hint:
249 duplication hint:
250 error hint:
251
252                 QUERY PLAN                
253 ------------------------------------------
254  Nested Loop
255    ->  Index Scan using t1_i1 on t1
256          Index Cond: (c1 = 1)
257    ->  Bitmap Heap Scan on t1 s2t1
258          Recheck Cond: (c1 = 1)
259          ->  Bitmap Index Scan on t1_pkey
260                Index Cond: (c1 = 1)
261 (7 rows)
262
263 -- No. S-1-4-3
264 EXPLAIN (COSTS false) SELECT (SELECT max(c1) FROM s1.t1 WHERE s1.t1.c1 = 1) FROM s1.t1 WHERE s1.t1.c1 = 1;
265                              QUERY PLAN                              
266 ---------------------------------------------------------------------
267  Index Scan using t1_i1 on t1
268    Index Cond: (c1 = 1)
269    InitPlan 2 (returns $1)
270      ->  Result
271            InitPlan 1 (returns $0)
272              ->  Limit
273                    ->  Index Scan using t1_i1 on t1
274                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
275 (8 rows)
276
277 /*+BitmapScan(t1)*/
278 EXPLAIN (COSTS false) SELECT (SELECT max(c1) FROM s1.t1 WHERE s1.t1.c1 = 1) FROM s1.t1 WHERE s1.t1.c1 = 1;
279 LOG:  pg_hint_plan:
280 used hint:
281 BitmapScan(t1)
282 not used hint:
283 duplication hint:
284 error hint:
285
286                                 QUERY PLAN                                 
287 ---------------------------------------------------------------------------
288  Bitmap Heap Scan on t1
289    Recheck Cond: (c1 = 1)
290    InitPlan 2 (returns $1)
291      ->  Result
292            InitPlan 1 (returns $0)
293              ->  Limit
294                    ->  Bitmap Heap Scan on t1
295                          Recheck Cond: ((c1 IS NOT NULL) AND (c1 = 1))
296                          ->  Bitmap Index Scan on t1_i1
297                                Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
298    ->  Bitmap Index Scan on t1_i1
299          Index Cond: (c1 = 1)
300 (12 rows)
301
302 /*+BitmapScan(t11)*/
303 EXPLAIN (COSTS false) SELECT (SELECT max(c1) FROM s1.t1 t11 WHERE t11.c1 = 1) FROM s1.t1 t12 WHERE t12.c1 = 1;
304 LOG:  pg_hint_plan:
305 used hint:
306 BitmapScan(t11)
307 not used hint:
308 duplication hint:
309 error hint:
310
311                                 QUERY PLAN                                 
312 ---------------------------------------------------------------------------
313  Index Scan using t1_i1 on t1 t12
314    Index Cond: (c1 = 1)
315    InitPlan 2 (returns $1)
316      ->  Result
317            InitPlan 1 (returns $0)
318              ->  Limit
319                    ->  Bitmap Heap Scan on t1 t11
320                          Recheck Cond: ((c1 IS NOT NULL) AND (c1 = 1))
321                          ->  Bitmap Index Scan on t1_i1
322                                Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
323 (10 rows)
324
325 /*+BitmapScan(t12)*/
326 EXPLAIN (COSTS false) SELECT (SELECT max(c1) FROM s1.t1 t11 WHERE t11.c1 = 1) FROM s1.t1 t12 WHERE t12.c1 = 1;
327 LOG:  pg_hint_plan:
328 used hint:
329 BitmapScan(t12)
330 not used hint:
331 duplication hint:
332 error hint:
333
334                              QUERY PLAN                              
335 ---------------------------------------------------------------------
336  Bitmap Heap Scan on t1 t12
337    Recheck Cond: (c1 = 1)
338    InitPlan 2 (returns $1)
339      ->  Result
340            InitPlan 1 (returns $0)
341              ->  Limit
342                    ->  Index Scan using t1_i1 on t1 t11
343                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
344    ->  Bitmap Index Scan on t1_i1
345          Index Cond: (c1 = 1)
346 (10 rows)
347
348 ----
349 ---- No. S-1-5 object type for the hint
350 ----
351 -- No. S-1-5-1
352 /*+SeqScan(t1)*/
353 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
354 LOG:  pg_hint_plan:
355 used hint:
356 SeqScan(t1)
357 not used hint:
358 duplication hint:
359 error hint:
360
361      QUERY PLAN     
362 --------------------
363  Seq Scan on t1
364    Filter: (c1 = 1)
365 (2 rows)
366
367 -- No. S-1-5-2
368 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE p1.c1 = 1;
369            QUERY PLAN            
370 ---------------------------------
371  Result
372    ->  Append
373          ->  Seq Scan on p1
374                Filter: (c1 = 1)
375          ->  Seq Scan on p1c1 p1
376                Filter: (c1 = 1)
377 (6 rows)
378
379 /*+IndexScan(p1)*/
380 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE p1.c1 = 1;
381 LOG:  pg_hint_plan:
382 used hint:
383 IndexScan(p1)
384 not used hint:
385 duplication hint:
386 error hint:
387
388                    QUERY PLAN                   
389 ------------------------------------------------
390  Result
391    ->  Append
392          ->  Index Scan using p1_i on p1
393                Index Cond: (c1 = 1)
394          ->  Index Scan using p1c1_i on p1c1 p1
395                Index Cond: (c1 = 1)
396 (6 rows)
397
398 -- No. S-1-5-3
399 EXPLAIN (COSTS false) SELECT * FROM s1.ul1 WHERE ul1.c1 = 1;
400             QUERY PLAN            
401 ----------------------------------
402  Index Scan using ul1_pkey on ul1
403    Index Cond: (c1 = 1)
404 (2 rows)
405
406 /*+SeqScan(ul1)*/
407 EXPLAIN (COSTS false) SELECT * FROM s1.ul1 WHERE ul1.c1 = 1;
408 LOG:  pg_hint_plan:
409 used hint:
410 SeqScan(ul1)
411 not used hint:
412 duplication hint:
413 error hint:
414
415      QUERY PLAN     
416 --------------------
417  Seq Scan on ul1
418    Filter: (c1 = 1)
419 (2 rows)
420
421 -- No. S-1-5-4
422 CREATE TEMP TABLE tm1 (LIKE s1.t1 INCLUDING ALL);
423 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "tm1_pkey" for table "tm1"
424 EXPLAIN (COSTS false) SELECT * FROM tm1 WHERE tm1.c1 = 1;
425             QUERY PLAN            
426 ----------------------------------
427  Index Scan using tm1_pkey on tm1
428    Index Cond: (c1 = 1)
429 (2 rows)
430
431 /*+SeqScan(tm1)*/
432 EXPLAIN (COSTS false) SELECT * FROM tm1 WHERE tm1.c1 = 1;
433 LOG:  pg_hint_plan:
434 used hint:
435 SeqScan(tm1)
436 not used hint:
437 duplication hint:
438 error hint:
439
440      QUERY PLAN     
441 --------------------
442  Seq Scan on tm1
443    Filter: (c1 = 1)
444 (2 rows)
445
446 -- No. S-1-5-5
447 EXPLAIN (COSTS false) SELECT * FROM pg_catalog.pg_class WHERE oid = 1;
448                    QUERY PLAN                    
449 -------------------------------------------------
450  Index Scan using pg_class_oid_index on pg_class
451    Index Cond: (oid = 1::oid)
452 (2 rows)
453
454 /*+SeqScan(pg_class)*/
455 EXPLAIN (COSTS false) SELECT * FROM pg_catalog.pg_class WHERE oid = 1;
456 LOG:  pg_hint_plan:
457 used hint:
458 SeqScan(pg_class)
459 not used hint:
460 duplication hint:
461 error hint:
462
463         QUERY PLAN        
464 --------------------------
465  Seq Scan on pg_class
466    Filter: (oid = 1::oid)
467 (2 rows)
468
469 -- No. S-1-5-6
470 -- refer ut-fdw.sql
471 -- No. S-1-5-7
472 EXPLAIN (COSTS false) SELECT * FROM s1.f1() AS ft1 WHERE ft1.c1 = 1;
473        QUERY PLAN        
474 -------------------------
475  Function Scan on f1 ft1
476    Filter: (c1 = 1)
477 (2 rows)
478
479 /*+SeqScan(ft1)*/
480 EXPLAIN (COSTS false) SELECT * FROM s1.f1() AS ft1 WHERE ft1.c1 = 1;
481 LOG:  pg_hint_plan:
482 used hint:
483 not used hint:
484 SeqScan(ft1)
485 duplication hint:
486 error hint:
487
488        QUERY PLAN        
489 -------------------------
490  Function Scan on f1 ft1
491    Filter: (c1 = 1)
492 (2 rows)
493
494 -- No. S-1-5-8
495 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS val1 (c1, c2, c3, c4) WHERE val1.c1 = 1;
496         QUERY PLAN         
497 ---------------------------
498  Values Scan on "*VALUES*"
499    Filter: (column1 = 1)
500 (2 rows)
501
502 /*+SeqScan(val1)*/
503 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS val1 (c1, c2, c3, c4) WHERE val1.c1 = 1;
504 LOG:  pg_hint_plan:
505 used hint:
506 not used hint:
507 SeqScan(val1)
508 duplication hint:
509 error hint:
510
511         QUERY PLAN         
512 ---------------------------
513  Values Scan on "*VALUES*"
514    Filter: (column1 = 1)
515 (2 rows)
516
517 /*+SeqScan(*VALUES*)*/
518 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS val1 (c1, c2, c3, c4) WHERE val1.c1 = 1;
519 LOG:  pg_hint_plan:
520 used hint:
521 not used hint:
522 SeqScan(*VALUES*)
523 duplication hint:
524 error hint:
525
526         QUERY PLAN         
527 ---------------------------
528  Values Scan on "*VALUES*"
529    Filter: (column1 = 1)
530 (2 rows)
531
532 -- No. S-1-5-9
533 EXPLAIN (COSTS false) WITH c1(c1) AS (SELECT max(c1) FROM s1.t1 WHERE t1.c1 = 1)
534 SELECT * FROM s1.t1, c1 WHERE t1.c1 = 1 AND t1.c1 = c1.c1;
535                              QUERY PLAN                              
536 ---------------------------------------------------------------------
537  Nested Loop
538    CTE c1
539      ->  Result
540            InitPlan 1 (returns $0)
541              ->  Limit
542                    ->  Index Scan using t1_i1 on t1
543                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
544    ->  Index Scan using t1_i1 on t1
545          Index Cond: (c1 = 1)
546    ->  CTE Scan on c1
547          Filter: (c1 = 1)
548 (11 rows)
549
550 /*+SeqScan(c1)*/
551 EXPLAIN (COSTS false) WITH c1(c1) AS (SELECT max(c1) FROM s1.t1 WHERE t1.c1 = 1)
552 SELECT * FROM s1.t1, c1 WHERE t1.c1 = 1 AND t1.c1 = c1.c1;
553 LOG:  pg_hint_plan:
554 used hint:
555 not used hint:
556 SeqScan(c1)
557 duplication hint:
558 error hint:
559
560                              QUERY PLAN                              
561 ---------------------------------------------------------------------
562  Nested Loop
563    CTE c1
564      ->  Result
565            InitPlan 1 (returns $0)
566              ->  Limit
567                    ->  Index Scan using t1_i1 on t1
568                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
569    ->  Index Scan using t1_i1 on t1
570          Index Cond: (c1 = 1)
571    ->  CTE Scan on c1
572          Filter: (c1 = 1)
573 (11 rows)
574
575 -- No. S-1-5-10
576 EXPLAIN (COSTS false) SELECT * FROM s1.v1 WHERE v1.c1 = 1;
577             QUERY PLAN             
578 -----------------------------------
579  Index Scan using t1_i1 on t1 v1t1
580    Index Cond: (c1 = 1)
581 (2 rows)
582
583 /*+SeqScan(v1)*/
584 EXPLAIN (COSTS false) SELECT * FROM s1.v1 WHERE v1.c1 = 1;
585 LOG:  pg_hint_plan:
586 used hint:
587 not used hint:
588 SeqScan(v1)
589 duplication hint:
590 error hint:
591
592             QUERY PLAN             
593 -----------------------------------
594  Index Scan using t1_i1 on t1 v1t1
595    Index Cond: (c1 = 1)
596 (2 rows)
597
598 -- No. S-1-5-11
599 EXPLAIN (COSTS false) SELECT * FROM (SELECT * FROM s1.t1 WHERE t1.c1 = 1) AS s1 WHERE s1.c1 = 1;
600           QUERY PLAN          
601 ------------------------------
602  Index Scan using t1_i1 on t1
603    Index Cond: (c1 = 1)
604 (2 rows)
605
606 /*+SeqScan(s1)*/
607 EXPLAIN (COSTS false) SELECT * FROM (SELECT * FROM s1.t1 WHERE t1.c1 = 1) AS s1 WHERE s1.c1 = 1;
608 LOG:  pg_hint_plan:
609 used hint:
610 not used hint:
611 SeqScan(s1)
612 duplication hint:
613 error hint:
614
615           QUERY PLAN          
616 ------------------------------
617  Index Scan using t1_i1 on t1
618    Index Cond: (c1 = 1)
619 (2 rows)
620
621 ----
622 ---- No. S-2-1 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 ""
2837 DETAIL:  SeqScan hint accepts only one relation.
2838 LOG:  pg_hint_plan:
2839 used hint:
2840 not used hint:
2841 duplication hint:
2842 error hint:
2843 SeqScan(t1 t2)
2844
2845                         QUERY PLAN                        
2846 ----------------------------------------------------------
2847  Nested Loop
2848    Join Filter: ("*VALUES*".column1 = "*VALUES*".column1)
2849    ->  Values Scan on "*VALUES*"
2850    ->  Values Scan on "*VALUES*"
2851 (4 rows)
2852
2853 /*+SeqScan(*VALUES*)*/
2854 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;
2855 LOG:  pg_hint_plan:
2856 used hint:
2857 not used hint:
2858 SeqScan(*VALUES*)
2859 duplication hint:
2860 error hint:
2861
2862                         QUERY PLAN                        
2863 ----------------------------------------------------------
2864  Nested Loop
2865    Join Filter: ("*VALUES*".column1 = "*VALUES*".column1)
2866    ->  Values Scan on "*VALUES*"
2867    ->  Values Scan on "*VALUES*"
2868 (4 rows)
2869
2870 ----
2871 ---- No. S-3-1 scan method hint
2872 ----
2873 -- No. S-3-1-1
2874 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
2875      QUERY PLAN      
2876 ---------------------
2877  Seq Scan on t1
2878    Filter: (c1 >= 1)
2879 (2 rows)
2880
2881 /*+SeqScan(t1)*/
2882 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
2883 LOG:  pg_hint_plan:
2884 used hint:
2885 SeqScan(t1)
2886 not used hint:
2887 duplication hint:
2888 error hint:
2889
2890      QUERY PLAN      
2891 ---------------------
2892  Seq Scan on t1
2893    Filter: (c1 >= 1)
2894 (2 rows)
2895
2896 -- No. S-3-1-2
2897 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2898           QUERY PLAN          
2899 ------------------------------
2900  Index Scan using t1_i1 on t1
2901    Index Cond: (c1 = 1)
2902 (2 rows)
2903
2904 /*+SeqScan(t1)*/
2905 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2906 LOG:  pg_hint_plan:
2907 used hint:
2908 SeqScan(t1)
2909 not used hint:
2910 duplication hint:
2911 error hint:
2912
2913      QUERY PLAN     
2914 --------------------
2915  Seq Scan on t1
2916    Filter: (c1 = 1)
2917 (2 rows)
2918
2919 -- No. S-3-1-3
2920 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2921           QUERY PLAN          
2922 ------------------------------
2923  Index Scan using t1_i1 on t1
2924    Index Cond: (c1 = 1)
2925 (2 rows)
2926
2927 /*+IndexScan(t1)*/
2928 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2929 LOG:  pg_hint_plan:
2930 used hint:
2931 IndexScan(t1)
2932 not used hint:
2933 duplication hint:
2934 error hint:
2935
2936           QUERY PLAN          
2937 ------------------------------
2938  Index Scan using t1_i1 on t1
2939    Index Cond: (c1 = 1)
2940 (2 rows)
2941
2942 -- No. S-3-1-4
2943 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
2944      QUERY PLAN      
2945 ---------------------
2946  Seq Scan on t1
2947    Filter: (c1 >= 1)
2948 (2 rows)
2949
2950 /*+IndexScan(t1)*/
2951 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
2952 LOG:  pg_hint_plan:
2953 used hint:
2954 IndexScan(t1)
2955 not used hint:
2956 duplication hint:
2957 error hint:
2958
2959           QUERY PLAN          
2960 ------------------------------
2961  Index Scan using t1_i1 on t1
2962    Index Cond: (c1 >= 1)
2963 (2 rows)
2964
2965 -- No. S-3-1-5
2966 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
2967            QUERY PLAN            
2968 ---------------------------------
2969  Bitmap Heap Scan on t1
2970    Recheck Cond: (c3 < 10)
2971    ->  Bitmap Index Scan on t1_i
2972          Index Cond: (c3 < 10)
2973 (4 rows)
2974
2975 /*+BitmapScan(t1)*/
2976 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
2977 LOG:  pg_hint_plan:
2978 used hint:
2979 BitmapScan(t1)
2980 not used hint:
2981 duplication hint:
2982 error hint:
2983
2984            QUERY PLAN            
2985 ---------------------------------
2986  Bitmap Heap Scan on t1
2987    Recheck Cond: (c3 < 10)
2988    ->  Bitmap Index Scan on t1_i
2989          Index Cond: (c3 < 10)
2990 (4 rows)
2991
2992 -- No. S-3-1-6
2993 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2994           QUERY PLAN          
2995 ------------------------------
2996  Index Scan using t1_i1 on t1
2997    Index Cond: (c1 = 1)
2998 (2 rows)
2999
3000 /*+BitmapScan(t1)*/
3001 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3002 LOG:  pg_hint_plan:
3003 used hint:
3004 BitmapScan(t1)
3005 not used hint:
3006 duplication hint:
3007 error hint:
3008
3009             QUERY PLAN            
3010 ----------------------------------
3011  Bitmap Heap Scan on t1
3012    Recheck Cond: (c1 = 1)
3013    ->  Bitmap Index Scan on t1_i1
3014          Index Cond: (c1 = 1)
3015 (4 rows)
3016
3017 -- No. S-3-1-7
3018 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3019             QUERY PLAN             
3020 -----------------------------------
3021  Tid Scan on t1
3022    TID Cond: (ctid = '(1,1)'::tid)
3023    Filter: (c1 = 1)
3024 (3 rows)
3025
3026 /*+TidScan(t1)*/
3027 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3028 LOG:  pg_hint_plan:
3029 used hint:
3030 TidScan(t1)
3031 not used hint:
3032 duplication hint:
3033 error hint:
3034
3035             QUERY PLAN             
3036 -----------------------------------
3037  Tid Scan on t1
3038    TID Cond: (ctid = '(1,1)'::tid)
3039    Filter: (c1 = 1)
3040 (3 rows)
3041
3042 -- No. S-3-1-8
3043 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid IN ('(1,1)', '(2,2)', '(3,3)');
3044                          QUERY PLAN                          
3045 -------------------------------------------------------------
3046  Index Scan using t1_i1 on t1
3047    Index Cond: (c1 = 1)
3048    Filter: (ctid = ANY ('{"(1,1)","(2,2)","(3,3)"}'::tid[]))
3049 (3 rows)
3050
3051 /*+TidScan(t1)*/
3052 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid IN ('(1,1)', '(2,2)', '(3,3)');
3053 LOG:  pg_hint_plan:
3054 used hint:
3055 TidScan(t1)
3056 not used hint:
3057 duplication hint:
3058 error hint:
3059
3060                           QUERY PLAN                           
3061 ---------------------------------------------------------------
3062  Tid Scan on t1
3063    TID Cond: (ctid = ANY ('{"(1,1)","(2,2)","(3,3)"}'::tid[]))
3064    Filter: (c1 = 1)
3065 (3 rows)
3066
3067 -- No. S-3-1-9
3068 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3069      QUERY PLAN      
3070 ---------------------
3071  Seq Scan on t1
3072    Filter: (c1 >= 1)
3073 (2 rows)
3074
3075 /*+NoSeqScan(t1)*/
3076 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3077 LOG:  pg_hint_plan:
3078 used hint:
3079 NoSeqScan(t1)
3080 not used hint:
3081 duplication hint:
3082 error hint:
3083
3084           QUERY PLAN          
3085 ------------------------------
3086  Index Scan using t1_i1 on t1
3087    Index Cond: (c1 >= 1)
3088 (2 rows)
3089
3090 -- No. S-3-1-10
3091 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3092           QUERY PLAN          
3093 ------------------------------
3094  Index Scan using t1_i1 on t1
3095    Index Cond: (c1 = 1)
3096 (2 rows)
3097
3098 /*+NoSeqScan(t1)*/
3099 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3100 LOG:  pg_hint_plan:
3101 used hint:
3102 NoSeqScan(t1)
3103 not used hint:
3104 duplication hint:
3105 error hint:
3106
3107           QUERY PLAN          
3108 ------------------------------
3109  Index Scan using t1_i1 on t1
3110    Index Cond: (c1 = 1)
3111 (2 rows)
3112
3113 -- No. S-3-1-11
3114 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3115           QUERY PLAN          
3116 ------------------------------
3117  Index Scan using t1_i1 on t1
3118    Index Cond: (c1 = 1)
3119 (2 rows)
3120
3121 /*+NoIndexScan(t1)*/
3122 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3123 LOG:  pg_hint_plan:
3124 used hint:
3125 NoIndexScan(t1)
3126 not used hint:
3127 duplication hint:
3128 error hint:
3129
3130             QUERY PLAN            
3131 ----------------------------------
3132  Bitmap Heap Scan on t1
3133    Recheck Cond: (c1 = 1)
3134    ->  Bitmap Index Scan on t1_i1
3135          Index Cond: (c1 = 1)
3136 (4 rows)
3137
3138 -- No. S-3-1-12
3139 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3140      QUERY PLAN      
3141 ---------------------
3142  Seq Scan on t1
3143    Filter: (c1 >= 1)
3144 (2 rows)
3145
3146 /*+NoIndexScan(t1)*/
3147 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3148 LOG:  pg_hint_plan:
3149 used hint:
3150 NoIndexScan(t1)
3151 not used hint:
3152 duplication hint:
3153 error hint:
3154
3155      QUERY PLAN      
3156 ---------------------
3157  Seq Scan on t1
3158    Filter: (c1 >= 1)
3159 (2 rows)
3160
3161 -- No. S-3-1-13
3162 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
3163            QUERY PLAN            
3164 ---------------------------------
3165  Bitmap Heap Scan on t1
3166    Recheck Cond: (c3 < 10)
3167    ->  Bitmap Index Scan on t1_i
3168          Index Cond: (c3 < 10)
3169 (4 rows)
3170
3171 /*+NoBitmapScan(t1)*/
3172 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
3173 LOG:  pg_hint_plan:
3174 used hint:
3175 NoBitmapScan(t1)
3176 not used hint:
3177 duplication hint:
3178 error hint:
3179
3180      QUERY PLAN      
3181 ---------------------
3182  Seq Scan on t1
3183    Filter: (c3 < 10)
3184 (2 rows)
3185
3186 -- No. S-3-1-14
3187 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3188           QUERY PLAN          
3189 ------------------------------
3190  Index Scan using t1_i1 on t1
3191    Index Cond: (c1 = 1)
3192 (2 rows)
3193
3194 /*+NoBitmapScan(t1)*/
3195 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3196 LOG:  pg_hint_plan:
3197 used hint:
3198 NoBitmapScan(t1)
3199 not used hint:
3200 duplication hint:
3201 error hint:
3202
3203           QUERY PLAN          
3204 ------------------------------
3205  Index Scan using t1_i1 on t1
3206    Index Cond: (c1 = 1)
3207 (2 rows)
3208
3209 -- No. S-3-1-15
3210 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3211             QUERY PLAN             
3212 -----------------------------------
3213  Tid Scan on t1
3214    TID Cond: (ctid = '(1,1)'::tid)
3215    Filter: (c1 = 1)
3216 (3 rows)
3217
3218 /*+NoTidScan(t1)*/
3219 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3220 LOG:  pg_hint_plan:
3221 used hint:
3222 NoTidScan(t1)
3223 not used hint:
3224 duplication hint:
3225 error hint:
3226
3227            QUERY PLAN            
3228 ---------------------------------
3229  Index Scan using t1_i1 on t1
3230    Index Cond: (c1 = 1)
3231    Filter: (ctid = '(1,1)'::tid)
3232 (3 rows)
3233
3234 -- No. S-3-1-16
3235 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3236           QUERY PLAN          
3237 ------------------------------
3238  Index Scan using t1_i1 on t1
3239    Index Cond: (c1 = 1)
3240 (2 rows)
3241
3242 /*+NoTidScan(t1)*/
3243 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3244 LOG:  pg_hint_plan:
3245 used hint:
3246 NoTidScan(t1)
3247 not used hint:
3248 duplication hint:
3249 error hint:
3250
3251           QUERY PLAN          
3252 ------------------------------
3253  Index Scan using t1_i1 on t1
3254    Index Cond: (c1 = 1)
3255 (2 rows)
3256
3257 -- No. S-3-1-17
3258 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
3259           QUERY PLAN          
3260 ------------------------------
3261  Index Scan using t1_i1 on t1
3262    Index Cond: (c1 = 1)
3263 (2 rows)
3264
3265 /*+IndexOnlyScan(t1)*/
3266 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
3267 INFO:  hint syntax error at or near "IndexOnlyScan(t1)"
3268 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
3269           QUERY PLAN          
3270 ------------------------------
3271  Index Scan using t1_i1 on t1
3272    Index Cond: (c1 = 1)
3273 (2 rows)
3274
3275 -- No. S-3-1-18
3276 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 >= 1;
3277      QUERY PLAN      
3278 ---------------------
3279  Seq Scan on t1
3280    Filter: (c1 >= 1)
3281 (2 rows)
3282
3283 /*+IndexOnlyScan(t1)*/
3284 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 >= 1;
3285 INFO:  hint syntax error at or near "IndexOnlyScan(t1)"
3286 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
3287      QUERY PLAN      
3288 ---------------------
3289  Seq Scan on t1
3290    Filter: (c1 >= 1)
3291 (2 rows)
3292
3293 -- No. S-3-1-19
3294 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
3295           QUERY PLAN          
3296 ------------------------------
3297  Index Scan using t1_i1 on t1
3298    Index Cond: (c1 = 1)
3299 (2 rows)
3300
3301 /*+NoIndexOnlyScan(t1)*/
3302 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
3303 INFO:  hint syntax error at or near "NoIndexOnlyScan(t1)"
3304 DETAIL:  Unrecognized hint keyword "NoIndexOnlyScan".
3305           QUERY PLAN          
3306 ------------------------------
3307  Index Scan using t1_i1 on t1
3308    Index Cond: (c1 = 1)
3309 (2 rows)
3310
3311 -- No. S-3-1-20
3312 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 >= 1;
3313      QUERY PLAN      
3314 ---------------------
3315  Seq Scan on t1
3316    Filter: (c1 >= 1)
3317 (2 rows)
3318
3319 /*+NoIndexOnlyScan(t1)*/
3320 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 >= 1;
3321 INFO:  hint syntax error at or near "NoIndexOnlyScan(t1)"
3322 DETAIL:  Unrecognized hint keyword "NoIndexOnlyScan".
3323      QUERY PLAN      
3324 ---------------------
3325  Seq Scan on t1
3326    Filter: (c1 >= 1)
3327 (2 rows)
3328
3329 ----
3330 ---- No. S-3-3 index name specified
3331 ----
3332 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3333             QUERY PLAN             
3334 -----------------------------------
3335  Tid Scan on ti1
3336    TID Cond: (ctid = '(1,1)'::tid)
3337    Filter: (c2 = 1)
3338 (3 rows)
3339
3340 SET enable_tidscan TO off;
3341 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3342            QUERY PLAN            
3343 ---------------------------------
3344  Index Scan using ti1_i2 on ti1
3345    Index Cond: (c2 = 1)
3346    Filter: (ctid = '(1,1)'::tid)
3347 (3 rows)
3348
3349 SET enable_indexscan TO off;
3350 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3351             QUERY PLAN             
3352 -----------------------------------
3353  Bitmap Heap Scan on ti1
3354    Recheck Cond: (c2 = 1)
3355    Filter: (ctid = '(1,1)'::tid)
3356    ->  Bitmap Index Scan on ti1_i2
3357          Index Cond: (c2 = 1)
3358 (5 rows)
3359
3360 RESET enable_tidscan;
3361 RESET enable_indexscan;
3362 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE ti1.c2 >= 1;
3363      QUERY PLAN      
3364 ---------------------
3365  Seq Scan on ti1
3366    Filter: (c2 >= 1)
3367 (2 rows)
3368
3369 -- No. S-3-3-1
3370 /*+IndexScan(ti1 ti1_i3)*/
3371 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3372 LOG:  pg_hint_plan:
3373 used hint:
3374 IndexScan(ti1 ti1_i3)
3375 not used hint:
3376 duplication hint:
3377 error hint:
3378
3379            QUERY PLAN            
3380 ---------------------------------
3381  Index Scan using ti1_i3 on ti1
3382    Index Cond: (c2 = 1)
3383    Filter: (ctid = '(1,1)'::tid)
3384 (3 rows)
3385
3386 -- No. S-3-3-2
3387 /*+IndexScan(ti1 ti1_i3 ti1_i2)*/
3388 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3389 LOG:  pg_hint_plan:
3390 used hint:
3391 IndexScan(ti1 ti1_i3 ti1_i2)
3392 not used hint:
3393 duplication hint:
3394 error hint:
3395
3396            QUERY PLAN            
3397 ---------------------------------
3398  Index Scan using ti1_i2 on ti1
3399    Index Cond: (c2 = 1)
3400    Filter: (ctid = '(1,1)'::tid)
3401 (3 rows)
3402
3403 -- No. S-3-3-3
3404 /*+IndexScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)*/
3405 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3406 LOG:  pg_hint_plan:
3407 used hint:
3408 IndexScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)
3409 not used hint:
3410 duplication hint:
3411 error hint:
3412
3413            QUERY PLAN            
3414 ---------------------------------
3415  Index Scan using ti1_i2 on ti1
3416    Index Cond: (c2 = 1)
3417    Filter: (ctid = '(1,1)'::tid)
3418 (3 rows)
3419
3420 -- No. S-3-3-4
3421 /*+BitmapScan(ti1 ti1_i3)*/
3422 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3423 LOG:  pg_hint_plan:
3424 used hint:
3425 BitmapScan(ti1 ti1_i3)
3426 not used hint:
3427 duplication hint:
3428 error hint:
3429
3430             QUERY PLAN             
3431 -----------------------------------
3432  Bitmap Heap Scan on ti1
3433    Recheck Cond: (c2 = 1)
3434    Filter: (ctid = '(1,1)'::tid)
3435    ->  Bitmap Index Scan on ti1_i3
3436          Index Cond: (c2 = 1)
3437 (5 rows)
3438
3439 -- No. S-3-3-5
3440 /*+BitmapScan(ti1 ti1_i3 ti1_i2)*/
3441 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3442 LOG:  pg_hint_plan:
3443 used hint:
3444 BitmapScan(ti1 ti1_i3 ti1_i2)
3445 not used hint:
3446 duplication hint:
3447 error hint:
3448
3449             QUERY PLAN             
3450 -----------------------------------
3451  Bitmap Heap Scan on ti1
3452    Recheck Cond: (c2 = 1)
3453    Filter: (ctid = '(1,1)'::tid)
3454    ->  Bitmap Index Scan on ti1_i2
3455          Index Cond: (c2 = 1)
3456 (5 rows)
3457
3458 -- No. S-3-3-6
3459 /*+BitmapScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)*/
3460 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3461 LOG:  pg_hint_plan:
3462 used hint:
3463 BitmapScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)
3464 not used hint:
3465 duplication hint:
3466 error hint:
3467
3468             QUERY PLAN             
3469 -----------------------------------
3470  Bitmap Heap Scan on ti1
3471    Recheck Cond: (c2 = 1)
3472    Filter: (ctid = '(1,1)'::tid)
3473    ->  Bitmap Index Scan on ti1_i2
3474          Index Cond: (c2 = 1)
3475 (5 rows)
3476
3477 -- No. S-3-3-7
3478 /*+IndexOnlyScan(ti1 ti1_i3)*/
3479 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE ti1.c2 >= 1;
3480 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_i3)"
3481 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
3482      QUERY PLAN      
3483 ---------------------
3484  Seq Scan on ti1
3485    Filter: (c2 >= 1)
3486 (2 rows)
3487
3488 -- No. S-3-3-8
3489 /*+IndexOnlyScan(ti1 ti1_i3 ti1_i2)*/
3490 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE ti1.c2 >= 1;
3491 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_i3 ti1_i2)"
3492 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
3493      QUERY PLAN      
3494 ---------------------
3495  Seq Scan on ti1
3496    Filter: (c2 >= 1)
3497 (2 rows)
3498
3499 -- No. S-3-3-9
3500 /*+IndexOnlyScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)*/
3501 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE ti1.c2 >= 1;
3502 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)"
3503 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
3504      QUERY PLAN      
3505 ---------------------
3506  Seq Scan on ti1
3507    Filter: (c2 >= 1)
3508 (2 rows)
3509
3510 ----
3511 ---- No. S-3-4 index type
3512 ----
3513 \d s1.ti1
3514         Table "s1.ti1"
3515  Column |  Type   | Modifiers 
3516 --------+---------+-----------
3517  c1     | integer | not null
3518  c2     | integer | 
3519  c3     | integer | 
3520  c4     | text    | 
3521 Indexes:
3522     "ti1_pkey" PRIMARY KEY, btree (c1)
3523     "ti1_c2_key" UNIQUE CONSTRAINT, btree (c2)
3524     "ti1_uniq" UNIQUE, btree (c1)
3525     "ti1_btree" btree (c1)
3526     "ti1_expr" btree ((c1 < 100))
3527     "ti1_gin" gin (c1)
3528     "ti1_gist" gist (c1)
3529     "ti1_hash" hash (c1)
3530     "ti1_i1" btree (c2)
3531     "ti1_i2" btree (c2, c4)
3532     "ti1_i3" btree (c2, c4, c4)
3533     "ti1_i4" btree (c2, c4, c4, c4)
3534     "ti1_multi" btree (c1, c2, c3, c4)
3535     "ti1_pred" btree (lower(c4))
3536     "ti1_ts" gin (to_tsvector('english'::regconfig, c4))
3537
3538 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)';
3539                                                                QUERY PLAN                                                                
3540 -----------------------------------------------------------------------------------------------------------------------------------------
3541  Tid Scan on ti1
3542    TID Cond: (ctid = '(1,1)'::tid)
3543    Filter: ((c1 < 100) AND (c2 = 1) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3544 (3 rows)
3545
3546 -- No. S-3-4-1
3547 /*+IndexScan(ti1 ti1_btree)*/
3548 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)';
3549 LOG:  pg_hint_plan:
3550 used hint:
3551 IndexScan(ti1 ti1_btree)
3552 not used hint:
3553 duplication hint:
3554 error hint:
3555
3556                                                                      QUERY PLAN                                                                     
3557 ----------------------------------------------------------------------------------------------------------------------------------------------------
3558  Index Scan using ti1_btree on ti1
3559    Index Cond: (c1 < 100)
3560    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3561 (3 rows)
3562
3563 -- No. S-3-4-2
3564 /*+IndexScan(ti1 ti1_hash)*/
3565 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)';
3566 LOG:  pg_hint_plan:
3567 used hint:
3568 IndexScan(ti1 ti1_hash)
3569 not used hint:
3570 duplication hint:
3571 error hint:
3572
3573                                                                      QUERY PLAN                                                                     
3574 ----------------------------------------------------------------------------------------------------------------------------------------------------
3575  Index Scan using ti1_hash on ti1
3576    Index Cond: (c1 = 100)
3577    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3578 (3 rows)
3579
3580 -- No. S-3-4-3
3581 /*+IndexScan(ti1 ti1_gist)*/
3582 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)';
3583 LOG:  pg_hint_plan:
3584 used hint:
3585 IndexScan(ti1 ti1_gist)
3586 not used hint:
3587 duplication hint:
3588 error hint:
3589
3590                                                                      QUERY PLAN                                                                     
3591 ----------------------------------------------------------------------------------------------------------------------------------------------------
3592  Index Scan using ti1_gist on ti1
3593    Index Cond: (c1 < 100)
3594    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3595 (3 rows)
3596
3597 -- No. S-3-4-4
3598 /*+IndexScan(ti1 ti1_gin)*/
3599 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)';
3600 LOG:  pg_hint_plan:
3601 used hint:
3602 IndexScan(ti1 ti1_gin)
3603 not used hint:
3604 duplication hint:
3605 error hint:
3606
3607                                                                QUERY PLAN                                                                
3608 -----------------------------------------------------------------------------------------------------------------------------------------
3609  Tid Scan on ti1
3610    TID Cond: (ctid = '(1,1)'::tid)
3611    Filter: ((c1 < 100) AND (c2 = 1) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3612 (3 rows)
3613
3614 -- No. S-3-4-5
3615 /*+IndexScan(ti1 ti1_expr)*/
3616 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)';
3617 LOG:  pg_hint_plan:
3618 used hint:
3619 IndexScan(ti1 ti1_expr)
3620 not used hint:
3621 duplication hint:
3622 error hint:
3623
3624                                                                             QUERY PLAN                                                                             
3625 -------------------------------------------------------------------------------------------------------------------------------------------------------------------
3626  Index Scan using ti1_expr on ti1
3627    Index Cond: ((c1 < 100) = true)
3628    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))
3629 (3 rows)
3630
3631 -- No. S-3-4-6
3632 /*+IndexScan(ti1 ti1_pred)*/
3633 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)';
3634 LOG:  pg_hint_plan:
3635 used hint:
3636 IndexScan(ti1 ti1_pred)
3637 not used hint:
3638 duplication hint:
3639 error hint:
3640
3641                                                               QUERY PLAN                                                               
3642 ---------------------------------------------------------------------------------------------------------------------------------------
3643  Index Scan using ti1_pred on ti1
3644    Index Cond: (lower(c4) = '1'::text)
3645    Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
3646 (3 rows)
3647
3648 -- No. S-3-4-7
3649 /*+IndexScan(ti1 ti1_uniq)*/
3650 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)';
3651 LOG:  pg_hint_plan:
3652 used hint:
3653 IndexScan(ti1 ti1_uniq)
3654 not used hint:
3655 duplication hint:
3656 error hint:
3657
3658                                                                      QUERY PLAN                                                                     
3659 ----------------------------------------------------------------------------------------------------------------------------------------------------
3660  Index Scan using ti1_uniq on ti1
3661    Index Cond: (c1 < 100)
3662    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3663 (3 rows)
3664
3665 -- No. S-3-4-8
3666 /*+IndexScan(ti1 ti1_multi)*/
3667 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)';
3668 LOG:  pg_hint_plan:
3669 used hint:
3670 IndexScan(ti1 ti1_multi)
3671 not used hint:
3672 duplication hint:
3673 error hint:
3674
3675                                                               QUERY PLAN                                                               
3676 ---------------------------------------------------------------------------------------------------------------------------------------
3677  Index Scan using ti1_multi on ti1
3678    Index Cond: ((c1 < 100) AND (c2 = 1))
3679    Filter: ((ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3680 (3 rows)
3681
3682 -- No. S-3-4-9
3683 /*+IndexScan(ti1 ti1_ts)*/
3684 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)';
3685 LOG:  pg_hint_plan:
3686 used hint:
3687 IndexScan(ti1 ti1_ts)
3688 not used hint:
3689 duplication hint:
3690 error hint:
3691
3692                                                                QUERY PLAN                                                                
3693 -----------------------------------------------------------------------------------------------------------------------------------------
3694  Tid Scan on ti1
3695    TID Cond: (ctid = '(1,1)'::tid)
3696    Filter: ((c1 < 100) AND (c2 = 1) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3697 (3 rows)
3698
3699 -- No. S-3-4-10
3700 /*+IndexScan(ti1 ti1_pkey)*/
3701 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)';
3702 LOG:  pg_hint_plan:
3703 used hint:
3704 IndexScan(ti1 ti1_pkey)
3705 not used hint:
3706 duplication hint:
3707 error hint:
3708
3709                                                                      QUERY PLAN                                                                     
3710 ----------------------------------------------------------------------------------------------------------------------------------------------------
3711  Index Scan using ti1_pkey on ti1
3712    Index Cond: (c1 < 100)
3713    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3714 (3 rows)
3715
3716 -- No. S-3-4-11
3717 /*+IndexScan(ti1 ti1_c2_key)*/
3718 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)';
3719 LOG:  pg_hint_plan:
3720 used hint:
3721 IndexScan(ti1 ti1_c2_key)
3722 not used hint:
3723 duplication hint:
3724 error hint:
3725
3726                                                                       QUERY PLAN                                                                      
3727 ------------------------------------------------------------------------------------------------------------------------------------------------------
3728  Index Scan using ti1_c2_key on ti1
3729    Index Cond: (c2 = 1)
3730    Filter: ((c1 < 100) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3731 (3 rows)
3732
3733 -- No. S-3-4-12
3734 /*+BitmapScan(ti1 ti1_btree)*/
3735 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)';
3736 LOG:  pg_hint_plan:
3737 used hint:
3738 BitmapScan(ti1 ti1_btree)
3739 not used hint:
3740 duplication hint:
3741 error hint:
3742
3743                                                                      QUERY PLAN                                                                     
3744 ----------------------------------------------------------------------------------------------------------------------------------------------------
3745  Bitmap Heap Scan on ti1
3746    Recheck Cond: (c1 < 100)
3747    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3748    ->  Bitmap Index Scan on ti1_btree
3749          Index Cond: (c1 < 100)
3750 (5 rows)
3751
3752 -- No. S-3-4-13
3753 /*+BitmapScan(ti1 ti1_hash)*/
3754 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)';
3755 LOG:  pg_hint_plan:
3756 used hint:
3757 BitmapScan(ti1 ti1_hash)
3758 not used hint:
3759 duplication hint:
3760 error hint:
3761
3762                                                                      QUERY PLAN                                                                     
3763 ----------------------------------------------------------------------------------------------------------------------------------------------------
3764  Bitmap Heap Scan on ti1
3765    Recheck Cond: (c1 = 100)
3766    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3767    ->  Bitmap Index Scan on ti1_hash
3768          Index Cond: (c1 = 100)
3769 (5 rows)
3770
3771 -- No. S-3-4-14
3772 /*+BitmapScan(ti1 ti1_gist)*/
3773 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)';
3774 LOG:  pg_hint_plan:
3775 used hint:
3776 BitmapScan(ti1 ti1_gist)
3777 not used hint:
3778 duplication hint:
3779 error hint:
3780
3781                                                                      QUERY PLAN                                                                     
3782 ----------------------------------------------------------------------------------------------------------------------------------------------------
3783  Bitmap Heap Scan on ti1
3784    Recheck Cond: (c1 < 100)
3785    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3786    ->  Bitmap Index Scan on ti1_gist
3787          Index Cond: (c1 < 100)
3788 (5 rows)
3789
3790 -- No. S-3-4-15
3791 /*+BitmapScan(ti1 ti1_gin)*/
3792 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)';
3793 LOG:  pg_hint_plan:
3794 used hint:
3795 BitmapScan(ti1 ti1_gin)
3796 not used hint:
3797 duplication hint:
3798 error hint:
3799
3800                                                                      QUERY PLAN                                                                     
3801 ----------------------------------------------------------------------------------------------------------------------------------------------------
3802  Bitmap Heap Scan on ti1
3803    Recheck Cond: (c1 < 100)
3804    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3805    ->  Bitmap Index Scan on ti1_gin
3806          Index Cond: (c1 < 100)
3807 (5 rows)
3808
3809 -- No. S-3-4-16
3810 /*+BitmapScan(ti1 ti1_expr)*/
3811 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)';
3812 LOG:  pg_hint_plan:
3813 used hint:
3814 BitmapScan(ti1 ti1_expr)
3815 not used hint:
3816 duplication hint:
3817 error hint:
3818
3819                                                                             QUERY PLAN                                                                             
3820 -------------------------------------------------------------------------------------------------------------------------------------------------------------------
3821  Bitmap Heap Scan on ti1
3822    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))
3823    ->  Bitmap Index Scan on ti1_expr
3824          Index Cond: ((c1 < 100) = true)
3825 (4 rows)
3826
3827 -- No. S-3-4-17
3828 /*+BitmapScan(ti1 ti1_pred)*/
3829 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)';
3830 LOG:  pg_hint_plan:
3831 used hint:
3832 BitmapScan(ti1 ti1_pred)
3833 not used hint:
3834 duplication hint:
3835 error hint:
3836
3837                                                               QUERY PLAN                                                               
3838 ---------------------------------------------------------------------------------------------------------------------------------------
3839  Bitmap Heap Scan on ti1
3840    Recheck Cond: (lower(c4) = '1'::text)
3841    Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
3842    ->  Bitmap Index Scan on ti1_pred
3843          Index Cond: (lower(c4) = '1'::text)
3844 (5 rows)
3845
3846 -- No. S-3-4-18
3847 /*+BitmapScan(ti1 ti1_uniq)*/
3848 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3849 LOG:  pg_hint_plan:
3850 used hint:
3851 BitmapScan(ti1 ti1_uniq)
3852 not used hint:
3853 duplication hint:
3854 error hint:
3855
3856                                                                      QUERY PLAN                                                                     
3857 ----------------------------------------------------------------------------------------------------------------------------------------------------
3858  Bitmap Heap Scan on ti1
3859    Recheck Cond: (c1 < 100)
3860    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3861    ->  Bitmap Index Scan on ti1_uniq
3862          Index Cond: (c1 < 100)
3863 (5 rows)
3864
3865 -- No. S-3-4-19
3866 /*+BitmapScan(ti1 ti1_multi)*/
3867 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)';
3868 LOG:  pg_hint_plan:
3869 used hint:
3870 BitmapScan(ti1 ti1_multi)
3871 not used hint:
3872 duplication hint:
3873 error hint:
3874
3875                                                               QUERY PLAN                                                               
3876 ---------------------------------------------------------------------------------------------------------------------------------------
3877  Bitmap Heap Scan on ti1
3878    Recheck Cond: ((c1 < 100) AND (c2 = 1))
3879    Filter: ((ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3880    ->  Bitmap Index Scan on ti1_multi
3881          Index Cond: ((c1 < 100) AND (c2 = 1))
3882 (5 rows)
3883
3884 -- No. S-3-4-20
3885 /*+BitmapScan(ti1 ti1_ts)*/
3886 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3887 LOG:  pg_hint_plan:
3888 used hint:
3889 BitmapScan(ti1 ti1_ts)
3890 not used hint:
3891 duplication hint:
3892 error hint:
3893
3894                                         QUERY PLAN                                         
3895 -------------------------------------------------------------------------------------------
3896  Bitmap Heap Scan on ti1
3897    Recheck Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
3898    Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (lower(c4) = '1'::text))
3899    ->  Bitmap Index Scan on ti1_ts
3900          Index Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
3901 (5 rows)
3902
3903 -- No. S-3-4-10
3904 /*+BitmapScan(ti1 ti1_pkey)*/
3905 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3906 LOG:  pg_hint_plan:
3907 used hint:
3908 BitmapScan(ti1 ti1_pkey)
3909 not used hint:
3910 duplication hint:
3911 error hint:
3912
3913                                                                      QUERY PLAN                                                                     
3914 ----------------------------------------------------------------------------------------------------------------------------------------------------
3915  Bitmap Heap Scan on ti1
3916    Recheck Cond: (c1 < 100)
3917    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3918    ->  Bitmap Index Scan on ti1_pkey
3919          Index Cond: (c1 < 100)
3920 (5 rows)
3921
3922 -- No. S-3-4-11
3923 /*+BitmapScan(ti1 ti1_c2_key)*/
3924 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)';
3925 LOG:  pg_hint_plan:
3926 used hint:
3927 BitmapScan(ti1 ti1_c2_key)
3928 not used hint:
3929 duplication hint:
3930 error hint:
3931
3932                                                                       QUERY PLAN                                                                      
3933 ------------------------------------------------------------------------------------------------------------------------------------------------------
3934  Bitmap Heap Scan on ti1
3935    Recheck Cond: (c2 = 1)
3936    Filter: ((c1 < 100) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery) AND (lower(c4) = '1'::text))
3937    ->  Bitmap Index Scan on ti1_c2_key
3938          Index Cond: (c2 = 1)
3939 (5 rows)
3940
3941 -- No. S-3-4-23
3942 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
3943      QUERY PLAN      
3944 ---------------------
3945  Seq Scan on ti1
3946    Filter: (c1 >= 1)
3947 (2 rows)
3948
3949 /*+IndexOnlyScan(ti1 ti1_btree)*/
3950 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
3951 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_btree)"
3952 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
3953      QUERY PLAN      
3954 ---------------------
3955  Seq Scan on ti1
3956    Filter: (c1 >= 1)
3957 (2 rows)
3958
3959 -- No. S-3-4-24
3960 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
3961             QUERY PLAN            
3962 ----------------------------------
3963  Index Scan using ti1_uniq on ti1
3964    Index Cond: (c1 = 1)
3965 (2 rows)
3966
3967 /*+IndexOnlyScan(ti1 ti1_hash)*/
3968 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
3969 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_hash)"
3970 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
3971             QUERY PLAN            
3972 ----------------------------------
3973  Index Scan using ti1_uniq on ti1
3974    Index Cond: (c1 = 1)
3975 (2 rows)
3976
3977 -- No. S-3-4-25
3978 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 < 1;
3979             QUERY PLAN            
3980 ----------------------------------
3981  Index Scan using ti1_uniq on ti1
3982    Index Cond: (c1 < 1)
3983 (2 rows)
3984
3985 /*+IndexOnlyScan(ti1 ti1_gist)*/
3986 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 < 1;
3987 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_gist)"
3988 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
3989             QUERY PLAN            
3990 ----------------------------------
3991  Index Scan using ti1_uniq on ti1
3992    Index Cond: (c1 < 1)
3993 (2 rows)
3994
3995 -- No. S-3-4-26
3996 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
3997             QUERY PLAN            
3998 ----------------------------------
3999  Index Scan using ti1_uniq on ti1
4000    Index Cond: (c1 = 1)
4001 (2 rows)
4002
4003 /*+IndexOnlyScan(ti1 ti1_gin)*/
4004 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
4005 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_gin)"
4006 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4007             QUERY PLAN            
4008 ----------------------------------
4009  Index Scan using ti1_uniq on ti1
4010    Index Cond: (c1 = 1)
4011 (2 rows)
4012
4013 -- No. S-3-4-27
4014 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 < 100;
4015             QUERY PLAN            
4016 ----------------------------------
4017  Index Scan using ti1_uniq on ti1
4018    Index Cond: (c1 < 100)
4019 (2 rows)
4020
4021 /*+IndexOnlyScan(ti1 ti1_expr)*/
4022 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 < 100;
4023 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_expr)"
4024 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4025             QUERY PLAN            
4026 ----------------------------------
4027  Index Scan using ti1_uniq on ti1
4028    Index Cond: (c1 < 100)
4029 (2 rows)
4030
4031 -- No. S-3-4-28
4032 EXPLAIN (COSTS false) SELECT c4 FROM s1.ti1 WHERE lower(c4) >= '1';
4033              QUERY PLAN             
4034 ------------------------------------
4035  Seq Scan on ti1
4036    Filter: (lower(c4) >= '1'::text)
4037 (2 rows)
4038
4039 /*+IndexOnlyScan(ti1 ti1_pred)*/
4040 EXPLAIN (COSTS false) SELECT c4 FROM s1.ti1 WHERE lower(c4) >= '1';
4041 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_pred)"
4042 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4043              QUERY PLAN             
4044 ------------------------------------
4045  Seq Scan on ti1
4046    Filter: (lower(c4) >= '1'::text)
4047 (2 rows)
4048
4049 -- No. S-3-4-29
4050 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4051      QUERY PLAN      
4052 ---------------------
4053  Seq Scan on ti1
4054    Filter: (c1 >= 1)
4055 (2 rows)
4056
4057 /*+IndexOnlyScan(ti1 ti1_uniq)*/
4058 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4059 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_uniq)"
4060 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4061      QUERY PLAN      
4062 ---------------------
4063  Seq Scan on ti1
4064    Filter: (c1 >= 1)
4065 (2 rows)
4066
4067 -- No. S-3-4-30
4068 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4069      QUERY PLAN      
4070 ---------------------
4071  Seq Scan on ti1
4072    Filter: (c1 >= 1)
4073 (2 rows)
4074
4075 /*+IndexOnlyScan(ti1 ti1_multi)*/
4076 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4077 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_multi)"
4078 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4079      QUERY PLAN      
4080 ---------------------
4081  Seq Scan on ti1
4082    Filter: (c1 >= 1)
4083 (2 rows)
4084
4085 -- No. S-3-4-31
4086 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE to_tsvector('english', c4) @@ 'a & b';
4087                                        QUERY PLAN                                        
4088 -----------------------------------------------------------------------------------------
4089  Bitmap Heap Scan on ti1
4090    Recheck Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
4091    ->  Bitmap Index Scan on ti1_ts
4092          Index Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
4093 (4 rows)
4094
4095 /*+IndexOnlyScan(ti1 ti1_ts)*/
4096 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE to_tsvector('english', c4) @@ 'a & b';
4097 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_ts)"
4098 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4099                                        QUERY PLAN                                        
4100 -----------------------------------------------------------------------------------------
4101  Bitmap Heap Scan on ti1
4102    Recheck Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
4103    ->  Bitmap Index Scan on ti1_ts
4104          Index Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
4105 (4 rows)
4106
4107 -- No. S-3-4-32
4108 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4109      QUERY PLAN      
4110 ---------------------
4111  Seq Scan on ti1
4112    Filter: (c1 >= 1)
4113 (2 rows)
4114
4115 /*+IndexOnlyScan(ti1 ti1_pkey)*/
4116 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4117 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_pkey)"
4118 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4119      QUERY PLAN      
4120 ---------------------
4121  Seq Scan on ti1
4122    Filter: (c1 >= 1)
4123 (2 rows)
4124
4125 -- No. S-3-4-33
4126 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE c2 >= 1;
4127      QUERY PLAN      
4128 ---------------------
4129  Seq Scan on ti1
4130    Filter: (c2 >= 1)
4131 (2 rows)
4132
4133 /*+IndexOnlyScan(ti1 ti1_c2_key)*/
4134 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE c2 >= 1;
4135 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_c2_key)"
4136 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4137      QUERY PLAN      
4138 ---------------------
4139  Seq Scan on ti1
4140    Filter: (c2 >= 1)
4141 (2 rows)
4142
4143 ----
4144 ---- No. S-3-5 not used index
4145 ----
4146 -- No. S-3-5-1
4147 /*+IndexScan(ti1 ti1_pred)*/
4148 EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
4149 LOG:  pg_hint_plan:
4150 used hint:
4151 IndexScan(ti1 ti1_pred)
4152 not used hint:
4153 duplication hint:
4154 error hint:
4155
4156                                QUERY PLAN                               
4157 ------------------------------------------------------------------------
4158  Seq Scan on ti1  (cost=10000000000.00..10000000018.50 rows=1 width=15)
4159    Filter: (c1 = 100)
4160 (2 rows)
4161
4162 -- No. S-3-5-2
4163 /*+BitmapScan(ti1 ti1_pred)*/
4164 EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
4165 LOG:  pg_hint_plan:
4166 used hint:
4167 BitmapScan(ti1 ti1_pred)
4168 not used hint:
4169 duplication hint:
4170 error hint:
4171
4172                                QUERY PLAN                               
4173 ------------------------------------------------------------------------
4174  Seq Scan on ti1  (cost=10000000000.00..10000000018.50 rows=1 width=15)
4175    Filter: (c1 = 100)
4176 (2 rows)
4177
4178 -- No. S-3-5-3
4179 /*+IndexOnlyScan(ti1 ti1_pred)*/
4180 EXPLAIN (COSTS true) SELECT c1 FROM s1.ti1 WHERE c1 = 100;
4181 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_pred)"
4182 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4183                              QUERY PLAN                             
4184 --------------------------------------------------------------------
4185  Index Scan using ti1_uniq on ti1  (cost=0.00..8.27 rows=1 width=4)
4186    Index Cond: (c1 = 100)
4187 (2 rows)
4188
4189 ----
4190 ---- No. S-3-6 not exist index
4191 ----
4192 -- No. S-3-6-1
4193 /*+IndexScan(ti1 not_exist)*/
4194 EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
4195 LOG:  pg_hint_plan:
4196 used hint:
4197 IndexScan(ti1 not_exist)
4198 not used hint:
4199 duplication hint:
4200 error hint:
4201
4202                                QUERY PLAN                               
4203 ------------------------------------------------------------------------
4204  Seq Scan on ti1  (cost=10000000000.00..10000000018.50 rows=1 width=15)
4205    Filter: (c1 = 100)
4206 (2 rows)
4207
4208 -- No. S-3-6-2
4209 /*+BitmapScan(ti1 not_exist)*/
4210 EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
4211 LOG:  pg_hint_plan:
4212 used hint:
4213 BitmapScan(ti1 not_exist)
4214 not used hint:
4215 duplication hint:
4216 error hint:
4217
4218                                QUERY PLAN                               
4219 ------------------------------------------------------------------------
4220  Seq Scan on ti1  (cost=10000000000.00..10000000018.50 rows=1 width=15)
4221    Filter: (c1 = 100)
4222 (2 rows)
4223
4224 -- No. S-3-6-3
4225 /*+IndexOnlyScan(ti1 not_exist)*/
4226 EXPLAIN (COSTS true) SELECT c1 FROM s1.ti1 WHERE c1 = 100;
4227 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 not_exist)"
4228 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
4229                              QUERY PLAN                             
4230 --------------------------------------------------------------------
4231  Index Scan using ti1_uniq on ti1  (cost=0.00..8.27 rows=1 width=4)
4232    Index Cond: (c1 = 100)
4233 (2 rows)
4234
4235 ----
4236 ---- No. S-3-7 query structure
4237 ----
4238 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
4239                   QUERY PLAN                   
4240 -----------------------------------------------
4241  Hash Join
4242    Hash Cond: (t2.c1 = t1.c1)
4243    ->  Seq Scan on t2
4244    ->  Hash
4245          ->  Tid Scan on t1
4246                TID Cond: (ctid = '(1,1)'::tid)
4247 (6 rows)
4248
4249 -- No. S-3-7-1
4250 /*+SeqScan(t1)*/
4251 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE c1 = 100;
4252 LOG:  pg_hint_plan:
4253 used hint:
4254 SeqScan(t1)
4255 not used hint:
4256 duplication hint:
4257 error hint:
4258
4259       QUERY PLAN      
4260 ----------------------
4261  Seq Scan on t1
4262    Filter: (c1 = 100)
4263 (2 rows)
4264
4265 -- No. S-3-7-2
4266 /*+SeqScan(t1)BitmapScan(t2)*/
4267 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
4268 LOG:  pg_hint_plan:
4269 used hint:
4270 SeqScan(t1)
4271 BitmapScan(t2)
4272 not used hint:
4273 duplication hint:
4274 error hint:
4275
4276                QUERY PLAN               
4277 ----------------------------------------
4278  Nested Loop
4279    ->  Seq Scan on t1
4280          Filter: (ctid = '(1,1)'::tid)
4281    ->  Bitmap Heap Scan on t2
4282          Recheck Cond: (c1 = t1.c1)
4283          ->  Bitmap Index Scan on t2_i1
4284                Index Cond: (c1 = t1.c1)
4285 (7 rows)
4286
4287 -- No. S-3-7-3
4288 /*+SeqScan(t1)*/
4289 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
4290 LOG:  pg_hint_plan:
4291 used hint:
4292 SeqScan(t1)
4293 not used hint:
4294 duplication hint:
4295 error hint:
4296
4297                  QUERY PLAN                  
4298 ---------------------------------------------
4299  Hash Join
4300    Hash Cond: (t2.c1 = t1.c1)
4301    ->  Seq Scan on t2
4302    ->  Hash
4303          ->  Seq Scan on t1
4304                Filter: (ctid = '(1,1)'::tid)
4305 (6 rows)
4306
4307 ----
4308 ---- No. S-3-8 query structure
4309 ----
4310 -- No. S-3-8-1
4311 EXPLAIN (COSTS false) 
4312 WITH c1 (c1) AS (
4313 SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.c1 = 1)
4314 SELECT max(b3t1.c1), (
4315 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
4316                   ) FROM s1.t1 b3t1 WHERE b3t1.c1 = (
4317 SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
4318                              QUERY PLAN                              
4319 ---------------------------------------------------------------------
4320  Result
4321    InitPlan 2 (returns $1)
4322      ->  Result
4323            InitPlan 1 (returns $0)
4324              ->  Limit
4325                    ->  Index Scan using t1_i1 on t1 b2t1
4326                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4327    InitPlan 4 (returns $3)
4328      ->  Result
4329            InitPlan 3 (returns $2)
4330              ->  Limit
4331                    ->  Index Scan using t1_i1 on t1 b4t1
4332                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4333    InitPlan 5 (returns $4)
4334      ->  Limit
4335            ->  Index Scan using t1_i1 on t1 b3t1
4336                  Index Cond: ((c1 IS NOT NULL) AND (c1 = $3))
4337 (17 rows)
4338
4339 /*+SeqScan(b1t1)IndexScan(b2t1 t1_pkey)BitmapScan(b3t1 t1_pkey)TidScan(b4t1)
4340 */
4341 EXPLAIN (COSTS false) 
4342 WITH c1 (c1) AS (
4343 SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.c1 = 1)
4344 SELECT max(b3t1.c1), (
4345 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
4346                   ) FROM s1.t1 b3t1 WHERE b3t1.c1 = (
4347 SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
4348 LOG:  pg_hint_plan:
4349 used hint:
4350 IndexScan(b2t1 t1_pkey)
4351 BitmapScan(b3t1 t1_pkey)
4352 TidScan(b4t1)
4353 not used hint:
4354 SeqScan(b1t1)
4355 duplication hint:
4356 error hint:
4357
4358                              QUERY PLAN                              
4359 ---------------------------------------------------------------------
4360  Result
4361    InitPlan 2 (returns $1)
4362      ->  Result
4363            InitPlan 1 (returns $0)
4364              ->  Limit
4365                    ->  Index Scan using t1_pkey on t1 b2t1
4366                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4367    InitPlan 4 (returns $3)
4368      ->  Result
4369            InitPlan 3 (returns $2)
4370              ->  Limit
4371                    ->  Seq Scan on t1 b4t1
4372                          Filter: ((c1 IS NOT NULL) AND (c1 = 1))
4373    InitPlan 5 (returns $4)
4374      ->  Limit
4375            ->  Bitmap Heap Scan on t1 b3t1
4376                  Recheck Cond: ((c1 IS NOT NULL) AND (c1 = $3))
4377                  ->  Bitmap Index Scan on t1_pkey
4378                        Index Cond: ((c1 IS NOT NULL) AND (c1 = $3))
4379 (19 rows)
4380
4381 -- No. S-3-8-2
4382 EXPLAIN (COSTS false) 
4383 WITH cte1 (c1) AS (
4384 SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
4385 SELECT max(b3t1.c1), (
4386 SELECT max(b2t1.c1) FROM s1.t1 b2t1 JOIN s1.t2 b2t2 ON(b2t1.c1 = b2t2.c1) WHERE b2t1.c1 = 1
4387                   ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
4388 SELECT max(b4t1.c1) FROM s1.t1 b4t1 JOIN s1.t2 b4t2 ON(b4t1.c1 = b4t2.c1) WHERE b4t1.c1 = 1);
4389                       QUERY PLAN                       
4390 -------------------------------------------------------
4391  Aggregate
4392    CTE cte1
4393      ->  Aggregate
4394            ->  Nested Loop
4395                  ->  Index Scan using t1_i1 on t1 b1t1
4396                        Index Cond: (c1 = 1)
4397                  ->  Seq Scan on t2 b1t2
4398                        Filter: (c1 = 1)
4399    InitPlan 2 (returns $1)
4400      ->  Aggregate
4401            ->  Nested Loop
4402                  ->  Index Scan using t1_i1 on t1 b2t1
4403                        Index Cond: (c1 = 1)
4404                  ->  Seq Scan on t2 b2t2
4405                        Filter: (c1 = 1)
4406    InitPlan 3 (returns $2)
4407      ->  Aggregate
4408            ->  Nested Loop
4409                  ->  Index Scan using t1_i1 on t1 b4t1
4410                        Index Cond: (c1 = 1)
4411                  ->  Seq Scan on t2 b4t2
4412                        Filter: (c1 = 1)
4413    ->  Nested Loop
4414          ->  Nested Loop
4415                ->  Index Scan using t1_i1 on t1 b3t1
4416                      Index Cond: (c1 = $2)
4417                ->  Seq Scan on t2 b3t2
4418                      Filter: (c1 = $2)
4419          ->  CTE Scan on cte1
4420                Filter: (c1 = $2)
4421 (30 rows)
4422
4423 /*+SeqScan(b1t1)IndexScan(b2t1 t1_pkey)BitmapScan(b3t1 t1_pkey)TidScan(b4t1)
4424 TidScan(b1t2)SeqScan(b2t2)IndexScan(b3t2 t2_pkey)BitmapScan(b4t2 t2_pkey)
4425 */
4426 EXPLAIN (COSTS false) 
4427 WITH cte1 (c1) AS (
4428 SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
4429 SELECT max(b3t1.c1), (
4430 SELECT max(b2t1.c1) FROM s1.t1 b2t1 JOIN s1.t2 b2t2 ON(b2t1.c1 = b2t2.c1) WHERE b2t1.c1 = 1
4431                   ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
4432 SELECT max(b4t1.c1) FROM s1.t1 b4t1 JOIN s1.t2 b4t2 ON(b4t1.c1 = b4t2.c1) WHERE b4t1.c1 = 1);
4433 LOG:  pg_hint_plan:
4434 used hint:
4435 SeqScan(b1t1)
4436 TidScan(b1t2)
4437 IndexScan(b2t1 t1_pkey)
4438 SeqScan(b2t2)
4439 BitmapScan(b3t1 t1_pkey)
4440 IndexScan(b3t2 t2_pkey)
4441 TidScan(b4t1)
4442 BitmapScan(b4t2 t2_pkey)
4443 not used hint:
4444 duplication hint:
4445 error hint:
4446
4447                        QUERY PLAN                        
4448 ---------------------------------------------------------
4449  Aggregate
4450    CTE cte1
4451      ->  Aggregate
4452            ->  Nested Loop
4453                  ->  Seq Scan on t1 b1t1
4454                        Filter: (c1 = 1)
4455                  ->  Seq Scan on t2 b1t2
4456                        Filter: (c1 = 1)
4457    InitPlan 2 (returns $1)
4458      ->  Aggregate
4459            ->  Nested Loop
4460                  ->  Index Scan using t1_pkey on t1 b2t1
4461                        Index Cond: (c1 = 1)
4462                  ->  Seq Scan on t2 b2t2
4463                        Filter: (c1 = 1)
4464    InitPlan 3 (returns $2)
4465      ->  Aggregate
4466            ->  Nested Loop
4467                  ->  Seq Scan on t1 b4t1
4468                        Filter: (c1 = 1)
4469                  ->  Bitmap Heap Scan on t2 b4t2
4470                        Recheck Cond: (c1 = 1)
4471                        ->  Bitmap Index Scan on t2_pkey
4472                              Index Cond: (c1 = 1)
4473    ->  Nested Loop
4474          ->  Nested Loop
4475                ->  Bitmap Heap Scan on t1 b3t1
4476                      Recheck Cond: (c1 = $2)
4477                      ->  Bitmap Index Scan on t1_pkey
4478                            Index Cond: (c1 = $2)
4479                ->  CTE Scan on cte1
4480                      Filter: (c1 = $2)
4481          ->  Index Scan using t2_pkey on t2 b3t2
4482                Index Cond: (c1 = $2)
4483 (34 rows)
4484
4485 -- No. S-3-8-3
4486 EXPLAIN (COSTS false) 
4487 WITH cte1 (c1) AS (
4488 SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
4489 SELECT max(b3t1.c1), (
4490 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
4491                   ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
4492 SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
4493                              QUERY PLAN                              
4494 ---------------------------------------------------------------------
4495  Aggregate
4496    CTE cte1
4497      ->  Aggregate
4498            ->  Nested Loop
4499                  ->  Index Scan using t1_i1 on t1 b1t1
4500                        Index Cond: (c1 = 1)
4501                  ->  Seq Scan on t2 b1t2
4502                        Filter: (c1 = 1)
4503    InitPlan 3 (returns $2)
4504      ->  Result
4505            InitPlan 2 (returns $1)
4506              ->  Limit
4507                    ->  Index Scan using t1_i1 on t1 b2t1
4508                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4509    InitPlan 5 (returns $4)
4510      ->  Result
4511            InitPlan 4 (returns $3)
4512              ->  Limit
4513                    ->  Index Scan using t1_i1 on t1 b4t1
4514                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4515    ->  Nested Loop
4516          ->  Nested Loop
4517                ->  Index Scan using t1_i1 on t1 b3t1
4518                      Index Cond: (c1 = $4)
4519                ->  Seq Scan on t2 b3t2
4520                      Filter: (c1 = $4)
4521          ->  CTE Scan on cte1
4522                Filter: (c1 = $4)
4523 (28 rows)
4524
4525 /*+SeqScan(b1t1)IndexScan(b2t1 t1_pkey)BitmapScan(b3t1 t1_pkey)TidScan(b4t1)
4526 TidScan(b1t2)IndexScan(b3t2 t2_pkey)
4527 */
4528 EXPLAIN (COSTS false) 
4529 WITH cte1 (c1) AS (
4530 SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
4531 SELECT max(b3t1.c1), (
4532 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
4533                   ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
4534 SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
4535 LOG:  pg_hint_plan:
4536 used hint:
4537 SeqScan(b1t1)
4538 TidScan(b1t2)
4539 IndexScan(b2t1 t1_pkey)
4540 BitmapScan(b3t1 t1_pkey)
4541 IndexScan(b3t2 t2_pkey)
4542 TidScan(b4t1)
4543 not used hint:
4544 duplication hint:
4545 error hint:
4546
4547                              QUERY PLAN                              
4548 ---------------------------------------------------------------------
4549  Aggregate
4550    CTE cte1
4551      ->  Aggregate
4552            ->  Nested Loop
4553                  ->  Seq Scan on t1 b1t1
4554                        Filter: (c1 = 1)
4555                  ->  Seq Scan on t2 b1t2
4556                        Filter: (c1 = 1)
4557    InitPlan 3 (returns $2)
4558      ->  Result
4559            InitPlan 2 (returns $1)
4560              ->  Limit
4561                    ->  Index Scan using t1_pkey on t1 b2t1
4562                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4563    InitPlan 5 (returns $4)
4564      ->  Result
4565            InitPlan 4 (returns $3)
4566              ->  Limit
4567                    ->  Seq Scan on t1 b4t1
4568                          Filter: ((c1 IS NOT NULL) AND (c1 = 1))
4569    ->  Nested Loop
4570          ->  Nested Loop
4571                ->  Bitmap Heap Scan on t1 b3t1
4572                      Recheck Cond: (c1 = $4)
4573                      ->  Bitmap Index Scan on t1_pkey
4574                            Index Cond: (c1 = $4)
4575                ->  CTE Scan on cte1
4576                      Filter: (c1 = $4)
4577          ->  Index Scan using t2_pkey on t2 b3t2
4578                Index Cond: (c1 = $4)
4579 (30 rows)
4580
4581 ----
4582 ---- No. S-3-9 inheritance table select type
4583 ----
4584 -- No. S-3-9-1
4585 EXPLAIN (COSTS false) SELECT * FROM ONLY s1.p1 WHERE c1 = 1;
4586      QUERY PLAN     
4587 --------------------
4588  Seq Scan on p1
4589    Filter: (c1 = 1)
4590 (2 rows)
4591
4592 /*+IndexScan(p1)*/
4593 EXPLAIN (COSTS false) SELECT * FROM ONLY s1.p1 WHERE c1 = 1;
4594 LOG:  pg_hint_plan:
4595 used hint:
4596 IndexScan(p1)
4597 not used hint:
4598 duplication hint:
4599 error hint:
4600
4601          QUERY PLAN          
4602 -----------------------------
4603  Index Scan using p1_i on p1
4604    Index Cond: (c1 = 1)
4605 (2 rows)
4606
4607 -- No. S-3-9-2
4608 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
4609            QUERY PLAN            
4610 ---------------------------------
4611  Result
4612    ->  Append
4613          ->  Seq Scan on p1
4614                Filter: (c1 = 1)
4615          ->  Seq Scan on p1c1 p1
4616                Filter: (c1 = 1)
4617 (6 rows)
4618
4619 /*+IndexScan(p1)*/
4620 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
4621 LOG:  pg_hint_plan:
4622 used hint:
4623 IndexScan(p1)
4624 not used hint:
4625 duplication hint:
4626 error hint:
4627
4628                    QUERY PLAN                   
4629 ------------------------------------------------
4630  Result
4631    ->  Append
4632          ->  Index Scan using p1_i on p1
4633                Index Cond: (c1 = 1)
4634          ->  Index Scan using p1c1_i on p1c1 p1
4635                Index Cond: (c1 = 1)
4636 (6 rows)
4637
4638 ----
4639 ---- No. S-3-10 inheritance table number
4640 ----
4641 -- No. S-3-10-1
4642 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
4643            QUERY PLAN            
4644 ---------------------------------
4645  Result
4646    ->  Append
4647          ->  Seq Scan on p1
4648                Filter: (c1 = 1)
4649          ->  Seq Scan on p1c1 p1
4650                Filter: (c1 = 1)
4651 (6 rows)
4652
4653 /*+IndexScan(p1)*/
4654 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
4655 LOG:  pg_hint_plan:
4656 used hint:
4657 IndexScan(p1)
4658 not used hint:
4659 duplication hint:
4660 error hint:
4661
4662                    QUERY PLAN                   
4663 ------------------------------------------------
4664  Result
4665    ->  Append
4666          ->  Index Scan using p1_i on p1
4667                Index Cond: (c1 = 1)
4668          ->  Index Scan using p1c1_i on p1c1 p1
4669                Index Cond: (c1 = 1)
4670 (6 rows)
4671
4672 -- No. S-3-10-2
4673 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4674             QUERY PLAN             
4675 -----------------------------------
4676  Result
4677    ->  Append
4678          ->  Seq Scan on p2
4679                Filter: (c1 = 1)
4680          ->  Seq Scan on p2c1 p2
4681                Filter: (c1 = 1)
4682          ->  Seq Scan on p2c1c1 p2
4683                Filter: (c1 = 1)
4684 (8 rows)
4685
4686 /*+IndexScan(p2)*/
4687 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4688 LOG:  pg_hint_plan:
4689 used hint:
4690 IndexScan(p2)
4691 not used hint:
4692 duplication hint:
4693 error hint:
4694
4695                      QUERY PLAN                     
4696 ----------------------------------------------------
4697  Result
4698    ->  Append
4699          ->  Index Scan using p2_i on p2
4700                Index Cond: (c1 = 1)
4701          ->  Index Scan using p2c1_i on p2c1 p2
4702                Index Cond: (c1 = 1)
4703          ->  Index Scan using p2c1c1_i on p2c1c1 p2
4704                Index Cond: (c1 = 1)
4705 (8 rows)
4706
4707 ----
4708 ---- No. S-3-11 inheritance table specified table
4709 ----
4710 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4711             QUERY PLAN             
4712 -----------------------------------
4713  Result
4714    ->  Append
4715          ->  Seq Scan on p2
4716                Filter: (c1 = 1)
4717          ->  Seq Scan on p2c1 p2
4718                Filter: (c1 = 1)
4719          ->  Seq Scan on p2c1c1 p2
4720                Filter: (c1 = 1)
4721 (8 rows)
4722
4723 -- No. S-3-11-1
4724 /*+IndexScan(p2)*/
4725 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4726 LOG:  pg_hint_plan:
4727 used hint:
4728 IndexScan(p2)
4729 not used hint:
4730 duplication hint:
4731 error hint:
4732
4733                      QUERY PLAN                     
4734 ----------------------------------------------------
4735  Result
4736    ->  Append
4737          ->  Index Scan using p2_i on p2
4738                Index Cond: (c1 = 1)
4739          ->  Index Scan using p2c1_i on p2c1 p2
4740                Index Cond: (c1 = 1)
4741          ->  Index Scan using p2c1c1_i on p2c1c1 p2
4742                Index Cond: (c1 = 1)
4743 (8 rows)
4744
4745 -- No. S-3-11-2
4746 /*+IndexScan(p2c1)*/
4747 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4748 LOG:  pg_hint_plan:
4749 used hint:
4750 not used hint:
4751 IndexScan(p2c1)
4752 duplication hint:
4753 error hint:
4754
4755             QUERY PLAN             
4756 -----------------------------------
4757  Result
4758    ->  Append
4759          ->  Seq Scan on p2
4760                Filter: (c1 = 1)
4761          ->  Seq Scan on p2c1 p2
4762                Filter: (c1 = 1)
4763          ->  Seq Scan on p2c1c1 p2
4764                Filter: (c1 = 1)
4765 (8 rows)
4766
4767 -- No. S-3-11-3
4768 /*+IndexScan(p2 p2_pkey p2c1_pkey p2c1c1_pkey)*/
4769 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
4770 LOG:  pg_hint_plan:
4771 used hint:
4772 IndexScan(p2 p2_pkey p2c1_pkey p2c1c1_pkey)
4773 not used hint:
4774 duplication hint:
4775 error hint:
4776
4777                       QUERY PLAN                       
4778 -------------------------------------------------------
4779  Result
4780    ->  Append
4781          ->  Index Scan using p2_pkey on p2
4782                Index Cond: (c1 = 1)
4783          ->  Index Scan using p2c1_pkey on p2c1 p2
4784                Index Cond: (c1 = 1)
4785          ->  Index Scan using p2c1c1_pkey on p2c1c1 p2
4786                Index Cond: (c1 = 1)
4787 (8 rows)
4788
4789 -- No. S-3-11-4
4790 /*+IndexScan(p2 p2c1_pkey)*/
4791 EXPLAIN (COSTS true) SELECT * FROM s1.p2 WHERE c1 = 1;
4792 LOG:  pg_hint_plan:
4793 used hint:
4794 IndexScan(p2 p2c1_pkey)
4795 not used hint:
4796 duplication hint:
4797 error hint:
4798
4799                                         QUERY PLAN                                        
4800 ------------------------------------------------------------------------------------------
4801  Result  (cost=10000000000.00..20000000009.89 rows=3 width=34)
4802    ->  Append  (cost=10000000000.00..20000000009.89 rows=3 width=34)
4803          ->  Seq Scan on p2  (cost=10000000000.00..10000000000.00 rows=1 width=44)
4804                Filter: (c1 = 1)
4805          ->  Index Scan using p2c1_pkey on p2c1 p2  (cost=0.00..8.27 rows=1 width=44)
4806                Index Cond: (c1 = 1)
4807          ->  Seq Scan on p2c1c1 p2  (cost=10000000000.00..10000000001.62 rows=1 width=14)
4808                Filter: (c1 = 1)
4809 (8 rows)
4810
4811 ----
4812 ---- No. S-3-12 specified same table
4813 ----
4814 -- No. S-3-12-1
4815 /*+IndexScan(ti1) BitmapScan(ti1)*/
4816 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4817 INFO:  hint syntax error at or near "IndexScan(ti1) BitmapScan(ti1)"
4818 DETAIL:  Conflict scan method hint.
4819 LOG:  pg_hint_plan:
4820 used hint:
4821 BitmapScan(ti1)
4822 not used hint:
4823 duplication hint:
4824 IndexScan(ti1)
4825 error hint:
4826
4827              QUERY PLAN              
4828 -------------------------------------
4829  Bitmap Heap Scan on ti1
4830    Recheck Cond: (c1 = 1)
4831    Filter: (ctid = '(1,1)'::tid)
4832    ->  Bitmap Index Scan on ti1_uniq
4833          Index Cond: (c1 = 1)
4834 (5 rows)
4835
4836 -- No. S-3-12-2
4837 /*+IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)*/
4838 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4839 INFO:  hint syntax error at or near "IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
4840 DETAIL:  Conflict scan method hint.
4841 LOG:  pg_hint_plan:
4842 used hint:
4843 BitmapScan(ti1 ti1_btree)
4844 not used hint:
4845 duplication hint:
4846 IndexScan(ti1 ti1_pkey)
4847 error hint:
4848
4849               QUERY PLAN              
4850 --------------------------------------
4851  Bitmap Heap Scan on ti1
4852    Recheck Cond: (c1 = 1)
4853    Filter: (ctid = '(1,1)'::tid)
4854    ->  Bitmap Index Scan on ti1_btree
4855          Index Cond: (c1 = 1)
4856 (5 rows)
4857
4858 -- No. S-3-12-3
4859 /*+BitmapScan(ti1) IndexScan(ti1) BitmapScan(ti1)*/
4860 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4861 INFO:  hint syntax error at or near "BitmapScan(ti1) IndexScan(ti1) BitmapScan(ti1)"
4862 DETAIL:  Conflict scan method hint.
4863 INFO:  hint syntax error at or near "IndexScan(ti1) BitmapScan(ti1)"
4864 DETAIL:  Conflict scan method hint.
4865 LOG:  pg_hint_plan:
4866 used hint:
4867 BitmapScan(ti1)
4868 not used hint:
4869 duplication hint:
4870 BitmapScan(ti1)
4871 IndexScan(ti1)
4872 error hint:
4873
4874              QUERY PLAN              
4875 -------------------------------------
4876  Bitmap Heap Scan on ti1
4877    Recheck Cond: (c1 = 1)
4878    Filter: (ctid = '(1,1)'::tid)
4879    ->  Bitmap Index Scan on ti1_uniq
4880          Index Cond: (c1 = 1)
4881 (5 rows)
4882
4883 -- No. S-3-12-4
4884 /*+BitmapScan(ti1 ti1_hash) IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)*/
4885 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4886 INFO:  hint syntax error at or near "BitmapScan(ti1 ti1_hash) IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
4887 DETAIL:  Conflict scan method hint.
4888 INFO:  hint syntax error at or near "IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
4889 DETAIL:  Conflict scan method hint.
4890 LOG:  pg_hint_plan:
4891 used hint:
4892 BitmapScan(ti1 ti1_btree)
4893 not used hint:
4894 duplication hint:
4895 BitmapScan(ti1 ti1_hash)
4896 IndexScan(ti1 ti1_pkey)
4897 error hint:
4898
4899               QUERY PLAN              
4900 --------------------------------------
4901  Bitmap Heap Scan on ti1
4902    Recheck Cond: (c1 = 1)
4903    Filter: (ctid = '(1,1)'::tid)
4904    ->  Bitmap Index Scan on ti1_btree
4905          Index Cond: (c1 = 1)
4906 (5 rows)
4907
4908 ----
4909 ---- No. S-3-13 message output
4910 ----
4911 -- No. S-3-13-1
4912 /*+SeqScan(ti1)*/
4913 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4914 LOG:  pg_hint_plan:
4915 used hint:
4916 SeqScan(ti1)
4917 not used hint:
4918 duplication hint:
4919 error hint:
4920
4921                    QUERY PLAN                   
4922 ------------------------------------------------
4923  Seq Scan on ti1
4924    Filter: ((c1 = 1) AND (ctid = '(1,1)'::tid))
4925 (2 rows)
4926
4927 -- No. S-3-13-2
4928 /*+SeqScan(ti1 ti1_pkey)*/
4929 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4930 INFO:  hint syntax error at or near ""
4931 DETAIL:  SeqScan hint accepts only one relation.
4932 LOG:  pg_hint_plan:
4933 used hint:
4934 not used hint:
4935 duplication hint:
4936 error hint:
4937 SeqScan(ti1 ti1_pkey)
4938
4939             QUERY PLAN             
4940 -----------------------------------
4941  Tid Scan on ti1
4942    TID Cond: (ctid = '(1,1)'::tid)
4943    Filter: (c1 = 1)
4944 (3 rows)
4945
4946 -- No. S-3-13-3
4947 /*+SeqScan(ti1 ti1_pkey ti1_btree)*/
4948 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4949 INFO:  hint syntax error at or near ""
4950 DETAIL:  SeqScan hint accepts only one relation.
4951 LOG:  pg_hint_plan:
4952 used hint:
4953 not used hint:
4954 duplication hint:
4955 error hint:
4956 SeqScan(ti1 ti1_pkey ti1_btree)
4957
4958             QUERY PLAN             
4959 -----------------------------------
4960  Tid Scan on ti1
4961    TID Cond: (ctid = '(1,1)'::tid)
4962    Filter: (c1 = 1)
4963 (3 rows)
4964
4965 -- No. S-3-13-4
4966 /*+IndexScan(ti1)*/
4967 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4968 LOG:  pg_hint_plan:
4969 used hint:
4970 IndexScan(ti1)
4971 not used hint:
4972 duplication hint:
4973 error hint:
4974
4975             QUERY PLAN            
4976 ----------------------------------
4977  Index Scan using ti1_uniq on ti1
4978    Index Cond: (c1 = 1)
4979    Filter: (ctid = '(1,1)'::tid)
4980 (3 rows)
4981
4982 -- No. S-3-13-5
4983 /*+IndexScan(ti1 ti1_pkey)*/
4984 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
4985 LOG:  pg_hint_plan:
4986 used hint:
4987 IndexScan(ti1 ti1_pkey)
4988 not used hint:
4989 duplication hint:
4990 error hint:
4991
4992             QUERY PLAN            
4993 ----------------------------------
4994  Index Scan using ti1_pkey on ti1
4995    Index Cond: (c1 = 1)
4996    Filter: (ctid = '(1,1)'::tid)
4997 (3 rows)
4998
4999 -- No. S-3-13-6
5000 /*+IndexScan(ti1 ti1_pkey ti1_btree)*/
5001 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5002 LOG:  pg_hint_plan:
5003 used hint:
5004 IndexScan(ti1 ti1_pkey ti1_btree)
5005 not used hint:
5006 duplication hint:
5007 error hint:
5008
5009             QUERY PLAN             
5010 -----------------------------------
5011  Index Scan using ti1_btree on ti1
5012    Index Cond: (c1 = 1)
5013    Filter: (ctid = '(1,1)'::tid)
5014 (3 rows)
5015
5016 -- No. S-3-13-7
5017 /*+BitmapScan(ti1)*/
5018 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5019 LOG:  pg_hint_plan:
5020 used hint:
5021 BitmapScan(ti1)
5022 not used hint:
5023 duplication hint:
5024 error hint:
5025
5026              QUERY PLAN              
5027 -------------------------------------
5028  Bitmap Heap Scan on ti1
5029    Recheck Cond: (c1 = 1)
5030    Filter: (ctid = '(1,1)'::tid)
5031    ->  Bitmap Index Scan on ti1_uniq
5032          Index Cond: (c1 = 1)
5033 (5 rows)
5034
5035 -- No. S-3-13-8
5036 /*+BitmapScan(ti1 ti1_pkey)*/
5037 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5038 LOG:  pg_hint_plan:
5039 used hint:
5040 BitmapScan(ti1 ti1_pkey)
5041 not used hint:
5042 duplication hint:
5043 error hint:
5044
5045              QUERY PLAN              
5046 -------------------------------------
5047  Bitmap Heap Scan on ti1
5048    Recheck Cond: (c1 = 1)
5049    Filter: (ctid = '(1,1)'::tid)
5050    ->  Bitmap Index Scan on ti1_pkey
5051          Index Cond: (c1 = 1)
5052 (5 rows)
5053
5054 -- No. S-3-13-9
5055 /*+BitmapScan(ti1 ti1_pkey ti1_btree)*/
5056 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5057 LOG:  pg_hint_plan:
5058 used hint:
5059 BitmapScan(ti1 ti1_pkey ti1_btree)
5060 not used hint:
5061 duplication hint:
5062 error hint:
5063
5064               QUERY PLAN              
5065 --------------------------------------
5066  Bitmap Heap Scan on ti1
5067    Recheck Cond: (c1 = 1)
5068    Filter: (ctid = '(1,1)'::tid)
5069    ->  Bitmap Index Scan on ti1_btree
5070          Index Cond: (c1 = 1)
5071 (5 rows)
5072
5073 -- No. S-3-13-10
5074 /*+TidScan(ti1)*/
5075 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5076 LOG:  pg_hint_plan:
5077 used hint:
5078 TidScan(ti1)
5079 not used hint:
5080 duplication hint:
5081 error hint:
5082
5083             QUERY PLAN             
5084 -----------------------------------
5085  Tid Scan on ti1
5086    TID Cond: (ctid = '(1,1)'::tid)
5087    Filter: (c1 = 1)
5088 (3 rows)
5089
5090 -- No. S-3-13-11
5091 /*+TidScan(ti1 ti1_pkey)*/
5092 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5093 INFO:  hint syntax error at or near ""
5094 DETAIL:  TidScan hint accepts only one relation.
5095 LOG:  pg_hint_plan:
5096 used hint:
5097 not used hint:
5098 duplication hint:
5099 error hint:
5100 TidScan(ti1 ti1_pkey)
5101
5102             QUERY PLAN             
5103 -----------------------------------
5104  Tid Scan on ti1
5105    TID Cond: (ctid = '(1,1)'::tid)
5106    Filter: (c1 = 1)
5107 (3 rows)
5108
5109 -- No. S-3-13-12
5110 /*+TidScan(ti1 ti1_pkey ti1_btree)*/
5111 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5112 INFO:  hint syntax error at or near ""
5113 DETAIL:  TidScan hint accepts only one relation.
5114 LOG:  pg_hint_plan:
5115 used hint:
5116 not used hint:
5117 duplication hint:
5118 error hint:
5119 TidScan(ti1 ti1_pkey ti1_btree)
5120
5121             QUERY PLAN             
5122 -----------------------------------
5123  Tid Scan on ti1
5124    TID Cond: (ctid = '(1,1)'::tid)
5125    Filter: (c1 = 1)
5126 (3 rows)
5127
5128 -- No. S-3-13-13
5129 /*+NoSeqScan(ti1)*/
5130 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5131 LOG:  pg_hint_plan:
5132 used hint:
5133 NoSeqScan(ti1)
5134 not used hint:
5135 duplication hint:
5136 error hint:
5137
5138             QUERY PLAN             
5139 -----------------------------------
5140  Tid Scan on ti1
5141    TID Cond: (ctid = '(1,1)'::tid)
5142    Filter: (c1 = 1)
5143 (3 rows)
5144
5145 -- No. S-3-13-14
5146 /*+NoSeqScan(ti1 ti1_pkey)*/
5147 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5148 INFO:  hint syntax error at or near ""
5149 DETAIL:  NoSeqScan hint accepts only one relation.
5150 LOG:  pg_hint_plan:
5151 used hint:
5152 not used hint:
5153 duplication hint:
5154 error hint:
5155 NoSeqScan(ti1 ti1_pkey)
5156
5157             QUERY PLAN             
5158 -----------------------------------
5159  Tid Scan on ti1
5160    TID Cond: (ctid = '(1,1)'::tid)
5161    Filter: (c1 = 1)
5162 (3 rows)
5163
5164 -- No. S-3-13-15
5165 /*+NoSeqScan(ti1 ti1_pkey ti1_btree)*/
5166 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5167 INFO:  hint syntax error at or near ""
5168 DETAIL:  NoSeqScan hint accepts only one relation.
5169 LOG:  pg_hint_plan:
5170 used hint:
5171 not used hint:
5172 duplication hint:
5173 error hint:
5174 NoSeqScan(ti1 ti1_pkey ti1_btree)
5175
5176             QUERY PLAN             
5177 -----------------------------------
5178  Tid Scan on ti1
5179    TID Cond: (ctid = '(1,1)'::tid)
5180    Filter: (c1 = 1)
5181 (3 rows)
5182
5183 -- No. S-3-13-16
5184 /*+NoIndexScan(ti1)*/
5185 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5186 LOG:  pg_hint_plan:
5187 used hint:
5188 NoIndexScan(ti1)
5189 not used hint:
5190 duplication hint:
5191 error hint:
5192
5193             QUERY PLAN             
5194 -----------------------------------
5195  Tid Scan on ti1
5196    TID Cond: (ctid = '(1,1)'::tid)
5197    Filter: (c1 = 1)
5198 (3 rows)
5199
5200 -- No. S-3-13-17
5201 /*+NoIndexScan(ti1 ti1_pkey)*/
5202 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5203 INFO:  hint syntax error at or near ""
5204 DETAIL:  NoIndexScan hint accepts only one relation.
5205 LOG:  pg_hint_plan:
5206 used hint:
5207 not used hint:
5208 duplication hint:
5209 error hint:
5210 NoIndexScan(ti1 ti1_pkey)
5211
5212             QUERY PLAN             
5213 -----------------------------------
5214  Tid Scan on ti1
5215    TID Cond: (ctid = '(1,1)'::tid)
5216    Filter: (c1 = 1)
5217 (3 rows)
5218
5219 -- No. S-3-13-18
5220 /*+NoIndexScan(ti1 ti1_pkey ti1_btree)*/
5221 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5222 INFO:  hint syntax error at or near ""
5223 DETAIL:  NoIndexScan hint accepts only one relation.
5224 LOG:  pg_hint_plan:
5225 used hint:
5226 not used hint:
5227 duplication hint:
5228 error hint:
5229 NoIndexScan(ti1 ti1_pkey ti1_btree)
5230
5231             QUERY PLAN             
5232 -----------------------------------
5233  Tid Scan on ti1
5234    TID Cond: (ctid = '(1,1)'::tid)
5235    Filter: (c1 = 1)
5236 (3 rows)
5237
5238 -- No. S-3-13-19
5239 /*+NoBitmapScan(ti1)*/
5240 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5241 LOG:  pg_hint_plan:
5242 used hint:
5243 NoBitmapScan(ti1)
5244 not used hint:
5245 duplication hint:
5246 error hint:
5247
5248             QUERY PLAN             
5249 -----------------------------------
5250  Tid Scan on ti1
5251    TID Cond: (ctid = '(1,1)'::tid)
5252    Filter: (c1 = 1)
5253 (3 rows)
5254
5255 -- No. S-3-13-20
5256 /*+NoBitmapScan(ti1 ti1_pkey)*/
5257 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5258 INFO:  hint syntax error at or near ""
5259 DETAIL:  NoBitmapScan hint accepts only one relation.
5260 LOG:  pg_hint_plan:
5261 used hint:
5262 not used hint:
5263 duplication hint:
5264 error hint:
5265 NoBitmapScan(ti1 ti1_pkey)
5266
5267             QUERY PLAN             
5268 -----------------------------------
5269  Tid Scan on ti1
5270    TID Cond: (ctid = '(1,1)'::tid)
5271    Filter: (c1 = 1)
5272 (3 rows)
5273
5274 -- No. S-3-13-21
5275 /*+NoBitmapScan(ti1 ti1_pkey ti1_btree)*/
5276 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5277 INFO:  hint syntax error at or near ""
5278 DETAIL:  NoBitmapScan hint accepts only one relation.
5279 LOG:  pg_hint_plan:
5280 used hint:
5281 not used hint:
5282 duplication hint:
5283 error hint:
5284 NoBitmapScan(ti1 ti1_pkey ti1_btree)
5285
5286             QUERY PLAN             
5287 -----------------------------------
5288  Tid Scan on ti1
5289    TID Cond: (ctid = '(1,1)'::tid)
5290    Filter: (c1 = 1)
5291 (3 rows)
5292
5293 -- No. S-3-13-22
5294 /*+NoTidScan(ti1)*/
5295 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5296 LOG:  pg_hint_plan:
5297 used hint:
5298 NoTidScan(ti1)
5299 not used hint:
5300 duplication hint:
5301 error hint:
5302
5303             QUERY PLAN            
5304 ----------------------------------
5305  Index Scan using ti1_uniq on ti1
5306    Index Cond: (c1 = 1)
5307    Filter: (ctid = '(1,1)'::tid)
5308 (3 rows)
5309
5310 -- No. S-3-13-23
5311 /*+NoTidScan(ti1 ti1_pkey)*/
5312 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5313 INFO:  hint syntax error at or near ""
5314 DETAIL:  NoTidScan hint accepts only one relation.
5315 LOG:  pg_hint_plan:
5316 used hint:
5317 not used hint:
5318 duplication hint:
5319 error hint:
5320 NoTidScan(ti1 ti1_pkey)
5321
5322             QUERY PLAN             
5323 -----------------------------------
5324  Tid Scan on ti1
5325    TID Cond: (ctid = '(1,1)'::tid)
5326    Filter: (c1 = 1)
5327 (3 rows)
5328
5329 -- No. S-3-13-24
5330 /*+NoTidScan(ti1 ti1_pkey ti1_btree)*/
5331 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5332 INFO:  hint syntax error at or near ""
5333 DETAIL:  NoTidScan hint accepts only one relation.
5334 LOG:  pg_hint_plan:
5335 used hint:
5336 not used hint:
5337 duplication hint:
5338 error hint:
5339 NoTidScan(ti1 ti1_pkey ti1_btree)
5340
5341             QUERY PLAN             
5342 -----------------------------------
5343  Tid Scan on ti1
5344    TID Cond: (ctid = '(1,1)'::tid)
5345    Filter: (c1 = 1)
5346 (3 rows)
5347
5348 -- No. S-3-13-25
5349 /*+IndexOnlyScan(ti1)*/
5350 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
5351 INFO:  hint syntax error at or near "IndexOnlyScan(ti1)"
5352 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
5353      QUERY PLAN      
5354 ---------------------
5355  Seq Scan on ti1
5356    Filter: (c1 >= 1)
5357 (2 rows)
5358
5359 -- No. S-3-13-26
5360 /*+IndexOnlyScan(ti1 ti1_pkey)*/
5361 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
5362 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_pkey)"
5363 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
5364      QUERY PLAN      
5365 ---------------------
5366  Seq Scan on ti1
5367    Filter: (c1 >= 1)
5368 (2 rows)
5369
5370 -- No. S-3-13-27
5371 /*+IndexOnlyScan(ti1 ti1_pkey ti1_btree)*/
5372 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
5373 INFO:  hint syntax error at or near "IndexOnlyScan(ti1 ti1_pkey ti1_btree)"
5374 DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
5375      QUERY PLAN      
5376 ---------------------
5377  Seq Scan on ti1
5378    Filter: (c1 >= 1)
5379 (2 rows)
5380
5381 -- No. S-3-13-28
5382 /*+NoIndexOnlyScan(ti1)*/
5383 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
5384 INFO:  hint syntax error at or near "NoIndexOnlyScan(ti1)"
5385 DETAIL:  Unrecognized hint keyword "NoIndexOnlyScan".
5386             QUERY PLAN            
5387 ----------------------------------
5388  Index Scan using ti1_uniq on ti1
5389    Index Cond: (c1 = 1)
5390 (2 rows)
5391
5392 -- No. S-3-13-29
5393 /*+NoIndexOnlyScan(ti1 ti1_pkey)*/
5394 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
5395 INFO:  hint syntax error at or near "NoIndexOnlyScan(ti1 ti1_pkey)"
5396 DETAIL:  Unrecognized hint keyword "NoIndexOnlyScan".
5397             QUERY PLAN            
5398 ----------------------------------
5399  Index Scan using ti1_uniq on ti1
5400    Index Cond: (c1 = 1)
5401 (2 rows)
5402
5403 -- No. S-3-13-30
5404 /*+NoIndexOnlyScan(ti1 ti1_pkey ti1_btree)*/
5405 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
5406 INFO:  hint syntax error at or near "NoIndexOnlyScan(ti1 ti1_pkey ti1_btree)"
5407 DETAIL:  Unrecognized hint keyword "NoIndexOnlyScan".
5408             QUERY PLAN            
5409 ----------------------------------
5410  Index Scan using ti1_uniq on ti1
5411    Index Cond: (c1 = 1)
5412 (2 rows)
5413