OSDN Git Service

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