OSDN Git Service

Catch up with the latest master
[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                  ->  Seq Scan on t2 b1t2
1633                        Filter: (ctid = '(1,1)'::tid)
1634    InitPlan 2 (returns $1)
1635      ->  Aggregate
1636            ->  Nested Loop
1637                  Join Filter: (b2t1.c1 = b2t2.c1)
1638                  ->  Tid Scan on t1 b2t1
1639                        TID Cond: (ctid = '(1,1)'::tid)
1640                  ->  Seq Scan on t2 b2t2
1641                        Filter: (ctid = '(1,1)'::tid)
1642    InitPlan 3 (returns $2)
1643      ->  Aggregate
1644            ->  Nested Loop
1645                  Join Filter: (b3t1.c1 = b3t2.c1)
1646                  ->  Tid Scan on t1 b3t1
1647                        TID Cond: (ctid = '(1,1)'::tid)
1648                  ->  Seq Scan on t2 b3t2
1649                        Filter: (ctid = '(1,1)'::tid)
1650    ->  Nested Loop
1651          ->  Nested Loop
1652                Join Filter: (bmt1.c1 = bmt2.c1)
1653                ->  Tid Scan on t1 bmt1
1654                      TID Cond: (ctid = '(1,1)'::tid)
1655                      Filter: (c1 <> $2)
1656                ->  Seq Scan on t2 bmt2
1657                      Filter: (ctid = '(1,1)'::tid)
1658          ->  CTE Scan on c1
1659 (34 rows)
1660
1661 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)
1662 TidScan(b1t1)SeqScan(b1t2)
1663 BitmapScan(b2t1 t1_pkey)TidScan(b2t2)
1664 IndexScan(b3t1 t1_pkey)BitmapScan(b3t2 t2_pkey)
1665 */
1666 EXPLAIN (COSTS false)
1667 WITH c1 (c1) AS (
1668 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)'
1669 )
1670 SELECT max(bmt1.c1), (
1671 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)'
1672 )
1673                     FROM s1.t1 bmt1, s1.t2 bmt2, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)'
1674 AND bmt1.c1 <> (
1675 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)'
1676 )
1677 ;
1678 LOG:  available indexes for BitmapScan(b2t1): t1_pkey
1679 LOG:  available indexes for IndexScan(b3t1): t1_pkey
1680 LOG:  available indexes for BitmapScan(b3t2): t2_pkey
1681 LOG:  available indexes for IndexScan(bmt2): t2_pkey
1682 LOG:  pg_hint_plan:
1683 used hint:
1684 TidScan(b1t1)
1685 SeqScan(b1t2)
1686 BitmapScan(b2t1 t1_pkey)
1687 TidScan(b2t2)
1688 IndexScan(b3t1 t1_pkey)
1689 BitmapScan(b3t2 t2_pkey)
1690 SeqScan(bmt1)
1691 IndexScan(bmt2 t2_pkey)
1692 not used hint:
1693 duplication hint:
1694 error hint:
1695
1696                              QUERY PLAN                             
1697 --------------------------------------------------------------------
1698  Aggregate
1699    CTE c1
1700      ->  Aggregate
1701            ->  Nested Loop
1702                  Join Filter: (b1t1.c1 = b1t2.c1)
1703                  ->  Tid Scan on t1 b1t1
1704                        TID Cond: (ctid = '(1,1)'::tid)
1705                  ->  Seq Scan on t2 b1t2
1706                        Filter: (ctid = '(1,1)'::tid)
1707    InitPlan 2 (returns $2)
1708      ->  Aggregate
1709            ->  Nested Loop
1710                  ->  Tid Scan on t2 b2t2
1711                        TID Cond: (ctid = '(1,1)'::tid)
1712                  ->  Bitmap Heap Scan on t1 b2t1
1713                        Recheck Cond: (c1 = b2t2.c1)
1714                        Filter: (ctid = '(1,1)'::tid)
1715                        ->  Bitmap Index Scan on t1_pkey
1716                              Index Cond: (c1 = b2t2.c1)
1717    InitPlan 3 (returns $4)
1718      ->  Aggregate
1719            ->  Nested Loop
1720                  ->  Index Scan using t1_pkey on t1 b3t1
1721                        Filter: (ctid = '(1,1)'::tid)
1722                  ->  Bitmap Heap Scan on t2 b3t2
1723                        Recheck Cond: (c1 = b3t1.c1)
1724                        Filter: (ctid = '(1,1)'::tid)
1725                        ->  Bitmap Index Scan on t2_pkey
1726                              Index Cond: (c1 = b3t1.c1)
1727    ->  Nested Loop
1728          ->  Nested Loop
1729                Join Filter: (bmt1.c1 = bmt2.c1)
1730                ->  Seq Scan on t1 bmt1
1731                      Filter: ((c1 <> $4) AND (ctid = '(1,1)'::tid))
1732                ->  Index Scan using t2_pkey on t2 bmt2
1733                      Filter: (ctid = '(1,1)'::tid)
1734          ->  CTE Scan on c1
1735 (37 rows)
1736
1737 -- No. S-2-2-3
1738 EXPLAIN (COSTS false)
1739 WITH c1 (c1) AS (
1740 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)'
1741 )
1742 SELECT max(bmt1.c1), (
1743 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)'
1744 )
1745                     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
1746 AND bmt1.c1 <> (
1747 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)'
1748 )
1749 ;
1750                             QUERY PLAN                             
1751 -------------------------------------------------------------------
1752  Aggregate
1753    CTE c1
1754      ->  Aggregate
1755            ->  Nested Loop
1756                  Join Filter: (b1t1.c1 = b1t4.c1)
1757                  ->  Nested Loop
1758                        Join Filter: (b1t1.c1 = b1t3.c1)
1759                        ->  Nested Loop
1760                              Join Filter: (b1t1.c1 = b1t2.c1)
1761                              ->  Tid Scan on t1 b1t1
1762                                    TID Cond: (ctid = '(1,1)'::tid)
1763                              ->  Seq Scan on t2 b1t2
1764                                    Filter: (ctid = '(1,1)'::tid)
1765                        ->  Tid Scan on t3 b1t3
1766                              TID Cond: (ctid = '(1,1)'::tid)
1767                  ->  Tid Scan on t4 b1t4
1768                        TID Cond: (ctid = '(1,1)'::tid)
1769    InitPlan 2 (returns $1)
1770      ->  Aggregate
1771            ->  Nested Loop
1772                  Join Filter: (b2t1.c1 = b2t4.c1)
1773                  ->  Nested Loop
1774                        Join Filter: (b2t1.c1 = b2t3.c1)
1775                        ->  Nested Loop
1776                              Join Filter: (b2t1.c1 = b2t2.c1)
1777                              ->  Tid Scan on t1 b2t1
1778                                    TID Cond: (ctid = '(1,1)'::tid)
1779                              ->  Seq Scan on t2 b2t2
1780                                    Filter: (ctid = '(1,1)'::tid)
1781                        ->  Tid Scan on t3 b2t3
1782                              TID Cond: (ctid = '(1,1)'::tid)
1783                  ->  Tid Scan on t4 b2t4
1784                        TID Cond: (ctid = '(1,1)'::tid)
1785    InitPlan 3 (returns $2)
1786      ->  Aggregate
1787            ->  Nested Loop
1788                  Join Filter: (b3t1.c1 = b3t4.c1)
1789                  ->  Nested Loop
1790                        Join Filter: (b3t1.c1 = b3t3.c1)
1791                        ->  Nested Loop
1792                              Join Filter: (b3t1.c1 = b3t2.c1)
1793                              ->  Tid Scan on t1 b3t1
1794                                    TID Cond: (ctid = '(1,1)'::tid)
1795                              ->  Seq Scan on t2 b3t2
1796                                    Filter: (ctid = '(1,1)'::tid)
1797                        ->  Tid Scan on t3 b3t3
1798                              TID Cond: (ctid = '(1,1)'::tid)
1799                  ->  Tid Scan on t4 b3t4
1800                        TID Cond: (ctid = '(1,1)'::tid)
1801    ->  Nested Loop
1802          Join Filter: (bmt1.c1 = c1.c1)
1803          ->  Nested Loop
1804                Join Filter: (bmt1.c1 = bmt4.c1)
1805                ->  Nested Loop
1806                      Join Filter: (bmt1.c1 = bmt3.c1)
1807                      ->  Nested Loop
1808                            Join Filter: (bmt1.c1 = bmt2.c1)
1809                            ->  Tid Scan on t1 bmt1
1810                                  TID Cond: (ctid = '(1,1)'::tid)
1811                                  Filter: (c1 <> $2)
1812                            ->  Seq Scan on t2 bmt2
1813                                  Filter: (ctid = '(1,1)'::tid)
1814                      ->  Tid Scan on t3 bmt3
1815                            TID Cond: (ctid = '(1,1)'::tid)
1816                ->  Tid Scan on t4 bmt4
1817                      TID Cond: (ctid = '(1,1)'::tid)
1818          ->  CTE Scan on c1
1819 (67 rows)
1820
1821 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
1822 TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
1823 BitmapScan(b2t1 t1_pkey)TidScan(b2t2)SeqScan(b2t3)IndexScan(b2t4 t4_pkey)
1824 IndexScan(b3t1 t1_pkey)BitmapScan(b3t2 t2_pkey)TidScan(b3t3)SeqScan(b3t4)
1825 */
1826 EXPLAIN (COSTS false)
1827 WITH c1 (c1) AS (
1828 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)'
1829 )
1830 SELECT max(bmt1.c1), (
1831 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)'
1832 )
1833                     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
1834 AND bmt1.c1 <> (
1835 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)'
1836 )
1837 ;
1838 LOG:  available indexes for IndexScan(b1t3): t3_pkey
1839 LOG:  available indexes for BitmapScan(b1t4): t4_pkey
1840 LOG:  available indexes for BitmapScan(b2t1): t1_pkey
1841 LOG:  available indexes for IndexScan(b2t4): t4_pkey
1842 LOG:  available indexes for IndexScan(b3t1): t1_pkey
1843 LOG:  available indexes for BitmapScan(b3t2): t2_pkey
1844 LOG:  available indexes for IndexScan(bmt2): t2_pkey
1845 LOG:  available indexes for BitmapScan(bmt3): t3_pkey
1846 LOG:  pg_hint_plan:
1847 used hint:
1848 TidScan(b1t1)
1849 SeqScan(b1t2)
1850 IndexScan(b1t3 t3_pkey)
1851 BitmapScan(b1t4 t4_pkey)
1852 BitmapScan(b2t1 t1_pkey)
1853 TidScan(b2t2)
1854 SeqScan(b2t3)
1855 IndexScan(b2t4 t4_pkey)
1856 IndexScan(b3t1 t1_pkey)
1857 BitmapScan(b3t2 t2_pkey)
1858 TidScan(b3t3)
1859 SeqScan(b3t4)
1860 SeqScan(bmt1)
1861 IndexScan(bmt2 t2_pkey)
1862 BitmapScan(bmt3 t3_pkey)
1863 TidScan(bmt4)
1864 not used hint:
1865 duplication hint:
1866 error hint:
1867
1868                                    QUERY PLAN                                   
1869 --------------------------------------------------------------------------------
1870  Aggregate
1871    CTE c1
1872      ->  Aggregate
1873            ->  Nested Loop
1874                  Join Filter: (b1t1.c1 = b1t4.c1)
1875                  ->  Nested Loop
1876                        Join Filter: (b1t1.c1 = b1t3.c1)
1877                        ->  Nested Loop
1878                              Join Filter: (b1t1.c1 = b1t2.c1)
1879                              ->  Tid Scan on t1 b1t1
1880                                    TID Cond: (ctid = '(1,1)'::tid)
1881                              ->  Seq Scan on t2 b1t2
1882                                    Filter: (ctid = '(1,1)'::tid)
1883                        ->  Index Scan using t3_pkey on t3 b1t3
1884                              Index Cond: (c1 = b1t2.c1)
1885                              Filter: (ctid = '(1,1)'::tid)
1886                  ->  Bitmap Heap Scan on t4 b1t4
1887                        Recheck Cond: (c1 = b1t2.c1)
1888                        Filter: (ctid = '(1,1)'::tid)
1889                        ->  Bitmap Index Scan on t4_pkey
1890                              Index Cond: (c1 = b1t2.c1)
1891    InitPlan 2 (returns $5)
1892      ->  Aggregate
1893            ->  Nested Loop
1894                  Join Filter: (b2t1.c1 = b2t4.c1)
1895                  ->  Nested Loop
1896                        Join Filter: (b2t2.c1 = b2t1.c1)
1897                        ->  Nested Loop
1898                              Join Filter: (b2t2.c1 = b2t3.c1)
1899                              ->  Tid Scan on t2 b2t2
1900                                    TID Cond: (ctid = '(1,1)'::tid)
1901                              ->  Seq Scan on t3 b2t3
1902                                    Filter: (ctid = '(1,1)'::tid)
1903                        ->  Bitmap Heap Scan on t1 b2t1
1904                              Recheck Cond: (c1 = b2t3.c1)
1905                              Filter: (ctid = '(1,1)'::tid)
1906                              ->  Bitmap Index Scan on t1_pkey
1907                                    Index Cond: (c1 = b2t3.c1)
1908                  ->  Index Scan using t4_pkey on t4 b2t4
1909                        Index Cond: (c1 = b2t2.c1)
1910                        Filter: (ctid = '(1,1)'::tid)
1911    InitPlan 3 (returns $8)
1912      ->  Aggregate
1913            ->  Nested Loop
1914                  Join Filter: (b3t1.c1 = b3t2.c1)
1915                  ->  Nested Loop
1916                        Join Filter: (b3t3.c1 = b3t1.c1)
1917                        ->  Nested Loop
1918                              Join Filter: (b3t3.c1 = b3t4.c1)
1919                              ->  Tid Scan on t3 b3t3
1920                                    TID Cond: (ctid = '(1,1)'::tid)
1921                              ->  Seq Scan on t4 b3t4
1922                                    Filter: (ctid = '(1,1)'::tid)
1923                        ->  Index Scan using t1_pkey on t1 b3t1
1924                              Index Cond: (c1 = b3t4.c1)
1925                              Filter: (ctid = '(1,1)'::tid)
1926                  ->  Bitmap Heap Scan on t2 b3t2
1927                        Recheck Cond: (c1 = b3t3.c1)
1928                        Filter: (ctid = '(1,1)'::tid)
1929                        ->  Bitmap Index Scan on t2_pkey
1930                              Index Cond: (c1 = b3t3.c1)
1931    ->  Nested Loop
1932          Join Filter: (bmt1.c1 = c1.c1)
1933          ->  Nested Loop
1934                Join Filter: (bmt1.c1 = bmt3.c1)
1935                ->  Nested Loop
1936                      Join Filter: (bmt1.c1 = bmt2.c1)
1937                      ->  Nested Loop
1938                            Join Filter: (bmt1.c1 = bmt4.c1)
1939                            ->  Seq Scan on t1 bmt1
1940                                  Filter: ((c1 <> $8) AND (ctid = '(1,1)'::tid))
1941                            ->  Tid Scan on t4 bmt4
1942                                  TID Cond: (ctid = '(1,1)'::tid)
1943                      ->  Index Scan using t2_pkey on t2 bmt2
1944                            Index Cond: (c1 = bmt4.c1)
1945                            Filter: (ctid = '(1,1)'::tid)
1946                ->  Bitmap Heap Scan on t3 bmt3
1947                      Recheck Cond: (c1 = bmt2.c1)
1948                      Filter: (ctid = '(1,1)'::tid)
1949                      ->  Bitmap Index Scan on t3_pkey
1950                            Index Cond: (c1 = bmt2.c1)
1951          ->  CTE Scan on c1
1952 (82 rows)
1953
1954 -- No. S-2-2-4
1955 EXPLAIN (COSTS false)
1956 WITH c1 (c1) AS (
1957 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
1958 )
1959 SELECT max(bmt1.c1), (
1960 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
1961 )
1962                     FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)' AND bmt1.c1 = c1.c1
1963 AND bmt1.c1 <> (
1964 SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)'
1965 )
1966 ;
1967                             QUERY PLAN                             
1968 -------------------------------------------------------------------
1969  Aggregate
1970    CTE c1
1971      ->  Aggregate
1972            ->  Nested Loop
1973                  Join Filter: (b1t1.c1 = b1t4.c1)
1974                  ->  Nested Loop
1975                        Join Filter: (b1t1.c1 = b1t3.c1)
1976                        ->  Nested Loop
1977                              Join Filter: (b1t1.c1 = b1t2.c1)
1978                              ->  Tid Scan on t1 b1t1
1979                                    TID Cond: (ctid = '(1,1)'::tid)
1980                              ->  Seq Scan on t2 b1t2
1981                                    Filter: (ctid = '(1,1)'::tid)
1982                        ->  Tid Scan on t3 b1t3
1983                              TID Cond: (ctid = '(1,1)'::tid)
1984                  ->  Tid Scan on t4 b1t4
1985                        TID Cond: (ctid = '(1,1)'::tid)
1986    InitPlan 3 (returns $2)
1987      ->  Result
1988            InitPlan 2 (returns $1)
1989              ->  Limit
1990                    ->  Tid Scan on t1 b2t1
1991                          TID Cond: (ctid = '(1,1)'::tid)
1992                          Filter: ((c1 IS NOT NULL) AND (c1 = 1))
1993    InitPlan 4 (returns $4)
1994      ->  Aggregate
1995            ->  Tid Scan on t1 b3t1
1996                  TID Cond: (ctid = '(1,1)'::tid)
1997    ->  Nested Loop
1998          Join Filter: (bmt1.c1 = c1.c1)
1999          ->  Nested Loop
2000                Join Filter: (bmt1.c1 = bmt4.c1)
2001                ->  Nested Loop
2002                      Join Filter: (bmt1.c1 = bmt3.c1)
2003                      ->  Nested Loop
2004                            Join Filter: (bmt1.c1 = bmt2.c1)
2005                            ->  Tid Scan on t1 bmt1
2006                                  TID Cond: (ctid = '(1,1)'::tid)
2007                                  Filter: (c1 <> $4)
2008                            ->  Seq Scan on t2 bmt2
2009                                  Filter: (ctid = '(1,1)'::tid)
2010                      ->  Tid Scan on t3 bmt3
2011                            TID Cond: (ctid = '(1,1)'::tid)
2012                ->  Tid Scan on t4 bmt4
2013                      TID Cond: (ctid = '(1,1)'::tid)
2014          ->  CTE Scan on c1
2015 (46 rows)
2016
2017 /*+SeqScan(bmt1)IndexScan(bmt2 t2_pkey)BitmapScan(bmt3 t3_pkey)TidScan(bmt4)
2018 TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
2019 BitmapScan(b2t1 t1_pkey)
2020 IndexScan(b3t1 t1_pkey)
2021 */
2022 EXPLAIN (COSTS false)
2023 WITH c1 (c1) AS (
2024 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
2025 )
2026 SELECT max(bmt1.c1), (
2027 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
2028 )
2029                     FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)' AND bmt1.c1 = c1.c1
2030 AND bmt1.c1 <> (
2031 SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)'
2032 )
2033 ;
2034 LOG:  available indexes for IndexScan(b1t3): t3_pkey
2035 LOG:  available indexes for BitmapScan(b1t4): t4_pkey
2036 LOG:  available indexes for BitmapScan(b2t1): t1_pkey
2037 LOG:  available indexes for BitmapScan(b2t1): t1_pkey
2038 LOG:  available indexes for IndexScan(b3t1): t1_pkey
2039 LOG:  available indexes for IndexScan(b3t1): t1_pkey
2040 LOG:  available indexes for IndexScan(bmt2): t2_pkey
2041 LOG:  available indexes for BitmapScan(bmt3): t3_pkey
2042 LOG:  pg_hint_plan:
2043 used hint:
2044 TidScan(b1t1)
2045 SeqScan(b1t2)
2046 IndexScan(b1t3 t3_pkey)
2047 BitmapScan(b1t4 t4_pkey)
2048 BitmapScan(b2t1 t1_pkey)
2049 IndexScan(b3t1 t1_pkey)
2050 SeqScan(bmt1)
2051 IndexScan(bmt2 t2_pkey)
2052 BitmapScan(bmt3 t3_pkey)
2053 TidScan(bmt4)
2054 not used hint:
2055 duplication hint:
2056 error hint:
2057
2058                                    QUERY PLAN                                   
2059 --------------------------------------------------------------------------------
2060  Aggregate
2061    CTE c1
2062      ->  Aggregate
2063            ->  Nested Loop
2064                  Join Filter: (b1t1.c1 = b1t4.c1)
2065                  ->  Nested Loop
2066                        Join Filter: (b1t1.c1 = b1t3.c1)
2067                        ->  Nested Loop
2068                              Join Filter: (b1t1.c1 = b1t2.c1)
2069                              ->  Tid Scan on t1 b1t1
2070                                    TID Cond: (ctid = '(1,1)'::tid)
2071                              ->  Seq Scan on t2 b1t2
2072                                    Filter: (ctid = '(1,1)'::tid)
2073                        ->  Index Scan using t3_pkey on t3 b1t3
2074                              Index Cond: (c1 = b1t2.c1)
2075                              Filter: (ctid = '(1,1)'::tid)
2076                  ->  Bitmap Heap Scan on t4 b1t4
2077                        Recheck Cond: (c1 = b1t2.c1)
2078                        Filter: (ctid = '(1,1)'::tid)
2079                        ->  Bitmap Index Scan on t4_pkey
2080                              Index Cond: (c1 = b1t2.c1)
2081    InitPlan 3 (returns $4)
2082      ->  Result
2083            InitPlan 2 (returns $3)
2084              ->  Limit
2085                    ->  Bitmap Heap Scan on t1 b2t1
2086                          Recheck Cond: ((c1 IS NOT NULL) AND (c1 = 1))
2087                          Filter: (ctid = '(1,1)'::tid)
2088                          ->  Bitmap Index Scan on t1_pkey
2089                                Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
2090    InitPlan 5 (returns $6)
2091      ->  Result
2092            InitPlan 4 (returns $5)
2093              ->  Limit
2094                    ->  Index Scan Backward using t1_pkey on t1 b3t1
2095                          Index Cond: (c1 IS NOT NULL)
2096                          Filter: (ctid = '(1,1)'::tid)
2097    ->  Nested Loop
2098          Join Filter: (bmt1.c1 = c1.c1)
2099          ->  Nested Loop
2100                Join Filter: (bmt1.c1 = bmt3.c1)
2101                ->  Nested Loop
2102                      Join Filter: (bmt1.c1 = bmt2.c1)
2103                      ->  Nested Loop
2104                            Join Filter: (bmt1.c1 = bmt4.c1)
2105                            ->  Seq Scan on t1 bmt1
2106                                  Filter: ((c1 <> $6) AND (ctid = '(1,1)'::tid))
2107                            ->  Tid Scan on t4 bmt4
2108                                  TID Cond: (ctid = '(1,1)'::tid)
2109                      ->  Index Scan using t2_pkey on t2 bmt2
2110                            Index Cond: (c1 = bmt4.c1)
2111                            Filter: (ctid = '(1,1)'::tid)
2112                ->  Bitmap Heap Scan on t3 bmt3
2113                      Recheck Cond: (c1 = bmt2.c1)
2114                      Filter: (ctid = '(1,1)'::tid)
2115                      ->  Bitmap Index Scan on t3_pkey
2116                            Index Cond: (c1 = bmt2.c1)
2117          ->  CTE Scan on c1
2118 (58 rows)
2119
2120 ----
2121 ---- No. S-2-3 RULE or VIEW
2122 ----
2123 -- No. S-2-3-1
2124 EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2125                            QUERY PLAN                            
2126 -----------------------------------------------------------------
2127  Aggregate
2128    ->  Nested Loop
2129          Join Filter: (t1.c1 = t4.c1)
2130          ->  Nested Loop
2131                Join Filter: (t1.c1 = t3.c1)
2132                ->  Nested Loop
2133                      Join Filter: (t1.c1 = t2.c1)
2134                      ->  Nested Loop
2135                            ->  Tid Scan on r1
2136                                  TID Cond: (ctid = '(1,1)'::tid)
2137                                  Filter: (c1 = 1)
2138                            ->  Tid Scan on t1
2139                                  TID Cond: (ctid = '(1,1)'::tid)
2140                      ->  Seq Scan on t2
2141                            Filter: (ctid = '(1,1)'::tid)
2142                ->  Tid Scan on t3
2143                      TID Cond: (ctid = '(1,1)'::tid)
2144          ->  Tid Scan on t4
2145                TID Cond: (ctid = '(1,1)'::tid)
2146 (19 rows)
2147
2148 /*+TidScan(t1)SeqScan(t2)IndexScan(t3 t3_pkey)BitmapScan(t4 t4_pkey)
2149 SeqScan(r1)*/
2150 EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2151 LOG:  available indexes for IndexScan(t3): t3_pkey
2152 LOG:  available indexes for BitmapScan(t4): t4_pkey
2153 LOG:  pg_hint_plan:
2154 used hint:
2155 SeqScan(r1)
2156 TidScan(t1)
2157 SeqScan(t2)
2158 IndexScan(t3 t3_pkey)
2159 BitmapScan(t4 t4_pkey)
2160 not used hint:
2161 duplication hint:
2162 error hint:
2163
2164                                   QUERY PLAN                                  
2165 ------------------------------------------------------------------------------
2166  Aggregate
2167    ->  Nested Loop
2168          Join Filter: (t1.c1 = t4.c1)
2169          ->  Nested Loop
2170                Join Filter: (t1.c1 = t3.c1)
2171                ->  Nested Loop
2172                      Join Filter: (t1.c1 = t2.c1)
2173                      ->  Nested Loop
2174                            ->  Seq Scan on r1
2175                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2176                            ->  Tid Scan on t1
2177                                  TID Cond: (ctid = '(1,1)'::tid)
2178                      ->  Seq Scan on t2
2179                            Filter: (ctid = '(1,1)'::tid)
2180                ->  Index Scan using t3_pkey on t3
2181                      Index Cond: (c1 = t2.c1)
2182                      Filter: (ctid = '(1,1)'::tid)
2183          ->  Bitmap Heap Scan on t4
2184                Recheck Cond: (c1 = t2.c1)
2185                Filter: (ctid = '(1,1)'::tid)
2186                ->  Bitmap Index Scan on t4_pkey
2187                      Index Cond: (c1 = t2.c1)
2188 (22 rows)
2189
2190 EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2191                            QUERY PLAN                            
2192 -----------------------------------------------------------------
2193  Aggregate
2194    ->  Nested Loop
2195          Join Filter: (b1t1.c1 = b1t4.c1)
2196          ->  Nested Loop
2197                Join Filter: (b1t1.c1 = b1t3.c1)
2198                ->  Nested Loop
2199                      Join Filter: (b1t1.c1 = b1t2.c1)
2200                      ->  Nested Loop
2201                            ->  Tid Scan on r1_
2202                                  TID Cond: (ctid = '(1,1)'::tid)
2203                                  Filter: (c1 = 1)
2204                            ->  Tid Scan on t1 b1t1
2205                                  TID Cond: (ctid = '(1,1)'::tid)
2206                      ->  Seq Scan on t2 b1t2
2207                            Filter: (ctid = '(1,1)'::tid)
2208                ->  Tid Scan on t3 b1t3
2209                      TID Cond: (ctid = '(1,1)'::tid)
2210          ->  Tid Scan on t4 b1t4
2211                TID Cond: (ctid = '(1,1)'::tid)
2212 (19 rows)
2213
2214 /*+TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
2215 SeqScan(r1_)*/
2216 EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2217 LOG:  available indexes for IndexScan(b1t3): t3_pkey
2218 LOG:  available indexes for BitmapScan(b1t4): t4_pkey
2219 LOG:  pg_hint_plan:
2220 used hint:
2221 TidScan(b1t1)
2222 SeqScan(b1t2)
2223 IndexScan(b1t3 t3_pkey)
2224 BitmapScan(b1t4 t4_pkey)
2225 SeqScan(r1_)
2226 not used hint:
2227 duplication hint:
2228 error hint:
2229
2230                                   QUERY PLAN                                  
2231 ------------------------------------------------------------------------------
2232  Aggregate
2233    ->  Nested Loop
2234          Join Filter: (b1t1.c1 = b1t4.c1)
2235          ->  Nested Loop
2236                Join Filter: (b1t1.c1 = b1t3.c1)
2237                ->  Nested Loop
2238                      Join Filter: (b1t1.c1 = b1t2.c1)
2239                      ->  Nested Loop
2240                            ->  Seq Scan on r1_
2241                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2242                            ->  Tid Scan on t1 b1t1
2243                                  TID Cond: (ctid = '(1,1)'::tid)
2244                      ->  Seq Scan on t2 b1t2
2245                            Filter: (ctid = '(1,1)'::tid)
2246                ->  Index Scan using t3_pkey on t3 b1t3
2247                      Index Cond: (c1 = b1t2.c1)
2248                      Filter: (ctid = '(1,1)'::tid)
2249          ->  Bitmap Heap Scan on t4 b1t4
2250                Recheck Cond: (c1 = b1t2.c1)
2251                Filter: (ctid = '(1,1)'::tid)
2252                ->  Bitmap Index Scan on t4_pkey
2253                      Index Cond: (c1 = b1t2.c1)
2254 (22 rows)
2255
2256 -- No. S-2-3-2
2257 EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2258                            QUERY PLAN                            
2259 -----------------------------------------------------------------
2260  Aggregate
2261    ->  Nested Loop
2262          Join Filter: (t1.c1 = t4.c1)
2263          ->  Nested Loop
2264                Join Filter: (t1.c1 = t3.c1)
2265                ->  Nested Loop
2266                      Join Filter: (t1.c1 = t2.c1)
2267                      ->  Nested Loop
2268                            ->  Tid Scan on r2
2269                                  TID Cond: (ctid = '(1,1)'::tid)
2270                                  Filter: (c1 = 1)
2271                            ->  Tid Scan on t1
2272                                  TID Cond: (ctid = '(1,1)'::tid)
2273                      ->  Seq Scan on t2
2274                            Filter: (ctid = '(1,1)'::tid)
2275                ->  Tid Scan on t3
2276                      TID Cond: (ctid = '(1,1)'::tid)
2277          ->  Tid Scan on t4
2278                TID Cond: (ctid = '(1,1)'::tid)
2279  
2280  Aggregate
2281    ->  Nested Loop
2282          Join Filter: (t1.c1 = t4.c1)
2283          ->  Nested Loop
2284                Join Filter: (t1.c1 = t3.c1)
2285                ->  Nested Loop
2286                      Join Filter: (t1.c1 = t2.c1)
2287                      ->  Nested Loop
2288                            ->  Tid Scan on r2
2289                                  TID Cond: (ctid = '(1,1)'::tid)
2290                                  Filter: (c1 = 1)
2291                            ->  Tid Scan on t1
2292                                  TID Cond: (ctid = '(1,1)'::tid)
2293                      ->  Seq Scan on t2
2294                            Filter: (ctid = '(1,1)'::tid)
2295                ->  Tid Scan on t3
2296                      TID Cond: (ctid = '(1,1)'::tid)
2297          ->  Tid Scan on t4
2298                TID Cond: (ctid = '(1,1)'::tid)
2299 (39 rows)
2300
2301 /*+TidScan(t1)SeqScan(t2)IndexScan(t3 t3_pkey)BitmapScan(t4 t4_pkey)
2302 SeqScan(r2)*/
2303 EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2304 LOG:  available indexes for IndexScan(t3): t3_pkey
2305 LOG:  available indexes for BitmapScan(t4): t4_pkey
2306 LOG:  pg_hint_plan:
2307 used hint:
2308 SeqScan(r2)
2309 TidScan(t1)
2310 SeqScan(t2)
2311 IndexScan(t3 t3_pkey)
2312 BitmapScan(t4 t4_pkey)
2313 not used hint:
2314 duplication hint:
2315 error hint:
2316
2317 LOG:  available indexes for IndexScan(t3): t3_pkey
2318 LOG:  available indexes for BitmapScan(t4): t4_pkey
2319 LOG:  pg_hint_plan:
2320 used hint:
2321 SeqScan(r2)
2322 TidScan(t1)
2323 SeqScan(t2)
2324 IndexScan(t3 t3_pkey)
2325 BitmapScan(t4 t4_pkey)
2326 not used hint:
2327 duplication hint:
2328 error hint:
2329
2330                                   QUERY PLAN                                  
2331 ------------------------------------------------------------------------------
2332  Aggregate
2333    ->  Nested Loop
2334          Join Filter: (t1.c1 = t4.c1)
2335          ->  Nested Loop
2336                Join Filter: (t1.c1 = t3.c1)
2337                ->  Nested Loop
2338                      Join Filter: (t1.c1 = t2.c1)
2339                      ->  Nested Loop
2340                            ->  Seq Scan on r2
2341                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2342                            ->  Tid Scan on t1
2343                                  TID Cond: (ctid = '(1,1)'::tid)
2344                      ->  Seq Scan on t2
2345                            Filter: (ctid = '(1,1)'::tid)
2346                ->  Index Scan using t3_pkey on t3
2347                      Index Cond: (c1 = t2.c1)
2348                      Filter: (ctid = '(1,1)'::tid)
2349          ->  Bitmap Heap Scan on t4
2350                Recheck Cond: (c1 = t2.c1)
2351                Filter: (ctid = '(1,1)'::tid)
2352                ->  Bitmap Index Scan on t4_pkey
2353                      Index Cond: (c1 = t2.c1)
2354  
2355  Aggregate
2356    ->  Nested Loop
2357          Join Filter: (t1.c1 = t4.c1)
2358          ->  Nested Loop
2359                Join Filter: (t1.c1 = t3.c1)
2360                ->  Nested Loop
2361                      Join Filter: (t1.c1 = t2.c1)
2362                      ->  Nested Loop
2363                            ->  Seq Scan on r2
2364                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2365                            ->  Tid Scan on t1
2366                                  TID Cond: (ctid = '(1,1)'::tid)
2367                      ->  Seq Scan on t2
2368                            Filter: (ctid = '(1,1)'::tid)
2369                ->  Index Scan using t3_pkey on t3
2370                      Index Cond: (c1 = t2.c1)
2371                      Filter: (ctid = '(1,1)'::tid)
2372          ->  Bitmap Heap Scan on t4
2373                Recheck Cond: (c1 = t2.c1)
2374                Filter: (ctid = '(1,1)'::tid)
2375                ->  Bitmap Index Scan on t4_pkey
2376                      Index Cond: (c1 = t2.c1)
2377 (45 rows)
2378
2379 EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2380                            QUERY PLAN                            
2381 -----------------------------------------------------------------
2382  Aggregate
2383    ->  Nested Loop
2384          Join Filter: (b1t1.c1 = b1t4.c1)
2385          ->  Nested Loop
2386                Join Filter: (b1t1.c1 = b1t3.c1)
2387                ->  Nested Loop
2388                      Join Filter: (b1t1.c1 = b1t2.c1)
2389                      ->  Nested Loop
2390                            ->  Tid Scan on r2_
2391                                  TID Cond: (ctid = '(1,1)'::tid)
2392                                  Filter: (c1 = 1)
2393                            ->  Tid Scan on t1 b1t1
2394                                  TID Cond: (ctid = '(1,1)'::tid)
2395                      ->  Seq Scan on t2 b1t2
2396                            Filter: (ctid = '(1,1)'::tid)
2397                ->  Tid Scan on t3 b1t3
2398                      TID Cond: (ctid = '(1,1)'::tid)
2399          ->  Tid Scan on t4 b1t4
2400                TID Cond: (ctid = '(1,1)'::tid)
2401  
2402  Aggregate
2403    ->  Nested Loop
2404          Join Filter: (b2t1.c1 = b2t4.c1)
2405          ->  Nested Loop
2406                Join Filter: (b2t1.c1 = b2t3.c1)
2407                ->  Nested Loop
2408                      Join Filter: (b2t1.c1 = b2t2.c1)
2409                      ->  Nested Loop
2410                            ->  Tid Scan on r2_
2411                                  TID Cond: (ctid = '(1,1)'::tid)
2412                                  Filter: (c1 = 1)
2413                            ->  Tid Scan on t1 b2t1
2414                                  TID Cond: (ctid = '(1,1)'::tid)
2415                      ->  Seq Scan on t2 b2t2
2416                            Filter: (ctid = '(1,1)'::tid)
2417                ->  Tid Scan on t3 b2t3
2418                      TID Cond: (ctid = '(1,1)'::tid)
2419          ->  Tid Scan on t4 b2t4
2420                TID Cond: (ctid = '(1,1)'::tid)
2421 (39 rows)
2422
2423 /*+TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
2424 BitmapScan(b2t1 t1_pkey)TidScan(b2t2)SeqScan(b2t3)IndexScan(b2t4 t4_pkey)
2425 SeqScan(r2_)*/
2426 EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2427 LOG:  available indexes for IndexScan(b1t3): t3_pkey
2428 LOG:  available indexes for BitmapScan(b1t4): t4_pkey
2429 LOG:  pg_hint_plan:
2430 used hint:
2431 TidScan(b1t1)
2432 SeqScan(b1t2)
2433 IndexScan(b1t3 t3_pkey)
2434 BitmapScan(b1t4 t4_pkey)
2435 SeqScan(r2_)
2436 not used hint:
2437 BitmapScan(b2t1 t1_pkey)
2438 TidScan(b2t2)
2439 SeqScan(b2t3)
2440 IndexScan(b2t4 t4_pkey)
2441 duplication hint:
2442 error hint:
2443
2444 LOG:  available indexes for BitmapScan(b2t1): t1_pkey
2445 LOG:  available indexes for IndexScan(b2t4): t4_pkey
2446 LOG:  pg_hint_plan:
2447 used hint:
2448 BitmapScan(b2t1 t1_pkey)
2449 TidScan(b2t2)
2450 SeqScan(b2t3)
2451 IndexScan(b2t4 t4_pkey)
2452 SeqScan(r2_)
2453 not used hint:
2454 TidScan(b1t1)
2455 SeqScan(b1t2)
2456 IndexScan(b1t3 t3_pkey)
2457 BitmapScan(b1t4 t4_pkey)
2458 duplication hint:
2459 error hint:
2460
2461                                   QUERY PLAN                                  
2462 ------------------------------------------------------------------------------
2463  Aggregate
2464    ->  Nested Loop
2465          Join Filter: (b1t1.c1 = b1t4.c1)
2466          ->  Nested Loop
2467                Join Filter: (b1t1.c1 = b1t3.c1)
2468                ->  Nested Loop
2469                      Join Filter: (b1t1.c1 = b1t2.c1)
2470                      ->  Nested Loop
2471                            ->  Seq Scan on r2_
2472                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2473                            ->  Tid Scan on t1 b1t1
2474                                  TID Cond: (ctid = '(1,1)'::tid)
2475                      ->  Seq Scan on t2 b1t2
2476                            Filter: (ctid = '(1,1)'::tid)
2477                ->  Index Scan using t3_pkey on t3 b1t3
2478                      Index Cond: (c1 = b1t2.c1)
2479                      Filter: (ctid = '(1,1)'::tid)
2480          ->  Bitmap Heap Scan on t4 b1t4
2481                Recheck Cond: (c1 = b1t2.c1)
2482                Filter: (ctid = '(1,1)'::tid)
2483                ->  Bitmap Index Scan on t4_pkey
2484                      Index Cond: (c1 = b1t2.c1)
2485  
2486  Aggregate
2487    ->  Nested Loop
2488          Join Filter: (b2t1.c1 = b2t4.c1)
2489          ->  Nested Loop
2490                Join Filter: (b2t2.c1 = b2t1.c1)
2491                ->  Nested Loop
2492                      Join Filter: (b2t2.c1 = b2t3.c1)
2493                      ->  Nested Loop
2494                            ->  Seq Scan on r2_
2495                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2496                            ->  Tid Scan on t2 b2t2
2497                                  TID Cond: (ctid = '(1,1)'::tid)
2498                      ->  Seq Scan on t3 b2t3
2499                            Filter: (ctid = '(1,1)'::tid)
2500                ->  Bitmap Heap Scan on t1 b2t1
2501                      Recheck Cond: (c1 = b2t3.c1)
2502                      Filter: (ctid = '(1,1)'::tid)
2503                      ->  Bitmap Index Scan on t1_pkey
2504                            Index Cond: (c1 = b2t3.c1)
2505          ->  Index Scan using t4_pkey on t4 b2t4
2506                Index Cond: (c1 = b2t2.c1)
2507                Filter: (ctid = '(1,1)'::tid)
2508 (45 rows)
2509
2510 -- No. S-2-3-3
2511 EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2512                            QUERY PLAN                            
2513 -----------------------------------------------------------------
2514  Aggregate
2515    ->  Nested Loop
2516          Join Filter: (t1.c1 = t4.c1)
2517          ->  Nested Loop
2518                Join Filter: (t1.c1 = t3.c1)
2519                ->  Nested Loop
2520                      Join Filter: (t1.c1 = t2.c1)
2521                      ->  Nested Loop
2522                            ->  Tid Scan on r3
2523                                  TID Cond: (ctid = '(1,1)'::tid)
2524                                  Filter: (c1 = 1)
2525                            ->  Tid Scan on t1
2526                                  TID Cond: (ctid = '(1,1)'::tid)
2527                      ->  Seq Scan on t2
2528                            Filter: (ctid = '(1,1)'::tid)
2529                ->  Tid Scan on t3
2530                      TID Cond: (ctid = '(1,1)'::tid)
2531          ->  Tid Scan on t4
2532                TID Cond: (ctid = '(1,1)'::tid)
2533  
2534  Aggregate
2535    ->  Nested Loop
2536          Join Filter: (t1.c1 = t4.c1)
2537          ->  Nested Loop
2538                Join Filter: (t1.c1 = t3.c1)
2539                ->  Nested Loop
2540                      Join Filter: (t1.c1 = t2.c1)
2541                      ->  Nested Loop
2542                            ->  Tid Scan on r3
2543                                  TID Cond: (ctid = '(1,1)'::tid)
2544                                  Filter: (c1 = 1)
2545                            ->  Tid Scan on t1
2546                                  TID Cond: (ctid = '(1,1)'::tid)
2547                      ->  Seq Scan on t2
2548                            Filter: (ctid = '(1,1)'::tid)
2549                ->  Tid Scan on t3
2550                      TID Cond: (ctid = '(1,1)'::tid)
2551          ->  Tid Scan on t4
2552                TID Cond: (ctid = '(1,1)'::tid)
2553  
2554  Aggregate
2555    ->  Nested Loop
2556          Join Filter: (t1.c1 = t4.c1)
2557          ->  Nested Loop
2558                Join Filter: (t1.c1 = t3.c1)
2559                ->  Nested Loop
2560                      Join Filter: (t1.c1 = t2.c1)
2561                      ->  Nested Loop
2562                            ->  Tid Scan on r3
2563                                  TID Cond: (ctid = '(1,1)'::tid)
2564                                  Filter: (c1 = 1)
2565                            ->  Tid Scan on t1
2566                                  TID Cond: (ctid = '(1,1)'::tid)
2567                      ->  Seq Scan on t2
2568                            Filter: (ctid = '(1,1)'::tid)
2569                ->  Tid Scan on t3
2570                      TID Cond: (ctid = '(1,1)'::tid)
2571          ->  Tid Scan on t4
2572                TID Cond: (ctid = '(1,1)'::tid)
2573 (59 rows)
2574
2575 /*+TidScan(t1)SeqScan(t2)IndexScan(t3 t3_pkey)BitmapScan(t4 t4_pkey)
2576 SeqScan(r3)*/
2577 EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2578 LOG:  available indexes for IndexScan(t3): t3_pkey
2579 LOG:  available indexes for BitmapScan(t4): t4_pkey
2580 LOG:  pg_hint_plan:
2581 used hint:
2582 SeqScan(r3)
2583 TidScan(t1)
2584 SeqScan(t2)
2585 IndexScan(t3 t3_pkey)
2586 BitmapScan(t4 t4_pkey)
2587 not used hint:
2588 duplication hint:
2589 error hint:
2590
2591 LOG:  available indexes for IndexScan(t3): t3_pkey
2592 LOG:  available indexes for BitmapScan(t4): t4_pkey
2593 LOG:  pg_hint_plan:
2594 used hint:
2595 SeqScan(r3)
2596 TidScan(t1)
2597 SeqScan(t2)
2598 IndexScan(t3 t3_pkey)
2599 BitmapScan(t4 t4_pkey)
2600 not used hint:
2601 duplication hint:
2602 error hint:
2603
2604 LOG:  available indexes for IndexScan(t3): t3_pkey
2605 LOG:  available indexes for BitmapScan(t4): t4_pkey
2606 LOG:  pg_hint_plan:
2607 used hint:
2608 SeqScan(r3)
2609 TidScan(t1)
2610 SeqScan(t2)
2611 IndexScan(t3 t3_pkey)
2612 BitmapScan(t4 t4_pkey)
2613 not used hint:
2614 duplication hint:
2615 error hint:
2616
2617                                   QUERY PLAN                                  
2618 ------------------------------------------------------------------------------
2619  Aggregate
2620    ->  Nested Loop
2621          Join Filter: (t1.c1 = t4.c1)
2622          ->  Nested Loop
2623                Join Filter: (t1.c1 = t3.c1)
2624                ->  Nested Loop
2625                      Join Filter: (t1.c1 = t2.c1)
2626                      ->  Nested Loop
2627                            ->  Seq Scan on r3
2628                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2629                            ->  Tid Scan on t1
2630                                  TID Cond: (ctid = '(1,1)'::tid)
2631                      ->  Seq Scan on t2
2632                            Filter: (ctid = '(1,1)'::tid)
2633                ->  Index Scan using t3_pkey on t3
2634                      Index Cond: (c1 = t2.c1)
2635                      Filter: (ctid = '(1,1)'::tid)
2636          ->  Bitmap Heap Scan on t4
2637                Recheck Cond: (c1 = t2.c1)
2638                Filter: (ctid = '(1,1)'::tid)
2639                ->  Bitmap Index Scan on t4_pkey
2640                      Index Cond: (c1 = t2.c1)
2641  
2642  Aggregate
2643    ->  Nested Loop
2644          Join Filter: (t1.c1 = t4.c1)
2645          ->  Nested Loop
2646                Join Filter: (t1.c1 = t3.c1)
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 = t2.c1)
2658                      Filter: (ctid = '(1,1)'::tid)
2659          ->  Bitmap Heap Scan on t4
2660                Recheck Cond: (c1 = t2.c1)
2661                Filter: (ctid = '(1,1)'::tid)
2662                ->  Bitmap Index Scan on t4_pkey
2663                      Index Cond: (c1 = t2.c1)
2664  
2665  Aggregate
2666    ->  Nested Loop
2667          Join Filter: (t1.c1 = t4.c1)
2668          ->  Nested Loop
2669                Join Filter: (t1.c1 = t3.c1)
2670                ->  Nested Loop
2671                      Join Filter: (t1.c1 = t2.c1)
2672                      ->  Nested Loop
2673                            ->  Seq Scan on r3
2674                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2675                            ->  Tid Scan on t1
2676                                  TID Cond: (ctid = '(1,1)'::tid)
2677                      ->  Seq Scan on t2
2678                            Filter: (ctid = '(1,1)'::tid)
2679                ->  Index Scan using t3_pkey on t3
2680                      Index Cond: (c1 = t2.c1)
2681                      Filter: (ctid = '(1,1)'::tid)
2682          ->  Bitmap Heap Scan on t4
2683                Recheck Cond: (c1 = t2.c1)
2684                Filter: (ctid = '(1,1)'::tid)
2685                ->  Bitmap Index Scan on t4_pkey
2686                      Index Cond: (c1 = t2.c1)
2687 (68 rows)
2688
2689 EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2690                            QUERY PLAN                            
2691 -----------------------------------------------------------------
2692  Aggregate
2693    ->  Nested Loop
2694          Join Filter: (b1t1.c1 = b1t4.c1)
2695          ->  Nested Loop
2696                Join Filter: (b1t1.c1 = b1t3.c1)
2697                ->  Nested Loop
2698                      Join Filter: (b1t1.c1 = b1t2.c1)
2699                      ->  Nested Loop
2700                            ->  Tid Scan on r3_
2701                                  TID Cond: (ctid = '(1,1)'::tid)
2702                                  Filter: (c1 = 1)
2703                            ->  Tid Scan on t1 b1t1
2704                                  TID Cond: (ctid = '(1,1)'::tid)
2705                      ->  Seq Scan on t2 b1t2
2706                            Filter: (ctid = '(1,1)'::tid)
2707                ->  Tid Scan on t3 b1t3
2708                      TID Cond: (ctid = '(1,1)'::tid)
2709          ->  Tid Scan on t4 b1t4
2710                TID Cond: (ctid = '(1,1)'::tid)
2711  
2712  Aggregate
2713    ->  Nested Loop
2714          Join Filter: (b2t1.c1 = b2t4.c1)
2715          ->  Nested Loop
2716                Join Filter: (b2t1.c1 = b2t3.c1)
2717                ->  Nested Loop
2718                      Join Filter: (b2t1.c1 = b2t2.c1)
2719                      ->  Nested Loop
2720                            ->  Tid Scan on r3_
2721                                  TID Cond: (ctid = '(1,1)'::tid)
2722                                  Filter: (c1 = 1)
2723                            ->  Tid Scan on t1 b2t1
2724                                  TID Cond: (ctid = '(1,1)'::tid)
2725                      ->  Seq Scan on t2 b2t2
2726                            Filter: (ctid = '(1,1)'::tid)
2727                ->  Tid Scan on t3 b2t3
2728                      TID Cond: (ctid = '(1,1)'::tid)
2729          ->  Tid Scan on t4 b2t4
2730                TID Cond: (ctid = '(1,1)'::tid)
2731  
2732  Aggregate
2733    ->  Nested Loop
2734          Join Filter: (b3t1.c1 = b3t4.c1)
2735          ->  Nested Loop
2736                Join Filter: (b3t1.c1 = b3t3.c1)
2737                ->  Nested Loop
2738                      Join Filter: (b3t1.c1 = b3t2.c1)
2739                      ->  Nested Loop
2740                            ->  Tid Scan on r3_
2741                                  TID Cond: (ctid = '(1,1)'::tid)
2742                                  Filter: (c1 = 1)
2743                            ->  Tid Scan on t1 b3t1
2744                                  TID Cond: (ctid = '(1,1)'::tid)
2745                      ->  Seq Scan on t2 b3t2
2746                            Filter: (ctid = '(1,1)'::tid)
2747                ->  Tid Scan on t3 b3t3
2748                      TID Cond: (ctid = '(1,1)'::tid)
2749          ->  Tid Scan on t4 b3t4
2750                TID Cond: (ctid = '(1,1)'::tid)
2751 (59 rows)
2752
2753 /*+TidScan(b1t1)SeqScan(b1t2)IndexScan(b1t3 t3_pkey)BitmapScan(b1t4 t4_pkey)
2754 BitmapScan(b2t1 t1_pkey)TidScan(b2t2)SeqScan(b2t3)IndexScan(b2t4 t4_pkey)
2755 IndexScan(b3t1 t1_pkey)BitmapScan(b3t2 t2_pkey)TidScan(b3t3)SeqScan(b3t4)
2756 SeqScan(r3_)*/
2757 EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
2758 LOG:  available indexes for IndexScan(b1t3): t3_pkey
2759 LOG:  available indexes for BitmapScan(b1t4): t4_pkey
2760 LOG:  pg_hint_plan:
2761 used hint:
2762 TidScan(b1t1)
2763 SeqScan(b1t2)
2764 IndexScan(b1t3 t3_pkey)
2765 BitmapScan(b1t4 t4_pkey)
2766 SeqScan(r3_)
2767 not used hint:
2768 BitmapScan(b2t1 t1_pkey)
2769 TidScan(b2t2)
2770 SeqScan(b2t3)
2771 IndexScan(b2t4 t4_pkey)
2772 IndexScan(b3t1 t1_pkey)
2773 BitmapScan(b3t2 t2_pkey)
2774 TidScan(b3t3)
2775 SeqScan(b3t4)
2776 duplication hint:
2777 error hint:
2778
2779 LOG:  available indexes for BitmapScan(b2t1): t1_pkey
2780 LOG:  available indexes for IndexScan(b2t4): t4_pkey
2781 LOG:  pg_hint_plan:
2782 used hint:
2783 BitmapScan(b2t1 t1_pkey)
2784 TidScan(b2t2)
2785 SeqScan(b2t3)
2786 IndexScan(b2t4 t4_pkey)
2787 SeqScan(r3_)
2788 not used hint:
2789 TidScan(b1t1)
2790 SeqScan(b1t2)
2791 IndexScan(b1t3 t3_pkey)
2792 BitmapScan(b1t4 t4_pkey)
2793 IndexScan(b3t1 t1_pkey)
2794 BitmapScan(b3t2 t2_pkey)
2795 TidScan(b3t3)
2796 SeqScan(b3t4)
2797 duplication hint:
2798 error hint:
2799
2800 LOG:  available indexes for IndexScan(b3t1): t1_pkey
2801 LOG:  available indexes for BitmapScan(b3t2): t2_pkey
2802 LOG:  pg_hint_plan:
2803 used hint:
2804 IndexScan(b3t1 t1_pkey)
2805 BitmapScan(b3t2 t2_pkey)
2806 TidScan(b3t3)
2807 SeqScan(b3t4)
2808 SeqScan(r3_)
2809 not used hint:
2810 TidScan(b1t1)
2811 SeqScan(b1t2)
2812 IndexScan(b1t3 t3_pkey)
2813 BitmapScan(b1t4 t4_pkey)
2814 BitmapScan(b2t1 t1_pkey)
2815 TidScan(b2t2)
2816 SeqScan(b2t3)
2817 IndexScan(b2t4 t4_pkey)
2818 duplication hint:
2819 error hint:
2820
2821                                   QUERY PLAN                                  
2822 ------------------------------------------------------------------------------
2823  Aggregate
2824    ->  Nested Loop
2825          Join Filter: (b1t1.c1 = b1t4.c1)
2826          ->  Nested Loop
2827                Join Filter: (b1t1.c1 = b1t3.c1)
2828                ->  Nested Loop
2829                      Join Filter: (b1t1.c1 = b1t2.c1)
2830                      ->  Nested Loop
2831                            ->  Seq Scan on r3_
2832                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2833                            ->  Tid Scan on t1 b1t1
2834                                  TID Cond: (ctid = '(1,1)'::tid)
2835                      ->  Seq Scan on t2 b1t2
2836                            Filter: (ctid = '(1,1)'::tid)
2837                ->  Index Scan using t3_pkey on t3 b1t3
2838                      Index Cond: (c1 = b1t2.c1)
2839                      Filter: (ctid = '(1,1)'::tid)
2840          ->  Bitmap Heap Scan on t4 b1t4
2841                Recheck Cond: (c1 = b1t2.c1)
2842                Filter: (ctid = '(1,1)'::tid)
2843                ->  Bitmap Index Scan on t4_pkey
2844                      Index Cond: (c1 = b1t2.c1)
2845  
2846  Aggregate
2847    ->  Nested Loop
2848          Join Filter: (b2t1.c1 = b2t4.c1)
2849          ->  Nested Loop
2850                Join Filter: (b2t2.c1 = b2t1.c1)
2851                ->  Nested Loop
2852                      Join Filter: (b2t2.c1 = b2t3.c1)
2853                      ->  Nested Loop
2854                            ->  Seq Scan on r3_
2855                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2856                            ->  Tid Scan on t2 b2t2
2857                                  TID Cond: (ctid = '(1,1)'::tid)
2858                      ->  Seq Scan on t3 b2t3
2859                            Filter: (ctid = '(1,1)'::tid)
2860                ->  Bitmap Heap Scan on t1 b2t1
2861                      Recheck Cond: (c1 = b2t3.c1)
2862                      Filter: (ctid = '(1,1)'::tid)
2863                      ->  Bitmap Index Scan on t1_pkey
2864                            Index Cond: (c1 = b2t3.c1)
2865          ->  Index Scan using t4_pkey on t4 b2t4
2866                Index Cond: (c1 = b2t2.c1)
2867                Filter: (ctid = '(1,1)'::tid)
2868  
2869  Aggregate
2870    ->  Nested Loop
2871          Join Filter: (b3t1.c1 = b3t2.c1)
2872          ->  Nested Loop
2873                Join Filter: (b3t3.c1 = b3t1.c1)
2874                ->  Nested Loop
2875                      Join Filter: (b3t3.c1 = b3t4.c1)
2876                      ->  Nested Loop
2877                            ->  Seq Scan on r3_
2878                                  Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
2879                            ->  Tid Scan on t3 b3t3
2880                                  TID Cond: (ctid = '(1,1)'::tid)
2881                      ->  Seq Scan on t4 b3t4
2882                            Filter: (ctid = '(1,1)'::tid)
2883                ->  Index Scan using t1_pkey on t1 b3t1
2884                      Index Cond: (c1 = b3t4.c1)
2885                      Filter: (ctid = '(1,1)'::tid)
2886          ->  Bitmap Heap Scan on t2 b3t2
2887                Recheck Cond: (c1 = b3t3.c1)
2888                Filter: (ctid = '(1,1)'::tid)
2889                ->  Bitmap Index Scan on t2_pkey
2890                      Index Cond: (c1 = b3t3.c1)
2891 (68 rows)
2892
2893 -- No. S-2-3-4
2894 EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
2895              QUERY PLAN             
2896 ------------------------------------
2897  Hash Join
2898    Hash Cond: (v1t1.c1 = v1t1_1.c1)
2899    ->  Seq Scan on t1 v1t1
2900    ->  Hash
2901          ->  Seq Scan on t1 v1t1_1
2902 (5 rows)
2903
2904 /*+BitmapScan(v1t1)*/
2905 EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
2906 LOG:  pg_hint_plan:
2907 used hint:
2908 BitmapScan(v1t1)
2909 not used hint:
2910 duplication hint:
2911 error hint:
2912
2913                 QUERY PLAN                
2914 ------------------------------------------
2915  Nested Loop
2916    ->  Index Scan using t1_i1 on t1 v1t1
2917    ->  Bitmap Heap Scan on t1 v1t1_1
2918          Recheck Cond: (c1 = v1t1.c1)
2919          ->  Bitmap Index Scan on t1_i1
2920                Index Cond: (c1 = v1t1.c1)
2921 (6 rows)
2922
2923 -- No. S-2-3-5
2924 EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1_ v2 WHERE v1.c1 = v2.c1;
2925             QUERY PLAN             
2926 -----------------------------------
2927  Hash Join
2928    Hash Cond: (v1t1.c1 = v1t1_.c1)
2929    ->  Seq Scan on t1 v1t1
2930    ->  Hash
2931          ->  Seq Scan on t1 v1t1_
2932 (5 rows)
2933
2934 /*+SeqScan(v1t1)BitmapScan(v1t1_)*/
2935 EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1_ v2 WHERE v1.c1 = v2.c1;
2936 LOG:  pg_hint_plan:
2937 used hint:
2938 SeqScan(v1t1)
2939 BitmapScan(v1t1_)
2940 not used hint:
2941 duplication hint:
2942 error hint:
2943
2944                 QUERY PLAN                
2945 ------------------------------------------
2946  Nested Loop
2947    ->  Seq Scan on t1 v1t1
2948    ->  Bitmap Heap Scan on t1 v1t1_
2949          Recheck Cond: (c1 = v1t1.c1)
2950          ->  Bitmap Index Scan on t1_i1
2951                Index Cond: (c1 = v1t1.c1)
2952 (6 rows)
2953
2954 -- No. S-2-3-6
2955 EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
2956              QUERY PLAN             
2957 ------------------------------------
2958  Hash Join
2959    Hash Cond: (r4t1.c1 = r4t1_1.c1)
2960    ->  Seq Scan on t1 r4t1
2961    ->  Hash
2962          ->  Seq Scan on t1 r4t1_1
2963 (5 rows)
2964
2965 /*+BitmapScan(r4t1)*/
2966 EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
2967 LOG:  pg_hint_plan:
2968 used hint:
2969 BitmapScan(r4t1)
2970 not used hint:
2971 duplication hint:
2972 error hint:
2973
2974                 QUERY PLAN                
2975 ------------------------------------------
2976  Nested Loop
2977    ->  Index Scan using t1_i1 on t1 r4t1
2978    ->  Bitmap Heap Scan on t1 r4t1_1
2979          Recheck Cond: (c1 = r4t1.c1)
2980          ->  Bitmap Index Scan on t1_i1
2981                Index Cond: (c1 = r4t1.c1)
2982 (6 rows)
2983
2984 -- No. S-2-3-7
2985 EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r5 t2 WHERE t1.c1 = t2.c1;
2986             QUERY PLAN            
2987 ----------------------------------
2988  Hash Join
2989    Hash Cond: (r4t1.c1 = r5t1.c1)
2990    ->  Seq Scan on t1 r4t1
2991    ->  Hash
2992          ->  Seq Scan on t1 r5t1
2993 (5 rows)
2994
2995 /*+SeqScan(r4t1)BitmapScan(r5t1)*/
2996 EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r5 t2 WHERE t1.c1 = t2.c1;
2997 LOG:  pg_hint_plan:
2998 used hint:
2999 SeqScan(r4t1)
3000 BitmapScan(r5t1)
3001 not used hint:
3002 duplication hint:
3003 error hint:
3004
3005                 QUERY PLAN                
3006 ------------------------------------------
3007  Nested Loop
3008    ->  Seq Scan on t1 r4t1
3009    ->  Bitmap Heap Scan on t1 r5t1
3010          Recheck Cond: (c1 = r4t1.c1)
3011          ->  Bitmap Index Scan on t1_i1
3012                Index Cond: (c1 = r4t1.c1)
3013 (6 rows)
3014
3015 ----
3016 ---- No. S-2-4 VALUES clause
3017 ----
3018 -- No. S-2-4-1
3019 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1) WHERE t1.c1 = 1;
3020  QUERY PLAN 
3021 ------------
3022  Result
3023 (1 row)
3024
3025 /*+SeqScan(t1)*/
3026 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1) WHERE t1.c1 = 1;
3027 LOG:  pg_hint_plan:
3028 used hint:
3029 not used hint:
3030 SeqScan(t1)
3031 duplication hint:
3032 error hint:
3033
3034  QUERY PLAN 
3035 ------------
3036  Result
3037 (1 row)
3038
3039 /*+SeqScan(*VALUES*)*/
3040 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1) WHERE t1.c1 = 1;
3041 LOG:  pg_hint_plan:
3042 used hint:
3043 not used hint:
3044 SeqScan(*VALUES*)
3045 duplication hint:
3046 error hint:
3047
3048  QUERY PLAN 
3049 ------------
3050  Result
3051 (1 row)
3052
3053 -- No. S-2-4-2
3054 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;
3055                         QUERY PLAN                        
3056 ----------------------------------------------------------
3057  Hash Join
3058    Hash Cond: ("*VALUES*".column1 = "*VALUES*_1".column1)
3059    ->  Values Scan on "*VALUES*"
3060    ->  Hash
3061          ->  Values Scan on "*VALUES*_1"
3062 (5 rows)
3063
3064 /*+SeqScan(t1 t2)*/
3065 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;
3066 INFO:  pg_hint_plan: hint syntax error at or near ""
3067 DETAIL:  SeqScan hint accepts only one relation.
3068 LOG:  pg_hint_plan:
3069 used hint:
3070 not used hint:
3071 duplication hint:
3072 error hint:
3073 SeqScan(t1 t2)
3074
3075                         QUERY PLAN                        
3076 ----------------------------------------------------------
3077  Hash Join
3078    Hash Cond: ("*VALUES*".column1 = "*VALUES*_1".column1)
3079    ->  Values Scan on "*VALUES*"
3080    ->  Hash
3081          ->  Values Scan on "*VALUES*_1"
3082 (5 rows)
3083
3084 /*+SeqScan(*VALUES*)*/
3085 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;
3086 LOG:  pg_hint_plan:
3087 used hint:
3088 not used hint:
3089 SeqScan(*VALUES*)
3090 duplication hint:
3091 error hint:
3092
3093                         QUERY PLAN                        
3094 ----------------------------------------------------------
3095  Hash Join
3096    Hash Cond: ("*VALUES*".column1 = "*VALUES*_1".column1)
3097    ->  Values Scan on "*VALUES*"
3098    ->  Hash
3099          ->  Values Scan on "*VALUES*_1"
3100 (5 rows)
3101
3102 ----
3103 ---- No. S-3-1 scan method hint
3104 ----
3105 -- No. S-3-1-1
3106 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3107      QUERY PLAN      
3108 ---------------------
3109  Seq Scan on t1
3110    Filter: (c1 >= 1)
3111 (2 rows)
3112
3113 /*+SeqScan(t1)*/
3114 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3115 LOG:  pg_hint_plan:
3116 used hint:
3117 SeqScan(t1)
3118 not used hint:
3119 duplication hint:
3120 error hint:
3121
3122      QUERY PLAN      
3123 ---------------------
3124  Seq Scan on t1
3125    Filter: (c1 >= 1)
3126 (2 rows)
3127
3128 -- No. S-3-1-2
3129 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3130           QUERY PLAN          
3131 ------------------------------
3132  Index Scan using t1_i1 on t1
3133    Index Cond: (c1 = 1)
3134 (2 rows)
3135
3136 /*+SeqScan(t1)*/
3137 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3138 LOG:  pg_hint_plan:
3139 used hint:
3140 SeqScan(t1)
3141 not used hint:
3142 duplication hint:
3143 error hint:
3144
3145      QUERY PLAN     
3146 --------------------
3147  Seq Scan on t1
3148    Filter: (c1 = 1)
3149 (2 rows)
3150
3151 -- No. S-3-1-3
3152 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3153           QUERY PLAN          
3154 ------------------------------
3155  Index Scan using t1_i1 on t1
3156    Index Cond: (c1 = 1)
3157 (2 rows)
3158
3159 /*+IndexScan(t1)*/
3160 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3161 LOG:  pg_hint_plan:
3162 used hint:
3163 IndexScan(t1)
3164 not used hint:
3165 duplication hint:
3166 error hint:
3167
3168           QUERY PLAN          
3169 ------------------------------
3170  Index Scan using t1_i1 on t1
3171    Index Cond: (c1 = 1)
3172 (2 rows)
3173
3174 -- No. S-3-1-4
3175 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3176      QUERY PLAN      
3177 ---------------------
3178  Seq Scan on t1
3179    Filter: (c1 >= 1)
3180 (2 rows)
3181
3182 /*+IndexScan(t1)*/
3183 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3184 LOG:  pg_hint_plan:
3185 used hint:
3186 IndexScan(t1)
3187 not used hint:
3188 duplication hint:
3189 error hint:
3190
3191           QUERY PLAN          
3192 ------------------------------
3193  Index Scan using t1_i1 on t1
3194    Index Cond: (c1 >= 1)
3195 (2 rows)
3196
3197 -- No. S-3-1-5
3198 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
3199            QUERY PLAN            
3200 ---------------------------------
3201  Bitmap Heap Scan on t1
3202    Recheck Cond: (c3 < 10)
3203    ->  Bitmap Index Scan on t1_i
3204          Index Cond: (c3 < 10)
3205 (4 rows)
3206
3207 /*+BitmapScan(t1)*/
3208 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
3209 LOG:  pg_hint_plan:
3210 used hint:
3211 BitmapScan(t1)
3212 not used hint:
3213 duplication hint:
3214 error hint:
3215
3216            QUERY PLAN            
3217 ---------------------------------
3218  Bitmap Heap Scan on t1
3219    Recheck Cond: (c3 < 10)
3220    ->  Bitmap Index Scan on t1_i
3221          Index Cond: (c3 < 10)
3222 (4 rows)
3223
3224 -- No. S-3-1-6
3225 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3226           QUERY PLAN          
3227 ------------------------------
3228  Index Scan using t1_i1 on t1
3229    Index Cond: (c1 = 1)
3230 (2 rows)
3231
3232 /*+BitmapScan(t1)*/
3233 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3234 LOG:  pg_hint_plan:
3235 used hint:
3236 BitmapScan(t1)
3237 not used hint:
3238 duplication hint:
3239 error hint:
3240
3241             QUERY PLAN            
3242 ----------------------------------
3243  Bitmap Heap Scan on t1
3244    Recheck Cond: (c1 = 1)
3245    ->  Bitmap Index Scan on t1_i1
3246          Index Cond: (c1 = 1)
3247 (4 rows)
3248
3249 -- No. S-3-1-7
3250 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3251             QUERY PLAN             
3252 -----------------------------------
3253  Tid Scan on t1
3254    TID Cond: (ctid = '(1,1)'::tid)
3255    Filter: (c1 = 1)
3256 (3 rows)
3257
3258 /*+TidScan(t1)*/
3259 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3260 LOG:  pg_hint_plan:
3261 used hint:
3262 TidScan(t1)
3263 not used hint:
3264 duplication hint:
3265 error hint:
3266
3267             QUERY PLAN             
3268 -----------------------------------
3269  Tid Scan on t1
3270    TID Cond: (ctid = '(1,1)'::tid)
3271    Filter: (c1 = 1)
3272 (3 rows)
3273
3274 -- No. S-3-1-8
3275 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid IN ('(1,1)', '(2,2)', '(3,3)');
3276                          QUERY PLAN                          
3277 -------------------------------------------------------------
3278  Index Scan using t1_i1 on t1
3279    Index Cond: (c1 = 1)
3280    Filter: (ctid = ANY ('{"(1,1)","(2,2)","(3,3)"}'::tid[]))
3281 (3 rows)
3282
3283 /*+TidScan(t1)*/
3284 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid IN ('(1,1)', '(2,2)', '(3,3)');
3285 LOG:  pg_hint_plan:
3286 used hint:
3287 TidScan(t1)
3288 not used hint:
3289 duplication hint:
3290 error hint:
3291
3292                           QUERY PLAN                           
3293 ---------------------------------------------------------------
3294  Tid Scan on t1
3295    TID Cond: (ctid = ANY ('{"(1,1)","(2,2)","(3,3)"}'::tid[]))
3296    Filter: (c1 = 1)
3297 (3 rows)
3298
3299 -- No. S-3-1-9
3300 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3301      QUERY PLAN      
3302 ---------------------
3303  Seq Scan on t1
3304    Filter: (c1 >= 1)
3305 (2 rows)
3306
3307 /*+NoSeqScan(t1)*/
3308 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3309 LOG:  pg_hint_plan:
3310 used hint:
3311 NoSeqScan(t1)
3312 not used hint:
3313 duplication hint:
3314 error hint:
3315
3316           QUERY PLAN          
3317 ------------------------------
3318  Index Scan using t1_i1 on t1
3319    Index Cond: (c1 >= 1)
3320 (2 rows)
3321
3322 -- No. S-3-1-10
3323 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3324           QUERY PLAN          
3325 ------------------------------
3326  Index Scan using t1_i1 on t1
3327    Index Cond: (c1 = 1)
3328 (2 rows)
3329
3330 /*+NoSeqScan(t1)*/
3331 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3332 LOG:  pg_hint_plan:
3333 used hint:
3334 NoSeqScan(t1)
3335 not used hint:
3336 duplication hint:
3337 error hint:
3338
3339           QUERY PLAN          
3340 ------------------------------
3341  Index Scan using t1_i1 on t1
3342    Index Cond: (c1 = 1)
3343 (2 rows)
3344
3345 -- No. S-3-1-11
3346 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3347           QUERY PLAN          
3348 ------------------------------
3349  Index Scan using t1_i1 on t1
3350    Index Cond: (c1 = 1)
3351 (2 rows)
3352
3353 /*+NoIndexScan(t1)*/
3354 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3355 LOG:  pg_hint_plan:
3356 used hint:
3357 NoIndexScan(t1)
3358 not used hint:
3359 duplication hint:
3360 error hint:
3361
3362             QUERY PLAN            
3363 ----------------------------------
3364  Bitmap Heap Scan on t1
3365    Recheck Cond: (c1 = 1)
3366    ->  Bitmap Index Scan on t1_i1
3367          Index Cond: (c1 = 1)
3368 (4 rows)
3369
3370 -- No. S-3-1-12
3371 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3372      QUERY PLAN      
3373 ---------------------
3374  Seq Scan on t1
3375    Filter: (c1 >= 1)
3376 (2 rows)
3377
3378 /*+NoIndexScan(t1)*/
3379 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
3380 LOG:  pg_hint_plan:
3381 used hint:
3382 NoIndexScan(t1)
3383 not used hint:
3384 duplication hint:
3385 error hint:
3386
3387      QUERY PLAN      
3388 ---------------------
3389  Seq Scan on t1
3390    Filter: (c1 >= 1)
3391 (2 rows)
3392
3393 -- No. S-3-1-13
3394 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
3395            QUERY PLAN            
3396 ---------------------------------
3397  Bitmap Heap Scan on t1
3398    Recheck Cond: (c3 < 10)
3399    ->  Bitmap Index Scan on t1_i
3400          Index Cond: (c3 < 10)
3401 (4 rows)
3402
3403 /*+NoBitmapScan(t1)*/
3404 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
3405 LOG:  pg_hint_plan:
3406 used hint:
3407 NoBitmapScan(t1)
3408 not used hint:
3409 duplication hint:
3410 error hint:
3411
3412      QUERY PLAN      
3413 ---------------------
3414  Seq Scan on t1
3415    Filter: (c3 < 10)
3416 (2 rows)
3417
3418 -- No. S-3-1-14
3419 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3420           QUERY PLAN          
3421 ------------------------------
3422  Index Scan using t1_i1 on t1
3423    Index Cond: (c1 = 1)
3424 (2 rows)
3425
3426 /*+NoBitmapScan(t1)*/
3427 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3428 LOG:  pg_hint_plan:
3429 used hint:
3430 NoBitmapScan(t1)
3431 not used hint:
3432 duplication hint:
3433 error hint:
3434
3435           QUERY PLAN          
3436 ------------------------------
3437  Index Scan using t1_i1 on t1
3438    Index Cond: (c1 = 1)
3439 (2 rows)
3440
3441 -- No. S-3-1-15
3442 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3443             QUERY PLAN             
3444 -----------------------------------
3445  Tid Scan on t1
3446    TID Cond: (ctid = '(1,1)'::tid)
3447    Filter: (c1 = 1)
3448 (3 rows)
3449
3450 /*+NoTidScan(t1)*/
3451 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3452 LOG:  pg_hint_plan:
3453 used hint:
3454 NoTidScan(t1)
3455 not used hint:
3456 duplication hint:
3457 error hint:
3458
3459            QUERY PLAN            
3460 ---------------------------------
3461  Index Scan using t1_i1 on t1
3462    Index Cond: (c1 = 1)
3463    Filter: (ctid = '(1,1)'::tid)
3464 (3 rows)
3465
3466 -- No. S-3-1-16
3467 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3468           QUERY PLAN          
3469 ------------------------------
3470  Index Scan using t1_i1 on t1
3471    Index Cond: (c1 = 1)
3472 (2 rows)
3473
3474 /*+NoTidScan(t1)*/
3475 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3476 LOG:  pg_hint_plan:
3477 used hint:
3478 NoTidScan(t1)
3479 not used hint:
3480 duplication hint:
3481 error hint:
3482
3483           QUERY PLAN          
3484 ------------------------------
3485  Index Scan using t1_i1 on t1
3486    Index Cond: (c1 = 1)
3487 (2 rows)
3488
3489 -- No. S-3-1-17
3490 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
3491             QUERY PLAN             
3492 -----------------------------------
3493  Index Only Scan using t1_i1 on t1
3494    Index Cond: (c1 = 1)
3495 (2 rows)
3496
3497 /*+IndexOnlyScan(t1)*/
3498 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
3499 LOG:  pg_hint_plan:
3500 used hint:
3501 IndexOnlyScan(t1)
3502 not used hint:
3503 duplication hint:
3504 error hint:
3505
3506             QUERY PLAN             
3507 -----------------------------------
3508  Index Only Scan using t1_i1 on t1
3509    Index Cond: (c1 = 1)
3510 (2 rows)
3511
3512 -- No. S-3-1-18
3513 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 >= 1;
3514      QUERY PLAN      
3515 ---------------------
3516  Seq Scan on t1
3517    Filter: (c1 >= 1)
3518 (2 rows)
3519
3520 /*+IndexOnlyScan(t1)*/
3521 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 >= 1;
3522 LOG:  pg_hint_plan:
3523 used hint:
3524 IndexOnlyScan(t1)
3525 not used hint:
3526 duplication hint:
3527 error hint:
3528
3529             QUERY PLAN             
3530 -----------------------------------
3531  Index Only Scan using t1_i1 on t1
3532    Index Cond: (c1 >= 1)
3533 (2 rows)
3534
3535 -- No. S-3-1-19
3536 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
3537             QUERY PLAN             
3538 -----------------------------------
3539  Index Only Scan using t1_i1 on t1
3540    Index Cond: (c1 = 1)
3541 (2 rows)
3542
3543 /*+NoIndexOnlyScan(t1)*/
3544 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
3545 LOG:  pg_hint_plan:
3546 used hint:
3547 NoIndexOnlyScan(t1)
3548 not used hint:
3549 duplication hint:
3550 error hint:
3551
3552           QUERY PLAN          
3553 ------------------------------
3554  Index Scan using t1_i1 on t1
3555    Index Cond: (c1 = 1)
3556 (2 rows)
3557
3558 -- No. S-3-1-20
3559 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 >= 1;
3560      QUERY PLAN      
3561 ---------------------
3562  Seq Scan on t1
3563    Filter: (c1 >= 1)
3564 (2 rows)
3565
3566 /*+NoIndexOnlyScan(t1)*/
3567 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 >= 1;
3568 LOG:  pg_hint_plan:
3569 used hint:
3570 NoIndexOnlyScan(t1)
3571 not used hint:
3572 duplication hint:
3573 error hint:
3574
3575      QUERY PLAN      
3576 ---------------------
3577  Seq Scan on t1
3578    Filter: (c1 >= 1)
3579 (2 rows)
3580
3581 ----
3582 ---- No. S-3-3 index name specified
3583 ----
3584 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3585             QUERY PLAN             
3586 -----------------------------------
3587  Tid Scan on ti1
3588    TID Cond: (ctid = '(1,1)'::tid)
3589    Filter: (c2 = 1)
3590 (3 rows)
3591
3592 SET enable_tidscan TO off;
3593 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3594            QUERY PLAN            
3595 ---------------------------------
3596  Index Scan using ti1_i4 on ti1
3597    Index Cond: (c2 = 1)
3598    Filter: (ctid = '(1,1)'::tid)
3599 (3 rows)
3600
3601 SET enable_indexscan TO off;
3602 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3603             QUERY PLAN             
3604 -----------------------------------
3605  Bitmap Heap Scan on ti1
3606    Recheck Cond: (c2 = 1)
3607    Filter: (ctid = '(1,1)'::tid)
3608    ->  Bitmap Index Scan on ti1_i4
3609          Index Cond: (c2 = 1)
3610 (5 rows)
3611
3612 RESET enable_tidscan;
3613 RESET enable_indexscan;
3614 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE ti1.c2 >= 1;
3615      QUERY PLAN      
3616 ---------------------
3617  Seq Scan on ti1
3618    Filter: (c2 >= 1)
3619 (2 rows)
3620
3621 -- No. S-3-3-1
3622 /*+IndexScan(ti1 ti1_i3)*/
3623 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3624 LOG:  available indexes for IndexScan(ti1): ti1_i3
3625 LOG:  pg_hint_plan:
3626 used hint:
3627 IndexScan(ti1 ti1_i3)
3628 not used hint:
3629 duplication hint:
3630 error hint:
3631
3632            QUERY PLAN            
3633 ---------------------------------
3634  Index Scan using ti1_i3 on ti1
3635    Index Cond: (c2 = 1)
3636    Filter: (ctid = '(1,1)'::tid)
3637 (3 rows)
3638
3639 -- No. S-3-3-2
3640 /*+IndexScan(ti1 ti1_i3 ti1_i2)*/
3641 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3642 LOG:  available indexes for IndexScan(ti1): ti1_i3 ti1_i2
3643 LOG:  pg_hint_plan:
3644 used hint:
3645 IndexScan(ti1 ti1_i3 ti1_i2)
3646 not used hint:
3647 duplication hint:
3648 error hint:
3649
3650            QUERY PLAN            
3651 ---------------------------------
3652  Index Scan using ti1_i3 on ti1
3653    Index Cond: (c2 = 1)
3654    Filter: (ctid = '(1,1)'::tid)
3655 (3 rows)
3656
3657 -- No. S-3-3-3
3658 /*+IndexScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)*/
3659 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3660 LOG:  available indexes for IndexScan(ti1): ti1_i4 ti1_i3 ti1_i2 ti1_i1
3661 LOG:  pg_hint_plan:
3662 used hint:
3663 IndexScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)
3664 not used hint:
3665 duplication hint:
3666 error hint:
3667
3668            QUERY PLAN            
3669 ---------------------------------
3670  Index Scan using ti1_i4 on ti1
3671    Index Cond: (c2 = 1)
3672    Filter: (ctid = '(1,1)'::tid)
3673 (3 rows)
3674
3675 -- No. S-3-3-4
3676 /*+BitmapScan(ti1 ti1_i3)*/
3677 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3678 LOG:  available indexes for BitmapScan(ti1): ti1_i3
3679 LOG:  pg_hint_plan:
3680 used hint:
3681 BitmapScan(ti1 ti1_i3)
3682 not used hint:
3683 duplication hint:
3684 error hint:
3685
3686             QUERY PLAN             
3687 -----------------------------------
3688  Bitmap Heap Scan on ti1
3689    Recheck Cond: (c2 = 1)
3690    Filter: (ctid = '(1,1)'::tid)
3691    ->  Bitmap Index Scan on ti1_i3
3692          Index Cond: (c2 = 1)
3693 (5 rows)
3694
3695 -- No. S-3-3-5
3696 /*+BitmapScan(ti1 ti1_i3 ti1_i2)*/
3697 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3698 LOG:  available indexes for BitmapScan(ti1): ti1_i3 ti1_i2
3699 LOG:  pg_hint_plan:
3700 used hint:
3701 BitmapScan(ti1 ti1_i3 ti1_i2)
3702 not used hint:
3703 duplication hint:
3704 error hint:
3705
3706             QUERY PLAN             
3707 -----------------------------------
3708  Bitmap Heap Scan on ti1
3709    Recheck Cond: (c2 = 1)
3710    Filter: (ctid = '(1,1)'::tid)
3711    ->  Bitmap Index Scan on ti1_i3
3712          Index Cond: (c2 = 1)
3713 (5 rows)
3714
3715 -- No. S-3-3-6
3716 /*+BitmapScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)*/
3717 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
3718 LOG:  available indexes for BitmapScan(ti1): ti1_i4 ti1_i3 ti1_i2 ti1_i1
3719 LOG:  pg_hint_plan:
3720 used hint:
3721 BitmapScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)
3722 not used hint:
3723 duplication hint:
3724 error hint:
3725
3726             QUERY PLAN             
3727 -----------------------------------
3728  Bitmap Heap Scan on ti1
3729    Recheck Cond: (c2 = 1)
3730    Filter: (ctid = '(1,1)'::tid)
3731    ->  Bitmap Index Scan on ti1_i4
3732          Index Cond: (c2 = 1)
3733 (5 rows)
3734
3735 -- No. S-3-3-7
3736 /*+IndexOnlyScan(ti1 ti1_i3)*/
3737 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE ti1.c2 >= 1;
3738 LOG:  available indexes for IndexOnlyScan(ti1): ti1_i3
3739 LOG:  pg_hint_plan:
3740 used hint:
3741 IndexOnlyScan(ti1 ti1_i3)
3742 not used hint:
3743 duplication hint:
3744 error hint:
3745
3746              QUERY PLAN              
3747 -------------------------------------
3748  Index Only Scan using ti1_i3 on ti1
3749    Index Cond: (c2 >= 1)
3750 (2 rows)
3751
3752 -- No. S-3-3-8
3753 /*+IndexOnlyScan(ti1 ti1_i3 ti1_i2)*/
3754 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE ti1.c2 >= 1;
3755 LOG:  available indexes for IndexOnlyScan(ti1): ti1_i3 ti1_i2
3756 LOG:  pg_hint_plan:
3757 used hint:
3758 IndexOnlyScan(ti1 ti1_i3 ti1_i2)
3759 not used hint:
3760 duplication hint:
3761 error hint:
3762
3763              QUERY PLAN              
3764 -------------------------------------
3765  Index Only Scan using ti1_i2 on ti1
3766    Index Cond: (c2 >= 1)
3767 (2 rows)
3768
3769 -- No. S-3-3-9
3770 /*+IndexOnlyScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)*/
3771 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE ti1.c2 >= 1;
3772 LOG:  available indexes for IndexOnlyScan(ti1): ti1_i4 ti1_i3 ti1_i2 ti1_i1
3773 LOG:  pg_hint_plan:
3774 used hint:
3775 IndexOnlyScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)
3776 not used hint:
3777 duplication hint:
3778 error hint:
3779
3780              QUERY PLAN              
3781 -------------------------------------
3782  Index Only Scan using ti1_i1 on ti1
3783    Index Cond: (c2 >= 1)
3784 (2 rows)
3785
3786 ----
3787 ---- No. S-3-4 index type
3788 ----
3789 \d s1.ti1
3790                   Table "s1.ti1"
3791  Column |  Type   | Collation | Nullable | Default 
3792 --------+---------+-----------+----------+---------
3793  c1     | integer |           | not null | 
3794  c2     | integer |           |          | 
3795  c3     | integer |           |          | 
3796  c4     | text    |           |          | 
3797 Indexes:
3798     "ti1_pkey" PRIMARY KEY, btree (c1)
3799     "ti1_c2_key" UNIQUE CONSTRAINT, btree (c2)
3800     "ti1_uniq" UNIQUE, btree (c1)
3801     "ti1_btree" btree (c1)
3802     "ti1_expr" btree ((c1 < 100))
3803     "ti1_gin" gin (c1)
3804     "ti1_gist" gist (c1)
3805     "ti1_hash" hash (c1)
3806     "ti1_i1" btree (c2)
3807     "ti1_i2" btree (c2, c4)
3808     "ti1_i3" btree (c2, c4, c4)
3809     "ti1_i4" btree (c2, c4, c4, c4)
3810     "ti1_multi" btree (c1, c2, c3, c4)
3811     "ti1_pred" btree (lower(c4))
3812     "ti1_ts" gin (to_tsvector('english'::regconfig, c4))
3813
3814 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)';
3815                                                                QUERY PLAN                                                                
3816 -----------------------------------------------------------------------------------------------------------------------------------------
3817  Tid Scan on ti1
3818    TID Cond: (ctid = '(1,1)'::tid)
3819    Filter: ((c1 < 100) AND (c2 = 1) AND (lower(c4) = '1'::text) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
3820 (3 rows)
3821
3822 -- No. S-3-4-1
3823 /*+IndexScan(ti1 ti1_btree)*/
3824 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)';
3825 LOG:  available indexes for IndexScan(ti1): ti1_btree
3826 LOG:  pg_hint_plan:
3827 used hint:
3828 IndexScan(ti1 ti1_btree)
3829 not used hint:
3830 duplication hint:
3831 error hint:
3832
3833                                                                      QUERY PLAN                                                                     
3834 ----------------------------------------------------------------------------------------------------------------------------------------------------
3835  Index Scan using ti1_btree on ti1
3836    Index Cond: (c1 < 100)
3837    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (lower(c4) = '1'::text) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
3838 (3 rows)
3839
3840 -- No. S-3-4-2
3841 /*+IndexScan(ti1 ti1_hash)*/
3842 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)';
3843 LOG:  available indexes for IndexScan(ti1): ti1_hash
3844 LOG:  pg_hint_plan:
3845 used hint:
3846 IndexScan(ti1 ti1_hash)
3847 not used hint:
3848 duplication hint:
3849 error hint:
3850
3851                                                                      QUERY PLAN                                                                     
3852 ----------------------------------------------------------------------------------------------------------------------------------------------------
3853  Index Scan using ti1_hash on ti1
3854    Index Cond: (c1 = 100)
3855    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (lower(c4) = '1'::text) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
3856 (3 rows)
3857
3858 -- No. S-3-4-3
3859 /*+IndexScan(ti1 ti1_gist)*/
3860 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
3861 LOG:  available indexes for IndexScan(ti1): ti1_gist
3862 LOG:  pg_hint_plan:
3863 used hint:
3864 IndexScan(ti1 ti1_gist)
3865 not used hint:
3866 duplication hint:
3867 error hint:
3868
3869                                                                      QUERY PLAN                                                                     
3870 ----------------------------------------------------------------------------------------------------------------------------------------------------
3871  Index Scan using ti1_gist on ti1
3872    Index Cond: (c1 < 100)
3873    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (lower(c4) = '1'::text) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
3874 (3 rows)
3875
3876 -- No. S-3-4-4
3877 /*+IndexScan(ti1 ti1_gin)*/
3878 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)';
3879 LOG:  available indexes for IndexScan(ti1): ti1_gin
3880 LOG:  pg_hint_plan:
3881 used hint:
3882 IndexScan(ti1 ti1_gin)
3883 not used hint:
3884 duplication hint:
3885 error hint:
3886
3887                                                                QUERY PLAN                                                                
3888 -----------------------------------------------------------------------------------------------------------------------------------------
3889  Tid Scan on ti1
3890    TID Cond: (ctid = '(1,1)'::tid)
3891    Filter: ((c1 < 100) AND (c2 = 1) AND (lower(c4) = '1'::text) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
3892 (3 rows)
3893
3894 -- No. S-3-4-5
3895 /*+IndexScan(ti1 ti1_expr)*/
3896 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)';
3897 LOG:  available indexes for IndexScan(ti1): ti1_expr
3898 LOG:  pg_hint_plan:
3899 used hint:
3900 IndexScan(ti1 ti1_expr)
3901 not used hint:
3902 duplication hint:
3903 error hint:
3904
3905                                                                             QUERY PLAN                                                                             
3906 -------------------------------------------------------------------------------------------------------------------------------------------------------------------
3907  Index Scan using ti1_expr on ti1
3908    Index Cond: ((c1 < 100) = true)
3909    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))
3910 (3 rows)
3911
3912 -- No. S-3-4-6
3913 /*+IndexScan(ti1 ti1_pred)*/
3914 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)';
3915 LOG:  available indexes for IndexScan(ti1): ti1_pred
3916 LOG:  pg_hint_plan:
3917 used hint:
3918 IndexScan(ti1 ti1_pred)
3919 not used hint:
3920 duplication hint:
3921 error hint:
3922
3923                                                               QUERY PLAN                                                               
3924 ---------------------------------------------------------------------------------------------------------------------------------------
3925  Index Scan using ti1_pred on ti1
3926    Index Cond: (lower(c4) = '1'::text)
3927    Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
3928 (3 rows)
3929
3930 -- No. S-3-4-7
3931 /*+IndexScan(ti1 ti1_uniq)*/
3932 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)';
3933 LOG:  available indexes for IndexScan(ti1): ti1_uniq
3934 LOG:  pg_hint_plan:
3935 used hint:
3936 IndexScan(ti1 ti1_uniq)
3937 not used hint:
3938 duplication hint:
3939 error hint:
3940
3941                                                                      QUERY PLAN                                                                     
3942 ----------------------------------------------------------------------------------------------------------------------------------------------------
3943  Index Scan using ti1_uniq on ti1
3944    Index Cond: (c1 < 100)
3945    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (lower(c4) = '1'::text) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
3946 (3 rows)
3947
3948 -- No. S-3-4-8
3949 /*+IndexScan(ti1 ti1_multi)*/
3950 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)';
3951 LOG:  available indexes for IndexScan(ti1): ti1_multi
3952 LOG:  pg_hint_plan:
3953 used hint:
3954 IndexScan(ti1 ti1_multi)
3955 not used hint:
3956 duplication hint:
3957 error hint:
3958
3959                                                               QUERY PLAN                                                               
3960 ---------------------------------------------------------------------------------------------------------------------------------------
3961  Index Scan using ti1_multi on ti1
3962    Index Cond: ((c1 < 100) AND (c2 = 1))
3963    Filter: ((ctid = '(1,1)'::tid) AND (lower(c4) = '1'::text) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
3964 (3 rows)
3965
3966 -- No. S-3-4-9
3967 /*+IndexScan(ti1 ti1_ts)*/
3968 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)';
3969 LOG:  available indexes for IndexScan(ti1): ti1_ts
3970 LOG:  pg_hint_plan:
3971 used hint:
3972 IndexScan(ti1 ti1_ts)
3973 not used hint:
3974 duplication hint:
3975 error hint:
3976
3977                                                                QUERY PLAN                                                                
3978 -----------------------------------------------------------------------------------------------------------------------------------------
3979  Tid Scan on ti1
3980    TID Cond: (ctid = '(1,1)'::tid)
3981    Filter: ((c1 < 100) AND (c2 = 1) AND (lower(c4) = '1'::text) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
3982 (3 rows)
3983
3984 -- No. S-3-4-10
3985 /*+IndexScan(ti1 ti1_pkey)*/
3986 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)';
3987 LOG:  available indexes for IndexScan(ti1): ti1_pkey
3988 LOG:  pg_hint_plan:
3989 used hint:
3990 IndexScan(ti1 ti1_pkey)
3991 not used hint:
3992 duplication hint:
3993 error hint:
3994
3995                                                                      QUERY PLAN                                                                     
3996 ----------------------------------------------------------------------------------------------------------------------------------------------------
3997  Index Scan using ti1_pkey on ti1
3998    Index Cond: (c1 < 100)
3999    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (lower(c4) = '1'::text) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
4000 (3 rows)
4001
4002 -- No. S-3-4-11
4003 /*+IndexScan(ti1 ti1_c2_key)*/
4004 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)';
4005 LOG:  available indexes for IndexScan(ti1): ti1_c2_key
4006 LOG:  pg_hint_plan:
4007 used hint:
4008 IndexScan(ti1 ti1_c2_key)
4009 not used hint:
4010 duplication hint:
4011 error hint:
4012
4013                                                                       QUERY PLAN                                                                      
4014 ------------------------------------------------------------------------------------------------------------------------------------------------------
4015  Index Scan using ti1_c2_key on ti1
4016    Index Cond: (c2 = 1)
4017    Filter: ((c1 < 100) AND (ctid = '(1,1)'::tid) AND (lower(c4) = '1'::text) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
4018 (3 rows)
4019
4020 -- No. S-3-4-12
4021 /*+BitmapScan(ti1 ti1_btree)*/
4022 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)';
4023 LOG:  available indexes for BitmapScan(ti1): ti1_btree
4024 LOG:  pg_hint_plan:
4025 used hint:
4026 BitmapScan(ti1 ti1_btree)
4027 not used hint:
4028 duplication hint:
4029 error hint:
4030
4031                                                                      QUERY PLAN                                                                     
4032 ----------------------------------------------------------------------------------------------------------------------------------------------------
4033  Bitmap Heap Scan on ti1
4034    Recheck Cond: (c1 < 100)
4035    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (lower(c4) = '1'::text) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
4036    ->  Bitmap Index Scan on ti1_btree
4037          Index Cond: (c1 < 100)
4038 (5 rows)
4039
4040 -- No. S-3-4-13
4041 /*+BitmapScan(ti1 ti1_hash)*/
4042 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)';
4043 LOG:  available indexes for BitmapScan(ti1): ti1_hash
4044 LOG:  pg_hint_plan:
4045 used hint:
4046 BitmapScan(ti1 ti1_hash)
4047 not used hint:
4048 duplication hint:
4049 error hint:
4050
4051                                                                      QUERY PLAN                                                                     
4052 ----------------------------------------------------------------------------------------------------------------------------------------------------
4053  Bitmap Heap Scan on ti1
4054    Recheck Cond: (c1 = 100)
4055    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (lower(c4) = '1'::text) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
4056    ->  Bitmap Index Scan on ti1_hash
4057          Index Cond: (c1 = 100)
4058 (5 rows)
4059
4060 -- No. S-3-4-14
4061 /*+BitmapScan(ti1 ti1_gist)*/
4062 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)';
4063 LOG:  available indexes for BitmapScan(ti1): ti1_gist
4064 LOG:  pg_hint_plan:
4065 used hint:
4066 BitmapScan(ti1 ti1_gist)
4067 not used hint:
4068 duplication hint:
4069 error hint:
4070
4071                                                                      QUERY PLAN                                                                     
4072 ----------------------------------------------------------------------------------------------------------------------------------------------------
4073  Bitmap Heap Scan on ti1
4074    Recheck Cond: (c1 < 100)
4075    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (lower(c4) = '1'::text) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
4076    ->  Bitmap Index Scan on ti1_gist
4077          Index Cond: (c1 < 100)
4078 (5 rows)
4079
4080 -- No. S-3-4-15
4081 /*+BitmapScan(ti1 ti1_gin)*/
4082 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)';
4083 LOG:  available indexes for BitmapScan(ti1): ti1_gin
4084 LOG:  pg_hint_plan:
4085 used hint:
4086 BitmapScan(ti1 ti1_gin)
4087 not used hint:
4088 duplication hint:
4089 error hint:
4090
4091                                                                      QUERY PLAN                                                                     
4092 ----------------------------------------------------------------------------------------------------------------------------------------------------
4093  Bitmap Heap Scan on ti1
4094    Recheck Cond: (c1 < 100)
4095    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (lower(c4) = '1'::text) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
4096    ->  Bitmap Index Scan on ti1_gin
4097          Index Cond: (c1 < 100)
4098 (5 rows)
4099
4100 -- No. S-3-4-16
4101 /*+BitmapScan(ti1 ti1_expr)*/
4102 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)';
4103 LOG:  available indexes for BitmapScan(ti1): ti1_expr
4104 LOG:  pg_hint_plan:
4105 used hint:
4106 BitmapScan(ti1 ti1_expr)
4107 not used hint:
4108 duplication hint:
4109 error hint:
4110
4111                                                                             QUERY PLAN                                                                             
4112 -------------------------------------------------------------------------------------------------------------------------------------------------------------------
4113  Bitmap Heap Scan on ti1
4114    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))
4115    ->  Bitmap Index Scan on ti1_expr
4116          Index Cond: ((c1 < 100) = true)
4117 (4 rows)
4118
4119 -- No. S-3-4-17
4120 /*+BitmapScan(ti1 ti1_pred)*/
4121 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)';
4122 LOG:  available indexes for BitmapScan(ti1): ti1_pred
4123 LOG:  pg_hint_plan:
4124 used hint:
4125 BitmapScan(ti1 ti1_pred)
4126 not used hint:
4127 duplication hint:
4128 error hint:
4129
4130                                                               QUERY PLAN                                                               
4131 ---------------------------------------------------------------------------------------------------------------------------------------
4132  Bitmap Heap Scan on ti1
4133    Recheck Cond: (lower(c4) = '1'::text)
4134    Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
4135    ->  Bitmap Index Scan on ti1_pred
4136          Index Cond: (lower(c4) = '1'::text)
4137 (5 rows)
4138
4139 -- No. S-3-4-18
4140 /*+BitmapScan(ti1 ti1_uniq)*/
4141 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)';
4142 LOG:  available indexes for BitmapScan(ti1): ti1_uniq
4143 LOG:  pg_hint_plan:
4144 used hint:
4145 BitmapScan(ti1 ti1_uniq)
4146 not used hint:
4147 duplication hint:
4148 error hint:
4149
4150                                                                      QUERY PLAN                                                                     
4151 ----------------------------------------------------------------------------------------------------------------------------------------------------
4152  Bitmap Heap Scan on ti1
4153    Recheck Cond: (c1 < 100)
4154    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (lower(c4) = '1'::text) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
4155    ->  Bitmap Index Scan on ti1_uniq
4156          Index Cond: (c1 < 100)
4157 (5 rows)
4158
4159 -- No. S-3-4-19
4160 /*+BitmapScan(ti1 ti1_multi)*/
4161 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)';
4162 LOG:  available indexes for BitmapScan(ti1): ti1_multi
4163 LOG:  pg_hint_plan:
4164 used hint:
4165 BitmapScan(ti1 ti1_multi)
4166 not used hint:
4167 duplication hint:
4168 error hint:
4169
4170                                                               QUERY PLAN                                                               
4171 ---------------------------------------------------------------------------------------------------------------------------------------
4172  Bitmap Heap Scan on ti1
4173    Recheck Cond: ((c1 < 100) AND (c2 = 1))
4174    Filter: ((ctid = '(1,1)'::tid) AND (lower(c4) = '1'::text) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
4175    ->  Bitmap Index Scan on ti1_multi
4176          Index Cond: ((c1 < 100) AND (c2 = 1))
4177 (5 rows)
4178
4179 -- No. S-3-4-20
4180 /*+BitmapScan(ti1 ti1_ts)*/
4181 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)';
4182 LOG:  available indexes for BitmapScan(ti1): ti1_ts
4183 LOG:  pg_hint_plan:
4184 used hint:
4185 BitmapScan(ti1 ti1_ts)
4186 not used hint:
4187 duplication hint:
4188 error hint:
4189
4190                                         QUERY PLAN                                         
4191 -------------------------------------------------------------------------------------------
4192  Bitmap Heap Scan on ti1
4193    Recheck Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
4194    Filter: ((c1 < 100) AND (c2 = 1) AND (ctid = '(1,1)'::tid) AND (lower(c4) = '1'::text))
4195    ->  Bitmap Index Scan on ti1_ts
4196          Index Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
4197 (5 rows)
4198
4199 -- No. S-3-4-21
4200 /*+BitmapScan(ti1 ti1_pkey)*/
4201 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)';
4202 LOG:  available indexes for BitmapScan(ti1): ti1_pkey
4203 LOG:  pg_hint_plan:
4204 used hint:
4205 BitmapScan(ti1 ti1_pkey)
4206 not used hint:
4207 duplication hint:
4208 error hint:
4209
4210                                                                      QUERY PLAN                                                                     
4211 ----------------------------------------------------------------------------------------------------------------------------------------------------
4212  Bitmap Heap Scan on ti1
4213    Recheck Cond: (c1 < 100)
4214    Filter: ((c2 = 1) AND (ctid = '(1,1)'::tid) AND (lower(c4) = '1'::text) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
4215    ->  Bitmap Index Scan on ti1_pkey
4216          Index Cond: (c1 < 100)
4217 (5 rows)
4218
4219 -- No. S-3-4-22
4220 /*+BitmapScan(ti1 ti1_c2_key)*/
4221 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)';
4222 LOG:  available indexes for BitmapScan(ti1): ti1_c2_key
4223 LOG:  pg_hint_plan:
4224 used hint:
4225 BitmapScan(ti1 ti1_c2_key)
4226 not used hint:
4227 duplication hint:
4228 error hint:
4229
4230                                                                       QUERY PLAN                                                                      
4231 ------------------------------------------------------------------------------------------------------------------------------------------------------
4232  Bitmap Heap Scan on ti1
4233    Recheck Cond: (c2 = 1)
4234    Filter: ((c1 < 100) AND (ctid = '(1,1)'::tid) AND (lower(c4) = '1'::text) AND (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery))
4235    ->  Bitmap Index Scan on ti1_c2_key
4236          Index Cond: (c2 = 1)
4237 (5 rows)
4238
4239 -- No. S-3-4-23
4240 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4241      QUERY PLAN      
4242 ---------------------
4243  Seq Scan on ti1
4244    Filter: (c1 >= 1)
4245 (2 rows)
4246
4247 /*+IndexOnlyScan(ti1 ti1_btree)*/
4248 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4249 LOG:  available indexes for IndexOnlyScan(ti1): ti1_btree
4250 LOG:  pg_hint_plan:
4251 used hint:
4252 IndexOnlyScan(ti1 ti1_btree)
4253 not used hint:
4254 duplication hint:
4255 error hint:
4256
4257                QUERY PLAN               
4258 ----------------------------------------
4259  Index Only Scan using ti1_btree on ti1
4260    Index Cond: (c1 >= 1)
4261 (2 rows)
4262
4263 -- No. S-3-4-24
4264 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
4265             QUERY PLAN            
4266 ----------------------------------
4267  Index Scan using ti1_hash on ti1
4268    Index Cond: (c1 = 1)
4269 (2 rows)
4270
4271 /*+IndexOnlyScan(ti1 ti1_hash)*/
4272 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
4273 LOG:  available indexes for IndexOnlyScan(ti1): ti1_hash
4274 LOG:  pg_hint_plan:
4275 used hint:
4276 IndexOnlyScan(ti1 ti1_hash)
4277 not used hint:
4278 duplication hint:
4279 error hint:
4280
4281             QUERY PLAN            
4282 ----------------------------------
4283  Index Scan using ti1_hash on ti1
4284    Index Cond: (c1 = 1)
4285 (2 rows)
4286
4287 -- No. S-3-4-25
4288 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 < 1;
4289               QUERY PLAN               
4290 ---------------------------------------
4291  Index Only Scan using ti1_uniq on ti1
4292    Index Cond: (c1 < 1)
4293 (2 rows)
4294
4295 /*+IndexOnlyScan(ti1 ti1_gist)*/
4296 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 < 1;
4297 LOG:  available indexes for IndexOnlyScan(ti1): ti1_gist
4298 LOG:  pg_hint_plan:
4299 used hint:
4300 IndexOnlyScan(ti1 ti1_gist)
4301 not used hint:
4302 duplication hint:
4303 error hint:
4304
4305               QUERY PLAN               
4306 ---------------------------------------
4307  Index Only Scan using ti1_gist on ti1
4308    Index Cond: (c1 < 1)
4309 (2 rows)
4310
4311 -- No. S-3-4-26
4312 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
4313             QUERY PLAN            
4314 ----------------------------------
4315  Index Scan using ti1_hash on ti1
4316    Index Cond: (c1 = 1)
4317 (2 rows)
4318
4319 /*+IndexOnlyScan(ti1 ti1_gin)*/
4320 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
4321 LOG:  available indexes for IndexOnlyScan(ti1): ti1_gin
4322 LOG:  pg_hint_plan:
4323 used hint:
4324 IndexOnlyScan(ti1 ti1_gin)
4325 not used hint:
4326 duplication hint:
4327 error hint:
4328
4329              QUERY PLAN             
4330 ------------------------------------
4331  Bitmap Heap Scan on ti1
4332    Recheck Cond: (c1 = 1)
4333    ->  Bitmap Index Scan on ti1_gin
4334          Index Cond: (c1 = 1)
4335 (4 rows)
4336
4337 -- No. S-3-4-27
4338 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 < 100;
4339               QUERY PLAN               
4340 ---------------------------------------
4341  Index Only Scan using ti1_uniq on ti1
4342    Index Cond: (c1 < 100)
4343 (2 rows)
4344
4345 /*+IndexOnlyScan(ti1 ti1_expr)*/
4346 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 < 100;
4347 LOG:  available indexes for IndexOnlyScan(ti1): ti1_expr
4348 LOG:  pg_hint_plan:
4349 used hint:
4350 IndexOnlyScan(ti1 ti1_expr)
4351 not used hint:
4352 duplication hint:
4353 error hint:
4354
4355             QUERY PLAN             
4356 -----------------------------------
4357  Index Scan using ti1_expr on ti1
4358    Index Cond: ((c1 < 100) = true)
4359    Filter: (c1 < 100)
4360 (3 rows)
4361
4362 -- No. S-3-4-28
4363 EXPLAIN (COSTS false) SELECT c4 FROM s1.ti1 WHERE lower(c4) >= '1';
4364              QUERY PLAN             
4365 ------------------------------------
4366  Seq Scan on ti1
4367    Filter: (lower(c4) >= '1'::text)
4368 (2 rows)
4369
4370 /*+IndexOnlyScan(ti1 ti1_pred)*/
4371 EXPLAIN (COSTS false) SELECT c4 FROM s1.ti1 WHERE lower(c4) >= '1';
4372 LOG:  available indexes for IndexOnlyScan(ti1): ti1_pred
4373 LOG:  pg_hint_plan:
4374 used hint:
4375 IndexOnlyScan(ti1 ti1_pred)
4376 not used hint:
4377 duplication hint:
4378 error hint:
4379
4380                QUERY PLAN               
4381 ----------------------------------------
4382  Index Scan using ti1_pred on ti1
4383    Index Cond: (lower(c4) >= '1'::text)
4384 (2 rows)
4385
4386 -- No. S-3-4-29
4387 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4388      QUERY PLAN      
4389 ---------------------
4390  Seq Scan on ti1
4391    Filter: (c1 >= 1)
4392 (2 rows)
4393
4394 /*+IndexOnlyScan(ti1 ti1_uniq)*/
4395 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4396 LOG:  available indexes for IndexOnlyScan(ti1): ti1_uniq
4397 LOG:  pg_hint_plan:
4398 used hint:
4399 IndexOnlyScan(ti1 ti1_uniq)
4400 not used hint:
4401 duplication hint:
4402 error hint:
4403
4404               QUERY PLAN               
4405 ---------------------------------------
4406  Index Only Scan using ti1_uniq on ti1
4407    Index Cond: (c1 >= 1)
4408 (2 rows)
4409
4410 -- No. S-3-4-30
4411 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4412      QUERY PLAN      
4413 ---------------------
4414  Seq Scan on ti1
4415    Filter: (c1 >= 1)
4416 (2 rows)
4417
4418 /*+IndexOnlyScan(ti1 ti1_multi)*/
4419 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4420 LOG:  available indexes for IndexOnlyScan(ti1): ti1_multi
4421 LOG:  pg_hint_plan:
4422 used hint:
4423 IndexOnlyScan(ti1 ti1_multi)
4424 not used hint:
4425 duplication hint:
4426 error hint:
4427
4428                QUERY PLAN               
4429 ----------------------------------------
4430  Index Only Scan using ti1_multi on ti1
4431    Index Cond: (c1 >= 1)
4432 (2 rows)
4433
4434 -- No. S-3-4-31
4435 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE to_tsvector('english', c4) @@ 'a & b';
4436                                        QUERY PLAN                                        
4437 -----------------------------------------------------------------------------------------
4438  Bitmap Heap Scan on ti1
4439    Recheck Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
4440    ->  Bitmap Index Scan on ti1_ts
4441          Index Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
4442 (4 rows)
4443
4444 /*+IndexOnlyScan(ti1 ti1_ts)*/
4445 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE to_tsvector('english', c4) @@ 'a & b';
4446 LOG:  available indexes for IndexOnlyScan(ti1): ti1_ts
4447 LOG:  pg_hint_plan:
4448 used hint:
4449 IndexOnlyScan(ti1 ti1_ts)
4450 not used hint:
4451 duplication hint:
4452 error hint:
4453
4454                                        QUERY PLAN                                        
4455 -----------------------------------------------------------------------------------------
4456  Bitmap Heap Scan on ti1
4457    Recheck Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
4458    ->  Bitmap Index Scan on ti1_ts
4459          Index Cond: (to_tsvector('english'::regconfig, c4) @@ '''a'' & ''b'''::tsquery)
4460 (4 rows)
4461
4462 -- No. S-3-4-32
4463 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4464      QUERY PLAN      
4465 ---------------------
4466  Seq Scan on ti1
4467    Filter: (c1 >= 1)
4468 (2 rows)
4469
4470 /*+IndexOnlyScan(ti1 ti1_pkey)*/
4471 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
4472 LOG:  available indexes for IndexOnlyScan(ti1): ti1_pkey
4473 LOG:  pg_hint_plan:
4474 used hint:
4475 IndexOnlyScan(ti1 ti1_pkey)
4476 not used hint:
4477 duplication hint:
4478 error hint:
4479
4480               QUERY PLAN               
4481 ---------------------------------------
4482  Index Only Scan using ti1_pkey on ti1
4483    Index Cond: (c1 >= 1)
4484 (2 rows)
4485
4486 -- No. S-3-4-33
4487 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE c2 >= 1;
4488      QUERY PLAN      
4489 ---------------------
4490  Seq Scan on ti1
4491    Filter: (c2 >= 1)
4492 (2 rows)
4493
4494 /*+IndexOnlyScan(ti1 ti1_c2_key)*/
4495 EXPLAIN (COSTS false) SELECT c2 FROM s1.ti1 WHERE c2 >= 1;
4496 LOG:  available indexes for IndexOnlyScan(ti1): ti1_c2_key
4497 LOG:  pg_hint_plan:
4498 used hint:
4499 IndexOnlyScan(ti1 ti1_c2_key)
4500 not used hint:
4501 duplication hint:
4502 error hint:
4503
4504                QUERY PLAN                
4505 -----------------------------------------
4506  Index Only Scan using ti1_c2_key on ti1
4507    Index Cond: (c2 >= 1)
4508 (2 rows)
4509
4510 ----
4511 ---- No. S-3-5 not used index
4512 ----
4513 -- No. S-3-5-1
4514 \o results/ut-S.tmpout
4515 /*+IndexScan(ti1 ti1_pred)*/ EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
4516 LOG:  available indexes for IndexScan(ti1): ti1_pred
4517 LOG:  pg_hint_plan:
4518 used hint:
4519 IndexScan(ti1 ti1_pred)
4520 not used hint:
4521 duplication hint:
4522 error hint:
4523
4524 \o
4525 \! sql/maskout.sh results/ut-S.tmpout
4526                                   QUERY PLAN                                   
4527 -------------------------------------------------------------------------------
4528  Seq Scan on ti1  (cost={inf}..{inf} rows=1 width=xxx)
4529    Filter: (c1 = 100)
4530
4531 -- No. S-3-5-2
4532 \o results/ut-S.tmpout
4533 /*+BitmapScan(ti1 ti1_pred)*/ EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
4534 LOG:  available indexes for BitmapScan(ti1): ti1_pred
4535 LOG:  pg_hint_plan:
4536 used hint:
4537 BitmapScan(ti1 ti1_pred)
4538 not used hint:
4539 duplication hint:
4540 error hint:
4541
4542 \o
4543 \! sql/maskout.sh results/ut-S.tmpout
4544                                   QUERY PLAN                                   
4545 -------------------------------------------------------------------------------
4546  Seq Scan on ti1  (cost={inf}..{inf} rows=1 width=xxx)
4547    Filter: (c1 = 100)
4548
4549 -- No. S-3-5-3
4550 \o results/ut-S.tmpout
4551 /*+IndexOnlyScan(ti1 ti1_pred)*/ EXPLAIN (COSTS true) SELECT c1 FROM s1.ti1 WHERE c1 = 100;
4552 LOG:  available indexes for IndexOnlyScan(ti1): ti1_pred
4553 LOG:  pg_hint_plan:
4554 used hint:
4555 IndexOnlyScan(ti1 ti1_pred)
4556 not used hint:
4557 duplication hint:
4558 error hint:
4559
4560 \o
4561 \! sql/maskout.sh results/ut-S.tmpout
4562                                   QUERY PLAN                                   
4563 -------------------------------------------------------------------------------
4564  Seq Scan on ti1  (cost={inf}..{inf} rows=1 width=xxx)
4565    Filter: (c1 = 100)
4566
4567 -- No. S-3-5-4
4568 \o results/ut-S.tmpout
4569 /*+IndexScan(ti1 not_exist)*/ EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
4570 LOG:  available indexes for IndexScan(ti1):
4571 LOG:  pg_hint_plan:
4572 used hint:
4573 IndexScan(ti1 not_exist)
4574 not used hint:
4575 duplication hint:
4576 error hint:
4577
4578 \o
4579 \! sql/maskout.sh results/ut-S.tmpout
4580                                   QUERY PLAN                                   
4581 -------------------------------------------------------------------------------
4582  Seq Scan on ti1  (cost={inf}..{inf} rows=1 width=xxx)
4583    Filter: (c1 = 100)
4584
4585 -- No. S-3-5-5
4586 \o results/ut-S.tmpout
4587 /*+BitmapScan(ti1 not_exist)*/ EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
4588 LOG:  available indexes for BitmapScan(ti1):
4589 LOG:  pg_hint_plan:
4590 used hint:
4591 BitmapScan(ti1 not_exist)
4592 not used hint:
4593 duplication hint:
4594 error hint:
4595
4596 \o
4597 \! sql/maskout.sh results/ut-S.tmpout
4598                                   QUERY PLAN                                   
4599 -------------------------------------------------------------------------------
4600  Seq Scan on ti1  (cost={inf}..{inf} rows=1 width=xxx)
4601    Filter: (c1 = 100)
4602
4603 -- No. S-3-5-6
4604 \o results/ut-S.tmpout
4605 /*+IndexOnlyScan(ti1 not_exist)*/ EXPLAIN (COSTS true) SELECT c1 FROM s1.ti1 WHERE c1 = 100;
4606 LOG:  available indexes for IndexOnlyScan(ti1):
4607 LOG:  pg_hint_plan:
4608 used hint:
4609 IndexOnlyScan(ti1 not_exist)
4610 not used hint:
4611 duplication hint:
4612 error hint:
4613
4614 \o
4615 \! sql/maskout.sh results/ut-S.tmpout
4616                                   QUERY PLAN                                   
4617 -------------------------------------------------------------------------------
4618  Seq Scan on ti1  (cost={inf}..{inf} rows=1 width=xxx)
4619    Filter: (c1 = 100)
4620
4621 -- No. S-3-5-7
4622 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
4623           QUERY PLAN          
4624 ------------------------------
4625  Index Scan using t1_i1 on t1
4626    Index Cond: (c1 = 1)
4627 (2 rows)
4628
4629 \o results/ut-S.tmpout
4630 /*+TidScan(t1)*/ EXPLAIN (COSTS true) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
4631 LOG:  pg_hint_plan:
4632 used hint:
4633 TidScan(t1)
4634 not used hint:
4635 duplication hint:
4636 error hint:
4637
4638 \o
4639 \! sql/maskout.sh results/ut-S.tmpout
4640                                   QUERY PLAN                                   
4641 -------------------------------------------------------------------------------
4642  Seq Scan on t1  (cost={inf}..{inf} rows=1 width=xxx)
4643    Filter: (c1 = 1)
4644
4645 ----
4646 ---- No. S-3-6 query structure
4647 ----
4648 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
4649                   QUERY PLAN                   
4650 -----------------------------------------------
4651  Hash Join
4652    Hash Cond: (t2.c1 = t1.c1)
4653    ->  Seq Scan on t2
4654    ->  Hash
4655          ->  Tid Scan on t1
4656                TID Cond: (ctid = '(1,1)'::tid)
4657 (6 rows)
4658
4659 -- No. S-3-6-1
4660 /*+SeqScan(t1)*/
4661 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE c1 = 100;
4662 LOG:  pg_hint_plan:
4663 used hint:
4664 SeqScan(t1)
4665 not used hint:
4666 duplication hint:
4667 error hint:
4668
4669       QUERY PLAN      
4670 ----------------------
4671  Seq Scan on t1
4672    Filter: (c1 = 100)
4673 (2 rows)
4674
4675 -- No. S-3-6-2
4676 /*+SeqScan(t1)BitmapScan(t2)*/
4677 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
4678 LOG:  pg_hint_plan:
4679 used hint:
4680 SeqScan(t1)
4681 BitmapScan(t2)
4682 not used hint:
4683 duplication hint:
4684 error hint:
4685
4686                QUERY PLAN               
4687 ----------------------------------------
4688  Nested Loop
4689    ->  Seq Scan on t1
4690          Filter: (ctid = '(1,1)'::tid)
4691    ->  Bitmap Heap Scan on t2
4692          Recheck Cond: (c1 = t1.c1)
4693          ->  Bitmap Index Scan on t2_i1
4694                Index Cond: (c1 = t1.c1)
4695 (7 rows)
4696
4697 -- No. S-3-6-3
4698 /*+SeqScan(t1)*/
4699 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
4700 LOG:  pg_hint_plan:
4701 used hint:
4702 SeqScan(t1)
4703 not used hint:
4704 duplication hint:
4705 error hint:
4706
4707                  QUERY PLAN                  
4708 ---------------------------------------------
4709  Hash Join
4710    Hash Cond: (t2.c1 = t1.c1)
4711    ->  Seq Scan on t2
4712    ->  Hash
4713          ->  Seq Scan on t1
4714                Filter: (ctid = '(1,1)'::tid)
4715 (6 rows)
4716
4717 ----
4718 ---- No. S-3-7 number of tables in a query block
4719 ----
4720 -- No. S-3-7-1
4721 EXPLAIN (COSTS false) 
4722 WITH c1 (c1) AS (
4723 SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.c1 = 1)
4724 SELECT max(b3t1.c1), (
4725 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
4726                   ) FROM s1.t1 b3t1 WHERE b3t1.c1 = (
4727 SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
4728                              QUERY PLAN                              
4729 ---------------------------------------------------------------------
4730  Aggregate
4731    InitPlan 2 (returns $1)
4732      ->  Result
4733            InitPlan 1 (returns $0)
4734              ->  Limit
4735                    ->  Index Only Scan using t1_i1 on t1 b2t1
4736                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4737    InitPlan 4 (returns $3)
4738      ->  Result
4739            InitPlan 3 (returns $2)
4740              ->  Limit
4741                    ->  Index Only Scan using t1_i1 on t1 b4t1
4742                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4743    ->  Index Only Scan using t1_i1 on t1 b3t1
4744          Index Cond: (c1 = $3)
4745 (15 rows)
4746
4747 /*+SeqScan(b1t1)IndexScan(b2t1 t1_pkey)BitmapScan(b3t1 t1_pkey)TidScan(b4t1)
4748 */
4749 EXPLAIN (COSTS false) 
4750 WITH c1 (c1) AS (
4751 SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.c1 = 1)
4752 SELECT max(b3t1.c1), (
4753 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
4754                   ) FROM s1.t1 b3t1 WHERE b3t1.c1 = (
4755 SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
4756 LOG:  available indexes for IndexScan(b2t1): t1_pkey
4757 LOG:  available indexes for IndexScan(b2t1): t1_pkey
4758 LOG:  available indexes for BitmapScan(b3t1): t1_pkey
4759 LOG:  pg_hint_plan:
4760 used hint:
4761 IndexScan(b2t1 t1_pkey)
4762 BitmapScan(b3t1 t1_pkey)
4763 TidScan(b4t1)
4764 not used hint:
4765 SeqScan(b1t1)
4766 duplication hint:
4767 error hint:
4768
4769                              QUERY PLAN                              
4770 ---------------------------------------------------------------------
4771  Aggregate
4772    InitPlan 2 (returns $1)
4773      ->  Result
4774            InitPlan 1 (returns $0)
4775              ->  Limit
4776                    ->  Index Scan using t1_pkey on t1 b2t1
4777                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4778    InitPlan 4 (returns $3)
4779      ->  Result
4780            InitPlan 3 (returns $2)
4781              ->  Limit
4782                    ->  Seq Scan on t1 b4t1
4783                          Filter: ((c1 IS NOT NULL) AND (c1 = 1))
4784    ->  Bitmap Heap Scan on t1 b3t1
4785          Recheck Cond: (c1 = $3)
4786          ->  Bitmap Index Scan on t1_pkey
4787                Index Cond: (c1 = $3)
4788 (17 rows)
4789
4790 -- No. S-3-7-2
4791 EXPLAIN (COSTS false) 
4792 WITH cte1 (c1) AS (
4793 SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
4794 SELECT max(b3t1.c1), (
4795 SELECT max(b2t1.c1) FROM s1.t1 b2t1 JOIN s1.t2 b2t2 ON(b2t1.c1 = b2t2.c1) WHERE b2t1.c1 = 1
4796                   ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
4797 SELECT max(b4t1.c1) FROM s1.t1 b4t1 JOIN s1.t2 b4t2 ON(b4t1.c1 = b4t2.c1) WHERE b4t1.c1 = 1);
4798                          QUERY PLAN                         
4799 ------------------------------------------------------------
4800  Aggregate
4801    CTE cte1
4802      ->  Aggregate
4803            ->  Nested Loop
4804                  ->  Index Only Scan using t1_i1 on t1 b1t1
4805                        Index Cond: (c1 = 1)
4806                  ->  Seq Scan on t2 b1t2
4807                        Filter: (c1 = 1)
4808    InitPlan 2 (returns $1)
4809      ->  Aggregate
4810            ->  Nested Loop
4811                  ->  Index Only Scan using t1_i1 on t1 b2t1
4812                        Index Cond: (c1 = 1)
4813                  ->  Seq Scan on t2 b2t2
4814                        Filter: (c1 = 1)
4815    InitPlan 3 (returns $2)
4816      ->  Aggregate
4817            ->  Nested Loop
4818                  ->  Index Only Scan using t1_i1 on t1 b4t1
4819                        Index Cond: (c1 = 1)
4820                  ->  Seq Scan on t2 b4t2
4821                        Filter: (c1 = 1)
4822    ->  Nested Loop
4823          ->  Nested Loop
4824                ->  Index Only Scan using t1_i1 on t1 b3t1
4825                      Index Cond: (c1 = $2)
4826                ->  Seq Scan on t2 b3t2
4827                      Filter: (c1 = $2)
4828          ->  CTE Scan on cte1
4829                Filter: (c1 = $2)
4830 (30 rows)
4831
4832 /*+SeqScan(b1t1)IndexScan(b2t1 t1_pkey)BitmapScan(b3t1 t1_pkey)TidScan(b4t1)
4833 TidScan(b1t2)SeqScan(b2t2)IndexScan(b3t2 t2_pkey)BitmapScan(b4t2 t2_pkey)
4834 */
4835 EXPLAIN (COSTS false) 
4836 WITH cte1 (c1) AS (
4837 SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
4838 SELECT max(b3t1.c1), (
4839 SELECT max(b2t1.c1) FROM s1.t1 b2t1 JOIN s1.t2 b2t2 ON(b2t1.c1 = b2t2.c1) WHERE b2t1.c1 = 1
4840                   ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
4841 SELECT max(b4t1.c1) FROM s1.t1 b4t1 JOIN s1.t2 b4t2 ON(b4t1.c1 = b4t2.c1) WHERE b4t1.c1 = 1);
4842 LOG:  available indexes for IndexScan(b2t1): t1_pkey
4843 LOG:  available indexes for BitmapScan(b4t2): t2_pkey
4844 LOG:  available indexes for BitmapScan(b3t1): t1_pkey
4845 LOG:  available indexes for IndexScan(b3t2): t2_pkey
4846 LOG:  pg_hint_plan:
4847 used hint:
4848 SeqScan(b1t1)
4849 TidScan(b1t2)
4850 IndexScan(b2t1 t1_pkey)
4851 SeqScan(b2t2)
4852 BitmapScan(b3t1 t1_pkey)
4853 IndexScan(b3t2 t2_pkey)
4854 TidScan(b4t1)
4855 BitmapScan(b4t2 t2_pkey)
4856 not used hint:
4857 duplication hint:
4858 error hint:
4859
4860                        QUERY PLAN                        
4861 ---------------------------------------------------------
4862  Aggregate
4863    CTE cte1
4864      ->  Aggregate
4865            ->  Nested Loop
4866                  ->  Seq Scan on t1 b1t1
4867                        Filter: (c1 = 1)
4868                  ->  Seq Scan on t2 b1t2
4869                        Filter: (c1 = 1)
4870    InitPlan 2 (returns $1)
4871      ->  Aggregate
4872            ->  Nested Loop
4873                  ->  Index Scan using t1_pkey on t1 b2t1
4874                        Index Cond: (c1 = 1)
4875                  ->  Seq Scan on t2 b2t2
4876                        Filter: (c1 = 1)
4877    InitPlan 3 (returns $2)
4878      ->  Aggregate
4879            ->  Nested Loop
4880                  ->  Seq Scan on t1 b4t1
4881                        Filter: (c1 = 1)
4882                  ->  Bitmap Heap Scan on t2 b4t2
4883                        Recheck Cond: (c1 = 1)
4884                        ->  Bitmap Index Scan on t2_pkey
4885                              Index Cond: (c1 = 1)
4886    ->  Nested Loop
4887          ->  Nested Loop
4888                ->  Bitmap Heap Scan on t1 b3t1
4889                      Recheck Cond: (c1 = $2)
4890                      ->  Bitmap Index Scan on t1_pkey
4891                            Index Cond: (c1 = $2)
4892                ->  Index Scan using t2_pkey on t2 b3t2
4893                      Index Cond: (c1 = $2)
4894          ->  CTE Scan on cte1
4895                Filter: (c1 = $2)
4896 (34 rows)
4897
4898 -- No. S-3-7-3
4899 EXPLAIN (COSTS false) 
4900 WITH cte1 (c1) AS (
4901 SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
4902 SELECT max(b3t1.c1), (
4903 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
4904                   ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
4905 SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
4906                              QUERY PLAN                              
4907 ---------------------------------------------------------------------
4908  Aggregate
4909    CTE cte1
4910      ->  Aggregate
4911            ->  Nested Loop
4912                  ->  Index Only Scan using t1_i1 on t1 b1t1
4913                        Index Cond: (c1 = 1)
4914                  ->  Seq Scan on t2 b1t2
4915                        Filter: (c1 = 1)
4916    InitPlan 3 (returns $2)
4917      ->  Result
4918            InitPlan 2 (returns $1)
4919              ->  Limit
4920                    ->  Index Only Scan using t1_i1 on t1 b2t1
4921                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4922    InitPlan 5 (returns $4)
4923      ->  Result
4924            InitPlan 4 (returns $3)
4925              ->  Limit
4926                    ->  Index Only Scan using t1_i1 on t1 b4t1
4927                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4928    ->  Nested Loop
4929          ->  Nested Loop
4930                ->  Index Only Scan using t1_i1 on t1 b3t1
4931                      Index Cond: (c1 = $4)
4932                ->  Seq Scan on t2 b3t2
4933                      Filter: (c1 = $4)
4934          ->  CTE Scan on cte1
4935                Filter: (c1 = $4)
4936 (28 rows)
4937
4938 /*+SeqScan(b1t1)IndexScan(b2t1 t1_pkey)BitmapScan(b3t1 t1_pkey)TidScan(b4t1)
4939 TidScan(b1t2)IndexScan(b3t2 t2_pkey)
4940 */
4941 EXPLAIN (COSTS false) 
4942 WITH cte1 (c1) AS (
4943 SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
4944 SELECT max(b3t1.c1), (
4945 SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
4946                   ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
4947 SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
4948 LOG:  available indexes for IndexScan(b2t1): t1_pkey
4949 LOG:  available indexes for IndexScan(b2t1): t1_pkey
4950 LOG:  available indexes for BitmapScan(b3t1): t1_pkey
4951 LOG:  available indexes for IndexScan(b3t2): t2_pkey
4952 LOG:  pg_hint_plan:
4953 used hint:
4954 SeqScan(b1t1)
4955 TidScan(b1t2)
4956 IndexScan(b2t1 t1_pkey)
4957 BitmapScan(b3t1 t1_pkey)
4958 IndexScan(b3t2 t2_pkey)
4959 TidScan(b4t1)
4960 not used hint:
4961 duplication hint:
4962 error hint:
4963
4964                              QUERY PLAN                              
4965 ---------------------------------------------------------------------
4966  Aggregate
4967    CTE cte1
4968      ->  Aggregate
4969            ->  Nested Loop
4970                  ->  Seq Scan on t1 b1t1
4971                        Filter: (c1 = 1)
4972                  ->  Seq Scan on t2 b1t2
4973                        Filter: (c1 = 1)
4974    InitPlan 3 (returns $2)
4975      ->  Result
4976            InitPlan 2 (returns $1)
4977              ->  Limit
4978                    ->  Index Scan using t1_pkey on t1 b2t1
4979                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4980    InitPlan 5 (returns $4)
4981      ->  Result
4982            InitPlan 4 (returns $3)
4983              ->  Limit
4984                    ->  Seq Scan on t1 b4t1
4985                          Filter: ((c1 IS NOT NULL) AND (c1 = 1))
4986    ->  Nested Loop
4987          ->  Nested Loop
4988                ->  Bitmap Heap Scan on t1 b3t1
4989                      Recheck Cond: (c1 = $4)
4990                      ->  Bitmap Index Scan on t1_pkey
4991                            Index Cond: (c1 = $4)
4992                ->  Index Scan using t2_pkey on t2 b3t2
4993                      Index Cond: (c1 = $4)
4994          ->  CTE Scan on cte1
4995                Filter: (c1 = $4)
4996 (30 rows)
4997
4998 ----
4999 ---- No. S-3-8 inheritance table select/update type
5000 ----
5001 -- No. S-3-8-1
5002 EXPLAIN (COSTS false) SELECT * FROM ONLY s1.p1 WHERE c1 = 1;
5003      QUERY PLAN     
5004 --------------------
5005  Seq Scan on p1
5006    Filter: (c1 = 1)
5007 (2 rows)
5008
5009 /*+IndexScan(p1)*/
5010 EXPLAIN (COSTS false) SELECT * FROM ONLY s1.p1 WHERE c1 = 1;
5011 LOG:  pg_hint_plan:
5012 used hint:
5013 IndexScan(p1)
5014 not used hint:
5015 duplication hint:
5016 error hint:
5017
5018          QUERY PLAN          
5019 -----------------------------
5020  Index Scan using p1_i on p1
5021    Index Cond: (c1 = 1)
5022 (2 rows)
5023
5024 -- No. S-3-8-2
5025 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
5026         QUERY PLAN        
5027 --------------------------
5028  Append
5029    ->  Seq Scan on p1
5030          Filter: (c1 = 1)
5031    ->  Seq Scan on p1c1
5032          Filter: (c1 = 1)
5033 (5 rows)
5034
5035 /*+IndexScan(p1)*/
5036 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
5037 LOG:  pg_hint_plan:
5038 used hint:
5039 IndexScan(p1)
5040 not used hint:
5041 duplication hint:
5042 error hint:
5043
5044               QUERY PLAN               
5045 ---------------------------------------
5046  Append
5047    ->  Index Scan using p1_i on p1
5048          Index Cond: (c1 = 1)
5049    ->  Index Scan using p1c1_i on p1c1
5050          Index Cond: (c1 = 1)
5051 (5 rows)
5052
5053 -- No. S-3-8-3
5054 EXPLAIN (COSTS false) UPDATE ONLY s1.p1 SET c4 = c4 WHERE c1 = 1;
5055         QUERY PLAN        
5056 --------------------------
5057  Update on p1
5058    ->  Seq Scan on p1
5059          Filter: (c1 = 1)
5060 (3 rows)
5061
5062 /*+IndexScan(p1)*/
5063 EXPLAIN (COSTS false) UPDATE ONLY s1.p1 SET c4 = c4 WHERE c1 = 1;
5064 LOG:  pg_hint_plan:
5065 used hint:
5066 IndexScan(p1)
5067 not used hint:
5068 duplication hint:
5069 error hint:
5070
5071             QUERY PLAN             
5072 -----------------------------------
5073  Update on p1
5074    ->  Index Scan using p1_i on p1
5075          Index Cond: (c1 = 1)
5076 (3 rows)
5077
5078 /*+IndexScan(p1 p1_pkey)*/
5079 EXPLAIN (COSTS false) UPDATE ONLY s1.p1 SET c4 = c4 WHERE c1 = 1;
5080 LOG:  available indexes for IndexScan(p1): p1_pkey
5081 LOG:  pg_hint_plan:
5082 used hint:
5083 IndexScan(p1 p1_pkey)
5084 not used hint:
5085 duplication hint:
5086 error hint:
5087
5088               QUERY PLAN              
5089 --------------------------------------
5090  Update on p1
5091    ->  Index Scan using p1_pkey on p1
5092          Index Cond: (c1 = 1)
5093 (3 rows)
5094
5095 -- No. S-3-8-4
5096 EXPLAIN (COSTS false) UPDATE s1.p1 SET c4 = c4 WHERE c1 = 1;
5097         QUERY PLAN        
5098 --------------------------
5099  Update on p1
5100    Update on p1
5101    Update on p1c1
5102    ->  Seq Scan on p1
5103          Filter: (c1 = 1)
5104    ->  Seq Scan on p1c1
5105          Filter: (c1 = 1)
5106 (7 rows)
5107
5108 /*+IndexScan(p1)*/
5109 EXPLAIN (COSTS false) UPDATE s1.p1 SET c4 = c4 WHERE c1 = 1;
5110 LOG:  pg_hint_plan:
5111 used hint:
5112 IndexScan(p1)
5113 not used hint:
5114 duplication hint:
5115 error hint:
5116
5117               QUERY PLAN               
5118 ---------------------------------------
5119  Update on p1
5120    Update on p1
5121    Update on p1c1
5122    ->  Index Scan using p1_i on p1
5123          Index Cond: (c1 = 1)
5124    ->  Index Scan using p1c1_i on p1c1
5125          Index Cond: (c1 = 1)
5126 (7 rows)
5127
5128 /*+IndexScan(p1 p1_pkey)*/
5129 EXPLAIN (COSTS false) UPDATE s1.p1 SET c4 = c4 WHERE c1 = 1;
5130 LOG:  available indexes for IndexScan(p1): p1_pkey
5131 LOG:  available indexes for IndexScan(p1c1): p1c1_pkey
5132 LOG:  pg_hint_plan:
5133 used hint:
5134 IndexScan(p1 p1_pkey)
5135 not used hint:
5136 duplication hint:
5137 error hint:
5138
5139                 QUERY PLAN                
5140 ------------------------------------------
5141  Update on p1
5142    Update on p1
5143    Update on p1c1
5144    ->  Index Scan using p1_pkey on p1
5145          Index Cond: (c1 = 1)
5146    ->  Index Scan using p1c1_pkey on p1c1
5147          Index Cond: (c1 = 1)
5148 (7 rows)
5149
5150 ----
5151 ---- No. S-3-9 inheritance table number
5152 ----
5153 -- No. S-3-9-1
5154 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
5155         QUERY PLAN        
5156 --------------------------
5157  Append
5158    ->  Seq Scan on p1
5159          Filter: (c1 = 1)
5160    ->  Seq Scan on p1c1
5161          Filter: (c1 = 1)
5162 (5 rows)
5163
5164 /*+IndexScan(p1)*/
5165 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
5166 LOG:  pg_hint_plan:
5167 used hint:
5168 IndexScan(p1)
5169 not used hint:
5170 duplication hint:
5171 error hint:
5172
5173               QUERY PLAN               
5174 ---------------------------------------
5175  Append
5176    ->  Index Scan using p1_i on p1
5177          Index Cond: (c1 = 1)
5178    ->  Index Scan using p1c1_i on p1c1
5179          Index Cond: (c1 = 1)
5180 (5 rows)
5181
5182 -- No. S-3-9-2
5183 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
5184         QUERY PLAN        
5185 --------------------------
5186  Append
5187    ->  Seq Scan on p2
5188          Filter: (c1 = 1)
5189    ->  Seq Scan on p2c1
5190          Filter: (c1 = 1)
5191    ->  Seq Scan on p2c1c1
5192          Filter: (c1 = 1)
5193 (7 rows)
5194
5195 /*+IndexScan(p2)*/
5196 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
5197 LOG:  pg_hint_plan:
5198 used hint:
5199 IndexScan(p2)
5200 not used hint:
5201 duplication hint:
5202 error hint:
5203
5204                 QUERY PLAN                 
5205 -------------------------------------------
5206  Append
5207    ->  Index Scan using p2_i on p2
5208          Index Cond: (c1 = 1)
5209    ->  Index Scan using p2c1_i on p2c1
5210          Index Cond: (c1 = 1)
5211    ->  Index Scan using p2c1c1_i on p2c1c1
5212          Index Cond: (c1 = 1)
5213 (7 rows)
5214
5215 ----
5216 ---- No. S-3-10 inheritance table specified table
5217 ----
5218 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
5219         QUERY PLAN        
5220 --------------------------
5221  Append
5222    ->  Seq Scan on p2
5223          Filter: (c1 = 1)
5224    ->  Seq Scan on p2c1
5225          Filter: (c1 = 1)
5226    ->  Seq Scan on p2c1c1
5227          Filter: (c1 = 1)
5228 (7 rows)
5229
5230 -- No. S-3-10-1
5231 /*+IndexScan(p2)*/
5232 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
5233 LOG:  pg_hint_plan:
5234 used hint:
5235 IndexScan(p2)
5236 not used hint:
5237 duplication hint:
5238 error hint:
5239
5240                 QUERY PLAN                 
5241 -------------------------------------------
5242  Append
5243    ->  Index Scan using p2_i on p2
5244          Index Cond: (c1 = 1)
5245    ->  Index Scan using p2c1_i on p2c1
5246          Index Cond: (c1 = 1)
5247    ->  Index Scan using p2c1c1_i on p2c1c1
5248          Index Cond: (c1 = 1)
5249 (7 rows)
5250
5251 -- No. S-3-10-2
5252 /*+IndexScan(p2c1)*/
5253 EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
5254 LOG:  pg_hint_plan:
5255 used hint:
5256 IndexScan(p2c1)
5257 not used hint:
5258 duplication hint:
5259 error hint:
5260
5261               QUERY PLAN               
5262 ---------------------------------------
5263  Append
5264    ->  Seq Scan on p2
5265          Filter: (c1 = 1)
5266    ->  Index Scan using p2c1_i on p2c1
5267          Index Cond: (c1 = 1)
5268    ->  Seq Scan on p2c1c1
5269          Filter: (c1 = 1)
5270 (7 rows)
5271
5272 -- No. S-3-10-3
5273 \o results/ut-S.tmpout
5274 EXPLAIN SELECT c4 FROM s1.p1 WHERE c2 * 2 < 100 AND c1 < 10;
5275 \o
5276 \! sql/maskout.sh results/ut-S.tmpout
5277                         QUERY PLAN                        
5278 ----------------------------------------------------------
5279  Append  (cost=xxx..xxx rows=4 width=xxx)
5280    ->  Seq Scan on p1  (cost=xxx..xxx rows=1 width=xxx)
5281          Filter: ((c1 < 10) AND ((c2 * 2) < 100))
5282    ->  Seq Scan on p1c1  (cost=xxx..xxx rows=3 width=xxx)
5283          Filter: ((c1 < 10) AND ((c2 * 2) < 100))
5284
5285 \o results/ut-S.tmpout
5286 /*+IndexScan(p1 p1_parent)*/ EXPLAIN SELECT c4 FROM s1.p1 WHERE c2 * 2 < 100 AND c1 < 10;
5287 LOG:  available indexes for IndexScan(p1): p1_parent
5288 LOG:  available indexes for IndexScan(p1c1): p1c1_c4_expr_idx
5289 LOG:  pg_hint_plan:
5290 used hint:
5291 IndexScan(p1 p1_parent)
5292 not used hint:
5293 duplication hint:
5294 error hint:
5295
5296 \o
5297 \! sql/maskout.sh results/ut-S.tmpout
5298                                      QUERY PLAN                                     
5299 ------------------------------------------------------------------------------------
5300  Append  (cost=xxx..xxx rows=4 width=xxx)
5301    ->  Index Scan using p1_parent on p1  (cost=xxx..xxx rows=1 width=xxx)
5302          Filter: ((c2 * 2) < 100)
5303    ->  Index Scan using p1c1_c4_expr_idx on p1c1  (cost=xxx..xxx rows=3 width=xxx)
5304          Filter: ((c2 * 2) < 100)
5305
5306 -- No. S-3-10-4
5307 \o results/ut-S.tmpout
5308 /*+IndexScan(p1 p1_i2)*/ EXPLAIN SELECT c2 FROM s1.p1 WHERE c2 = 1;
5309 LOG:  available indexes for IndexScan(p1): p1_i2
5310 LOG:  available indexes for IndexScan(p1c1):
5311 LOG:  available indexes for IndexScan(p1c2):
5312 LOG:  available indexes for IndexScan(p1c3):
5313 LOG:  pg_hint_plan:
5314 used hint:
5315 IndexScan(p1 p1_i2)
5316 not used hint:
5317 duplication hint:
5318 error hint:
5319
5320 \o
5321 \! sql/maskout.sh results/ut-S.tmpout
5322                                   QUERY PLAN                                   
5323 -------------------------------------------------------------------------------
5324  Append  (cost=xxx..xxx rows=4 width=xxx)
5325    ->  Index Scan using p1_i2 on p1  (cost=xxx..xxx rows=1 width=xxx)
5326          Index Cond: (c2 = 1)
5327    ->  Seq Scan on p1c1  (cost={inf}..{inf} rows=1 width=xxx)
5328          Filter: (c2 = 1)
5329    ->  Seq Scan on p1c2  (cost={inf}..{inf} rows=1 width=xxx)
5330          Filter: (c2 = 1)
5331    ->  Seq Scan on p1c3  (cost={inf}..{inf} rows=1 width=xxx)
5332          Filter: (c2 = 1)
5333
5334 -- No. S-3-10-5
5335 \o results/ut-S.tmpout
5336 /*+IndexScan(p2 p2c1_pkey)*/ EXPLAIN (COSTS true) SELECT * FROM s1.p2 WHERE c1 = 1;
5337 LOG:  available indexes for IndexScan(p2):
5338 LOG:  available indexes for IndexScan(p2c1): p2c1_pkey
5339 LOG:  available indexes for IndexScan(p2c1c1):
5340 LOG:  pg_hint_plan:
5341 used hint:
5342 IndexScan(p2 p2c1_pkey)
5343 not used hint:
5344 duplication hint:
5345 error hint:
5346
5347 \o
5348 \! sql/maskout.sh results/ut-S.tmpout
5349                                    QUERY PLAN                                    
5350 ---------------------------------------------------------------------------------
5351  Append  (cost={inf}..{inf} rows=3 width=xxx)
5352    ->  Seq Scan on p2  (cost={inf}..{inf} rows=1 width=xxx)
5353          Filter: (c1 = 1)
5354    ->  Index Scan using p2c1_pkey on p2c1  (cost=xxx..xxx rows=1 width=xxx)
5355          Index Cond: (c1 = 1)
5356    ->  Seq Scan on p2c1c1  (cost={inf}..{inf} rows=1 width=xxx)
5357          Filter: (c1 = 1)
5358
5359 ----
5360 ---- No. S-3-12 specified same table
5361 ----
5362 -- No. S-3-12-1
5363 /*+IndexScan(ti1) BitmapScan(ti1)*/
5364 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5365 INFO:  pg_hint_plan: hint syntax error at or near "IndexScan(ti1) BitmapScan(ti1)"
5366 DETAIL:  Conflict scan method hint.
5367 LOG:  pg_hint_plan:
5368 used hint:
5369 BitmapScan(ti1)
5370 not used hint:
5371 duplication hint:
5372 IndexScan(ti1)
5373 error hint:
5374
5375              QUERY PLAN              
5376 -------------------------------------
5377  Bitmap Heap Scan on ti1
5378    Recheck Cond: (c1 = 1)
5379    Filter: (ctid = '(1,1)'::tid)
5380    ->  Bitmap Index Scan on ti1_hash
5381          Index Cond: (c1 = 1)
5382 (5 rows)
5383
5384 -- No. S-3-12-2
5385 /*+IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)*/
5386 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5387 INFO:  pg_hint_plan: hint syntax error at or near "IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
5388 DETAIL:  Conflict scan method hint.
5389 LOG:  available indexes for BitmapScan(ti1): ti1_btree
5390 LOG:  pg_hint_plan:
5391 used hint:
5392 BitmapScan(ti1 ti1_btree)
5393 not used hint:
5394 duplication hint:
5395 IndexScan(ti1 ti1_pkey)
5396 error hint:
5397
5398               QUERY PLAN              
5399 --------------------------------------
5400  Bitmap Heap Scan on ti1
5401    Recheck Cond: (c1 = 1)
5402    Filter: (ctid = '(1,1)'::tid)
5403    ->  Bitmap Index Scan on ti1_btree
5404          Index Cond: (c1 = 1)
5405 (5 rows)
5406
5407 -- No. S-3-12-3
5408 /*+BitmapScan(ti1) IndexScan(ti1) BitmapScan(ti1)*/
5409 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5410 INFO:  pg_hint_plan: hint syntax error at or near "BitmapScan(ti1) IndexScan(ti1) BitmapScan(ti1)"
5411 DETAIL:  Conflict scan method hint.
5412 INFO:  pg_hint_plan: hint syntax error at or near "IndexScan(ti1) BitmapScan(ti1)"
5413 DETAIL:  Conflict scan method hint.
5414 LOG:  pg_hint_plan:
5415 used hint:
5416 BitmapScan(ti1)
5417 not used hint:
5418 duplication hint:
5419 BitmapScan(ti1)
5420 IndexScan(ti1)
5421 error hint:
5422
5423              QUERY PLAN              
5424 -------------------------------------
5425  Bitmap Heap Scan on ti1
5426    Recheck Cond: (c1 = 1)
5427    Filter: (ctid = '(1,1)'::tid)
5428    ->  Bitmap Index Scan on ti1_hash
5429          Index Cond: (c1 = 1)
5430 (5 rows)
5431
5432 -- No. S-3-12-4
5433 /*+BitmapScan(ti1 ti1_hash) IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)*/
5434 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5435 INFO:  pg_hint_plan: hint syntax error at or near "BitmapScan(ti1 ti1_hash) IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
5436 DETAIL:  Conflict scan method hint.
5437 INFO:  pg_hint_plan: hint syntax error at or near "IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
5438 DETAIL:  Conflict scan method hint.
5439 LOG:  available indexes for BitmapScan(ti1): ti1_btree
5440 LOG:  pg_hint_plan:
5441 used hint:
5442 BitmapScan(ti1 ti1_btree)
5443 not used hint:
5444 duplication hint:
5445 BitmapScan(ti1 ti1_hash)
5446 IndexScan(ti1 ti1_pkey)
5447 error hint:
5448
5449               QUERY PLAN              
5450 --------------------------------------
5451  Bitmap Heap Scan on ti1
5452    Recheck Cond: (c1 = 1)
5453    Filter: (ctid = '(1,1)'::tid)
5454    ->  Bitmap Index Scan on ti1_btree
5455          Index Cond: (c1 = 1)
5456 (5 rows)
5457
5458 ----
5459 ---- No. S-3-13 message output of hint
5460 ----
5461 -- No. S-3-13-1
5462 /*+SeqScan(ti1)*/
5463 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5464 LOG:  pg_hint_plan:
5465 used hint:
5466 SeqScan(ti1)
5467 not used hint:
5468 duplication hint:
5469 error hint:
5470
5471                    QUERY PLAN                   
5472 ------------------------------------------------
5473  Seq Scan on ti1
5474    Filter: ((c1 = 1) AND (ctid = '(1,1)'::tid))
5475 (2 rows)
5476
5477 -- No. S-3-13-2
5478 /*+SeqScan(ti1 ti1_pkey)*/
5479 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5480 INFO:  pg_hint_plan: hint syntax error at or near ""
5481 DETAIL:  SeqScan hint accepts only one relation.
5482 LOG:  pg_hint_plan:
5483 used hint:
5484 not used hint:
5485 duplication hint:
5486 error hint:
5487 SeqScan(ti1 ti1_pkey)
5488
5489             QUERY PLAN             
5490 -----------------------------------
5491  Tid Scan on ti1
5492    TID Cond: (ctid = '(1,1)'::tid)
5493    Filter: (c1 = 1)
5494 (3 rows)
5495
5496 -- No. S-3-13-3
5497 /*+SeqScan(ti1 ti1_pkey ti1_btree)*/
5498 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5499 INFO:  pg_hint_plan: hint syntax error at or near ""
5500 DETAIL:  SeqScan hint accepts only one relation.
5501 LOG:  pg_hint_plan:
5502 used hint:
5503 not used hint:
5504 duplication hint:
5505 error hint:
5506 SeqScan(ti1 ti1_pkey ti1_btree)
5507
5508             QUERY PLAN             
5509 -----------------------------------
5510  Tid Scan on ti1
5511    TID Cond: (ctid = '(1,1)'::tid)
5512    Filter: (c1 = 1)
5513 (3 rows)
5514
5515 -- No. S-3-13-4
5516 /*+IndexScan(ti1)*/
5517 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5518 LOG:  pg_hint_plan:
5519 used hint:
5520 IndexScan(ti1)
5521 not used hint:
5522 duplication hint:
5523 error hint:
5524
5525             QUERY PLAN            
5526 ----------------------------------
5527  Index Scan using ti1_hash on ti1
5528    Index Cond: (c1 = 1)
5529    Filter: (ctid = '(1,1)'::tid)
5530 (3 rows)
5531
5532 -- No. S-3-13-5
5533 /*+IndexScan(ti1 ti1_pkey)*/
5534 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5535 LOG:  available indexes for IndexScan(ti1): ti1_pkey
5536 LOG:  pg_hint_plan:
5537 used hint:
5538 IndexScan(ti1 ti1_pkey)
5539 not used hint:
5540 duplication hint:
5541 error hint:
5542
5543             QUERY PLAN            
5544 ----------------------------------
5545  Index Scan using ti1_pkey on ti1
5546    Index Cond: (c1 = 1)
5547    Filter: (ctid = '(1,1)'::tid)
5548 (3 rows)
5549
5550 -- No. S-3-13-6
5551 /*+IndexScan(ti1 ti1_pkey ti1_btree)*/
5552 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5553 LOG:  available indexes for IndexScan(ti1): ti1_btree ti1_pkey
5554 LOG:  pg_hint_plan:
5555 used hint:
5556 IndexScan(ti1 ti1_pkey ti1_btree)
5557 not used hint:
5558 duplication hint:
5559 error hint:
5560
5561             QUERY PLAN             
5562 -----------------------------------
5563  Index Scan using ti1_btree on ti1
5564    Index Cond: (c1 = 1)
5565    Filter: (ctid = '(1,1)'::tid)
5566 (3 rows)
5567
5568 -- No. S-3-13-7
5569 /*+BitmapScan(ti1)*/
5570 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5571 LOG:  pg_hint_plan:
5572 used hint:
5573 BitmapScan(ti1)
5574 not used hint:
5575 duplication hint:
5576 error hint:
5577
5578              QUERY PLAN              
5579 -------------------------------------
5580  Bitmap Heap Scan on ti1
5581    Recheck Cond: (c1 = 1)
5582    Filter: (ctid = '(1,1)'::tid)
5583    ->  Bitmap Index Scan on ti1_hash
5584          Index Cond: (c1 = 1)
5585 (5 rows)
5586
5587 -- No. S-3-13-8
5588 /*+BitmapScan(ti1 ti1_pkey)*/
5589 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5590 LOG:  available indexes for BitmapScan(ti1): ti1_pkey
5591 LOG:  pg_hint_plan:
5592 used hint:
5593 BitmapScan(ti1 ti1_pkey)
5594 not used hint:
5595 duplication hint:
5596 error hint:
5597
5598              QUERY PLAN              
5599 -------------------------------------
5600  Bitmap Heap Scan on ti1
5601    Recheck Cond: (c1 = 1)
5602    Filter: (ctid = '(1,1)'::tid)
5603    ->  Bitmap Index Scan on ti1_pkey
5604          Index Cond: (c1 = 1)
5605 (5 rows)
5606
5607 -- No. S-3-13-9
5608 /*+BitmapScan(ti1 ti1_pkey ti1_btree)*/
5609 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5610 LOG:  available indexes for BitmapScan(ti1): ti1_btree ti1_pkey
5611 LOG:  pg_hint_plan:
5612 used hint:
5613 BitmapScan(ti1 ti1_pkey ti1_btree)
5614 not used hint:
5615 duplication hint:
5616 error hint:
5617
5618               QUERY PLAN              
5619 --------------------------------------
5620  Bitmap Heap Scan on ti1
5621    Recheck Cond: (c1 = 1)
5622    Filter: (ctid = '(1,1)'::tid)
5623    ->  Bitmap Index Scan on ti1_btree
5624          Index Cond: (c1 = 1)
5625 (5 rows)
5626
5627 -- No. S-3-13-10
5628 /*+TidScan(ti1)*/
5629 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5630 LOG:  pg_hint_plan:
5631 used hint:
5632 TidScan(ti1)
5633 not used hint:
5634 duplication hint:
5635 error hint:
5636
5637             QUERY PLAN             
5638 -----------------------------------
5639  Tid Scan on ti1
5640    TID Cond: (ctid = '(1,1)'::tid)
5641    Filter: (c1 = 1)
5642 (3 rows)
5643
5644 -- No. S-3-13-11
5645 /*+TidScan(ti1 ti1_pkey)*/
5646 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5647 INFO:  pg_hint_plan: hint syntax error at or near ""
5648 DETAIL:  TidScan hint accepts only one relation.
5649 LOG:  pg_hint_plan:
5650 used hint:
5651 not used hint:
5652 duplication hint:
5653 error hint:
5654 TidScan(ti1 ti1_pkey)
5655
5656             QUERY PLAN             
5657 -----------------------------------
5658  Tid Scan on ti1
5659    TID Cond: (ctid = '(1,1)'::tid)
5660    Filter: (c1 = 1)
5661 (3 rows)
5662
5663 -- No. S-3-13-12
5664 /*+TidScan(ti1 ti1_pkey ti1_btree)*/
5665 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5666 INFO:  pg_hint_plan: hint syntax error at or near ""
5667 DETAIL:  TidScan hint accepts only one relation.
5668 LOG:  pg_hint_plan:
5669 used hint:
5670 not used hint:
5671 duplication hint:
5672 error hint:
5673 TidScan(ti1 ti1_pkey ti1_btree)
5674
5675             QUERY PLAN             
5676 -----------------------------------
5677  Tid Scan on ti1
5678    TID Cond: (ctid = '(1,1)'::tid)
5679    Filter: (c1 = 1)
5680 (3 rows)
5681
5682 -- No. S-3-13-13
5683 /*+NoSeqScan(ti1)*/
5684 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5685 LOG:  pg_hint_plan:
5686 used hint:
5687 NoSeqScan(ti1)
5688 not used hint:
5689 duplication hint:
5690 error hint:
5691
5692             QUERY PLAN             
5693 -----------------------------------
5694  Tid Scan on ti1
5695    TID Cond: (ctid = '(1,1)'::tid)
5696    Filter: (c1 = 1)
5697 (3 rows)
5698
5699 -- No. S-3-13-14
5700 /*+NoSeqScan(ti1 ti1_pkey)*/
5701 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5702 INFO:  pg_hint_plan: hint syntax error at or near ""
5703 DETAIL:  NoSeqScan hint accepts only one relation.
5704 LOG:  pg_hint_plan:
5705 used hint:
5706 not used hint:
5707 duplication hint:
5708 error hint:
5709 NoSeqScan(ti1 ti1_pkey)
5710
5711             QUERY PLAN             
5712 -----------------------------------
5713  Tid Scan on ti1
5714    TID Cond: (ctid = '(1,1)'::tid)
5715    Filter: (c1 = 1)
5716 (3 rows)
5717
5718 -- No. S-3-13-15
5719 /*+NoSeqScan(ti1 ti1_pkey ti1_btree)*/
5720 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5721 INFO:  pg_hint_plan: hint syntax error at or near ""
5722 DETAIL:  NoSeqScan hint accepts only one relation.
5723 LOG:  pg_hint_plan:
5724 used hint:
5725 not used hint:
5726 duplication hint:
5727 error hint:
5728 NoSeqScan(ti1 ti1_pkey ti1_btree)
5729
5730             QUERY PLAN             
5731 -----------------------------------
5732  Tid Scan on ti1
5733    TID Cond: (ctid = '(1,1)'::tid)
5734    Filter: (c1 = 1)
5735 (3 rows)
5736
5737 -- No. S-3-13-16
5738 /*+NoIndexScan(ti1)*/
5739 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5740 LOG:  pg_hint_plan:
5741 used hint:
5742 NoIndexScan(ti1)
5743 not used hint:
5744 duplication hint:
5745 error hint:
5746
5747             QUERY PLAN             
5748 -----------------------------------
5749  Tid Scan on ti1
5750    TID Cond: (ctid = '(1,1)'::tid)
5751    Filter: (c1 = 1)
5752 (3 rows)
5753
5754 -- No. S-3-13-17
5755 /*+NoIndexScan(ti1 ti1_pkey)*/
5756 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5757 INFO:  pg_hint_plan: hint syntax error at or near ""
5758 DETAIL:  NoIndexScan hint accepts only one relation.
5759 LOG:  pg_hint_plan:
5760 used hint:
5761 not used hint:
5762 duplication hint:
5763 error hint:
5764 NoIndexScan(ti1 ti1_pkey)
5765
5766             QUERY PLAN             
5767 -----------------------------------
5768  Tid Scan on ti1
5769    TID Cond: (ctid = '(1,1)'::tid)
5770    Filter: (c1 = 1)
5771 (3 rows)
5772
5773 -- No. S-3-13-18
5774 /*+NoIndexScan(ti1 ti1_pkey ti1_btree)*/
5775 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5776 INFO:  pg_hint_plan: hint syntax error at or near ""
5777 DETAIL:  NoIndexScan hint accepts only one relation.
5778 LOG:  pg_hint_plan:
5779 used hint:
5780 not used hint:
5781 duplication hint:
5782 error hint:
5783 NoIndexScan(ti1 ti1_pkey ti1_btree)
5784
5785             QUERY PLAN             
5786 -----------------------------------
5787  Tid Scan on ti1
5788    TID Cond: (ctid = '(1,1)'::tid)
5789    Filter: (c1 = 1)
5790 (3 rows)
5791
5792 -- No. S-3-13-19
5793 /*+NoBitmapScan(ti1)*/
5794 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5795 LOG:  pg_hint_plan:
5796 used hint:
5797 NoBitmapScan(ti1)
5798 not used hint:
5799 duplication hint:
5800 error hint:
5801
5802             QUERY PLAN             
5803 -----------------------------------
5804  Tid Scan on ti1
5805    TID Cond: (ctid = '(1,1)'::tid)
5806    Filter: (c1 = 1)
5807 (3 rows)
5808
5809 -- No. S-3-13-20
5810 /*+NoBitmapScan(ti1 ti1_pkey)*/
5811 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5812 INFO:  pg_hint_plan: hint syntax error at or near ""
5813 DETAIL:  NoBitmapScan hint accepts only one relation.
5814 LOG:  pg_hint_plan:
5815 used hint:
5816 not used hint:
5817 duplication hint:
5818 error hint:
5819 NoBitmapScan(ti1 ti1_pkey)
5820
5821             QUERY PLAN             
5822 -----------------------------------
5823  Tid Scan on ti1
5824    TID Cond: (ctid = '(1,1)'::tid)
5825    Filter: (c1 = 1)
5826 (3 rows)
5827
5828 -- No. S-3-13-21
5829 /*+NoBitmapScan(ti1 ti1_pkey ti1_btree)*/
5830 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5831 INFO:  pg_hint_plan: hint syntax error at or near ""
5832 DETAIL:  NoBitmapScan hint accepts only one relation.
5833 LOG:  pg_hint_plan:
5834 used hint:
5835 not used hint:
5836 duplication hint:
5837 error hint:
5838 NoBitmapScan(ti1 ti1_pkey ti1_btree)
5839
5840             QUERY PLAN             
5841 -----------------------------------
5842  Tid Scan on ti1
5843    TID Cond: (ctid = '(1,1)'::tid)
5844    Filter: (c1 = 1)
5845 (3 rows)
5846
5847 -- No. S-3-13-22
5848 /*+NoTidScan(ti1)*/
5849 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5850 LOG:  pg_hint_plan:
5851 used hint:
5852 NoTidScan(ti1)
5853 not used hint:
5854 duplication hint:
5855 error hint:
5856
5857             QUERY PLAN            
5858 ----------------------------------
5859  Index Scan using ti1_hash on ti1
5860    Index Cond: (c1 = 1)
5861    Filter: (ctid = '(1,1)'::tid)
5862 (3 rows)
5863
5864 -- No. S-3-13-23
5865 /*+NoTidScan(ti1 ti1_pkey)*/
5866 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5867 INFO:  pg_hint_plan: hint syntax error at or near ""
5868 DETAIL:  NoTidScan hint accepts only one relation.
5869 LOG:  pg_hint_plan:
5870 used hint:
5871 not used hint:
5872 duplication hint:
5873 error hint:
5874 NoTidScan(ti1 ti1_pkey)
5875
5876             QUERY PLAN             
5877 -----------------------------------
5878  Tid Scan on ti1
5879    TID Cond: (ctid = '(1,1)'::tid)
5880    Filter: (c1 = 1)
5881 (3 rows)
5882
5883 -- No. S-3-13-24
5884 /*+NoTidScan(ti1 ti1_pkey ti1_btree)*/
5885 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
5886 INFO:  pg_hint_plan: hint syntax error at or near ""
5887 DETAIL:  NoTidScan hint accepts only one relation.
5888 LOG:  pg_hint_plan:
5889 used hint:
5890 not used hint:
5891 duplication hint:
5892 error hint:
5893 NoTidScan(ti1 ti1_pkey ti1_btree)
5894
5895             QUERY PLAN             
5896 -----------------------------------
5897  Tid Scan on ti1
5898    TID Cond: (ctid = '(1,1)'::tid)
5899    Filter: (c1 = 1)
5900 (3 rows)
5901
5902 -- No. S-3-13-25
5903 /*+IndexOnlyScan(ti1)*/
5904 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
5905 LOG:  pg_hint_plan:
5906 used hint:
5907 IndexOnlyScan(ti1)
5908 not used hint:
5909 duplication hint:
5910 error hint:
5911
5912               QUERY PLAN               
5913 ---------------------------------------
5914  Index Only Scan using ti1_uniq on ti1
5915    Index Cond: (c1 >= 1)
5916 (2 rows)
5917
5918 -- No. S-3-13-26
5919 /*+IndexOnlyScan(ti1 ti1_pkey)*/
5920 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
5921 LOG:  available indexes for IndexOnlyScan(ti1): ti1_pkey
5922 LOG:  pg_hint_plan:
5923 used hint:
5924 IndexOnlyScan(ti1 ti1_pkey)
5925 not used hint:
5926 duplication hint:
5927 error hint:
5928
5929               QUERY PLAN               
5930 ---------------------------------------
5931  Index Only Scan using ti1_pkey on ti1
5932    Index Cond: (c1 >= 1)
5933 (2 rows)
5934
5935 -- No. S-3-13-27
5936 /*+IndexOnlyScan(ti1 ti1_pkey ti1_btree)*/
5937 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 >= 1;
5938 LOG:  available indexes for IndexOnlyScan(ti1): ti1_btree ti1_pkey
5939 LOG:  pg_hint_plan:
5940 used hint:
5941 IndexOnlyScan(ti1 ti1_pkey ti1_btree)
5942 not used hint:
5943 duplication hint:
5944 error hint:
5945
5946                QUERY PLAN               
5947 ----------------------------------------
5948  Index Only Scan using ti1_btree on ti1
5949    Index Cond: (c1 >= 1)
5950 (2 rows)
5951
5952 -- No. S-3-13-28
5953 /*+NoIndexOnlyScan(ti1)*/
5954 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
5955 LOG:  pg_hint_plan:
5956 used hint:
5957 NoIndexOnlyScan(ti1)
5958 not used hint:
5959 duplication hint:
5960 error hint:
5961
5962             QUERY PLAN            
5963 ----------------------------------
5964  Index Scan using ti1_hash on ti1
5965    Index Cond: (c1 = 1)
5966 (2 rows)
5967
5968 -- No. S-3-13-29
5969 /*+NoIndexOnlyScan(ti1 ti1_pkey)*/
5970 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
5971 INFO:  pg_hint_plan: hint syntax error at or near ""
5972 DETAIL:  NoIndexOnlyScan hint accepts only one relation.
5973 LOG:  pg_hint_plan:
5974 used hint:
5975 not used hint:
5976 duplication hint:
5977 error hint:
5978 NoIndexOnlyScan(ti1 ti1_pkey)
5979
5980             QUERY PLAN            
5981 ----------------------------------
5982  Index Scan using ti1_hash on ti1
5983    Index Cond: (c1 = 1)
5984 (2 rows)
5985
5986 -- No. S-3-13-30
5987 /*+NoIndexOnlyScan(ti1 ti1_pkey ti1_btree)*/
5988 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
5989 INFO:  pg_hint_plan: hint syntax error at or near ""
5990 DETAIL:  NoIndexOnlyScan hint accepts only one relation.
5991 LOG:  pg_hint_plan:
5992 used hint:
5993 not used hint:
5994 duplication hint:
5995 error hint:
5996 NoIndexOnlyScan(ti1 ti1_pkey ti1_btree)
5997
5998             QUERY PLAN            
5999 ----------------------------------
6000  Index Scan using ti1_hash on ti1
6001    Index Cond: (c1 = 1)
6002 (2 rows)
6003
6004 ----
6005 ---- No. S-3-14 regular expression
6006 ----
6007 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
6008            QUERY PLAN           
6009 --------------------------------
6010  Index Scan using ti1_i4 on ti1
6011    Index Cond: (c2 = 1)
6012 (2 rows)
6013
6014 -- No. S-3-14-1
6015 /*+IndexScanRegexp(ti1 ti1_.*_key)*/
6016 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
6017 LOG:  available indexes for IndexScanRegexp(ti1): ti1_c2_key
6018 LOG:  pg_hint_plan:
6019 used hint:
6020 IndexScanRegexp(ti1 ti1_.*_key)
6021 not used hint:
6022 duplication hint:
6023 error hint:
6024
6025              QUERY PLAN             
6026 ------------------------------------
6027  Index Scan using ti1_c2_key on ti1
6028    Index Cond: (c2 = 1)
6029 (2 rows)
6030
6031 -- No. S-3-14-2
6032 /*+IndexScanRegexp(ti1 ti1_i.)*/
6033 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
6034 LOG:  available indexes for IndexScanRegexp(ti1): ti1_i4 ti1_i3 ti1_i2 ti1_i1
6035 LOG:  pg_hint_plan:
6036 used hint:
6037 IndexScanRegexp(ti1 ti1_i.)
6038 not used hint:
6039 duplication hint:
6040 error hint:
6041
6042            QUERY PLAN           
6043 --------------------------------
6044  Index Scan using ti1_i4 on ti1
6045    Index Cond: (c2 = 1)
6046 (2 rows)
6047
6048 -- No. S-3-14-3
6049 /*+IndexScanRegexp(ti1 no.*_exist)*/
6050 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
6051 LOG:  available indexes for IndexScanRegexp(ti1):
6052 LOG:  pg_hint_plan:
6053 used hint:
6054 IndexScanRegexp(ti1 no.*_exist)
6055 not used hint:
6056 duplication hint:
6057 error hint:
6058
6059      QUERY PLAN     
6060 --------------------
6061  Seq Scan on ti1
6062    Filter: (c2 = 1)
6063 (2 rows)
6064
6065 -- No. S-3-14-4
6066 /*+IndexScanRegexp(p1 .*pkey)*/
6067 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
6068 LOG:  available indexes for IndexScanRegexp(p1): p1_pkey
6069 LOG:  available indexes for IndexScanRegexp(p1c1): p1c1_pkey
6070 LOG:  pg_hint_plan:
6071 used hint:
6072 IndexScanRegexp(p1 .*pkey)
6073 not used hint:
6074 duplication hint:
6075 error hint:
6076
6077                 QUERY PLAN                
6078 ------------------------------------------
6079  Append
6080    ->  Index Scan using p1_pkey on p1
6081          Index Cond: (c1 = 1)
6082    ->  Index Scan using p1c1_pkey on p1c1
6083          Index Cond: (c1 = 1)
6084 (5 rows)
6085
6086 -- No. S-3-14-5
6087 /*+IndexScanRegexp(p1 p1.*i)*/
6088 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
6089 LOG:  available indexes for IndexScanRegexp(p1): p1_i2 p1_i
6090 LOG:  available indexes for IndexScanRegexp(p1c1): p1c1_i p1c1_c4_expr_idx
6091 LOG:  pg_hint_plan:
6092 used hint:
6093 IndexScanRegexp(p1 p1.*i)
6094 not used hint:
6095 duplication hint:
6096 error hint:
6097
6098               QUERY PLAN               
6099 ---------------------------------------
6100  Append
6101    ->  Index Scan using p1_i on p1
6102          Index Cond: (c1 = 1)
6103    ->  Index Scan using p1c1_i on p1c1
6104          Index Cond: (c1 = 1)
6105 (5 rows)
6106
6107 -- No. S-3-14-6
6108 /*+IndexScanRegexp(p1 no.*_exist)*/
6109 EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
6110 LOG:  available indexes for IndexScanRegexp(p1):
6111 LOG:  available indexes for IndexScanRegexp(p1c1):
6112 LOG:  pg_hint_plan:
6113 used hint:
6114 IndexScanRegexp(p1 no.*_exist)
6115 not used hint:
6116 duplication hint:
6117 error hint:
6118
6119         QUERY PLAN        
6120 --------------------------
6121  Append
6122    ->  Seq Scan on p1
6123          Filter: (c1 = 1)
6124    ->  Seq Scan on p1c1
6125          Filter: (c1 = 1)
6126 (5 rows)
6127
6128 ----
6129 ---- No. S-3-15 message output of index candidate
6130 ----
6131 -- No. S-3-15-1
6132 /*+IndexScan(ti1 ti1_i1)*/
6133 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
6134 LOG:  available indexes for IndexScan(ti1): ti1_i1
6135 LOG:  pg_hint_plan:
6136 used hint:
6137 IndexScan(ti1 ti1_i1)
6138 not used hint:
6139 duplication hint:
6140 error hint:
6141
6142            QUERY PLAN           
6143 --------------------------------
6144  Index Scan using ti1_i1 on ti1
6145    Index Cond: (c2 = 1)
6146 (2 rows)
6147
6148 -- No. S-3-15-2
6149 /*+IndexScan(ti1 not_exist)*/
6150 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
6151 LOG:  available indexes for IndexScan(ti1):
6152 LOG:  pg_hint_plan:
6153 used hint:
6154 IndexScan(ti1 not_exist)
6155 not used hint:
6156 duplication hint:
6157 error hint:
6158
6159      QUERY PLAN     
6160 --------------------
6161  Seq Scan on ti1
6162    Filter: (c2 = 1)
6163 (2 rows)
6164
6165 -- No. S-3-15-3
6166 /*+IndexScan(ti1 ti1_i1 ti1_i2)*/
6167 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
6168 LOG:  available indexes for IndexScan(ti1): ti1_i2 ti1_i1
6169 LOG:  pg_hint_plan:
6170 used hint:
6171 IndexScan(ti1 ti1_i1 ti1_i2)
6172 not used hint:
6173 duplication hint:
6174 error hint:
6175
6176            QUERY PLAN           
6177 --------------------------------
6178  Index Scan using ti1_i2 on ti1
6179    Index Cond: (c2 = 1)
6180 (2 rows)
6181
6182 -- No. S-3-15-4
6183 /*+IndexScan(ti1 ti1_i1 not_exist)*/
6184 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
6185 LOG:  available indexes for IndexScan(ti1): ti1_i1
6186 LOG:  pg_hint_plan:
6187 used hint:
6188 IndexScan(ti1 ti1_i1 not_exist)
6189 not used hint:
6190 duplication hint:
6191 error hint:
6192
6193            QUERY PLAN           
6194 --------------------------------
6195  Index Scan using ti1_i1 on ti1
6196    Index Cond: (c2 = 1)
6197 (2 rows)
6198
6199 -- No. S-3-15-5
6200 /*+IndexScan(ti1 not_exist1 not_exist2)*/
6201 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
6202 LOG:  available indexes for IndexScan(ti1):
6203 LOG:  pg_hint_plan:
6204 used hint:
6205 IndexScan(ti1 not_exist1 not_exist2)
6206 not used hint:
6207 duplication hint:
6208 error hint:
6209
6210      QUERY PLAN     
6211 --------------------
6212  Seq Scan on ti1
6213    Filter: (c2 = 1)
6214 (2 rows)
6215
6216 DELETE FROM pg_db_role_setting WHERE setrole = (SELECT oid FROM pg_roles WHERE rolname = current_user);
6217 ALTER SYSTEM SET session_preload_libraries TO DEFAULT;
6218 SELECT pg_reload_conf();
6219  pg_reload_conf 
6220 ----------------
6221  t
6222 (1 row)
6223
6224 \! rm results/ut-S.tmpout