OSDN Git Service

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