OSDN Git Service

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