OSDN Git Service

8月10日午後消化分の試験を追加した。
authorMitsuru Hasegawa <hasegawa@metrosystems.co.jp>
Fri, 10 Aug 2012 09:44:16 +0000 (18:44 +0900)
committerMitsuru Hasegawa <hasegawa@metrosystems.co.jp>
Fri, 10 Aug 2012 09:44:16 +0000 (18:44 +0900)
Makefile
expected/ut-J.out [new file with mode: 0644]
expected/ut-S.out
expected/ut_init.out
sql/ut-J.sql [new file with mode: 0644]
sql/ut-S.sql
sql/ut_init.sql

index 96ff6c8..7fcfebe 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,8 +5,8 @@
 #
 
 MODULES = pg_hint_plan
-REGRESS = init base_plan pg_hint_plan prepare fdw ut_init ut-A ut-S ut_fini
-#REGRESS = init ut_init ut-A ut_fini
+REGRESS = init base_plan pg_hint_plan prepare fdw ut_init ut-A ut-S ut-J ut_fini
+#REGRESS = init ut_init ut-J ut_fini
 
 EXTRA_CLEAN = sql/fdw.sql expected/base_plan.out expected/prepare.out expected/fdw.out
 
diff --git a/expected/ut-J.out b/expected/ut-J.out
new file mode 100644 (file)
index 0000000..4c6f405
--- /dev/null
@@ -0,0 +1,672 @@
+LOAD 'pg_hint_plan';
+SET pg_hint_plan.enable TO on;
+SET pg_hint_plan.debug_print TO on;
+SET client_min_messages TO LOG;
+SET search_path TO public;
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+              QUERY PLAN              
+--------------------------------------
+ Merge Join
+   Merge Cond: (t1.c1 = t2.c1)
+   ->  Index Scan using t1_pkey on t1
+   ->  Sort
+         Sort Key: t2.c1
+         ->  Seq Scan on t2
+(6 rows)
+
+----
+---- No. J-1-1 specified pattern of the object name
+----
+-- No. J-1-1-1
+/*+HashJoin(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+LOG:  pg_hint_plan:
+used hint:
+HashJoin(t1 t2)
+not used hint:
+duplication hint:
+error hint:
+
+          QUERY PLAN          
+------------------------------
+ Hash Join
+   Hash Cond: (t1.c1 = t2.c1)
+   ->  Seq Scan on t1
+   ->  Hash
+         ->  Seq Scan on t2
+(5 rows)
+
+-- No. J-1-1-2
+/*+HashJoin(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 t_1, s1.t2 t_2 WHERE t_1.c1 = t_2.c1;
+LOG:  pg_hint_plan:
+used hint:
+not used hint:
+HashJoin(t1 t2)
+duplication hint:
+error hint:
+
+                QUERY PLAN                
+------------------------------------------
+ Merge Join
+   Merge Cond: (t_1.c1 = t_2.c1)
+   ->  Index Scan using t1_pkey on t1 t_1
+   ->  Sort
+         Sort Key: t_2.c1
+         ->  Seq Scan on t2 t_2
+(6 rows)
+
+-- No. J-1-1-3
+/*+HashJoin(t_1 t_2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 t_1, s1.t2 t_2 WHERE t_1.c1 = t_2.c1;
+LOG:  pg_hint_plan:
+used hint:
+HashJoin(t_1 t_2)
+not used hint:
+duplication hint:
+error hint:
+
+           QUERY PLAN           
+--------------------------------
+ Hash Join
+   Hash Cond: (t_1.c1 = t_2.c1)
+   ->  Seq Scan on t1 t_1
+   ->  Hash
+         ->  Seq Scan on t2 t_2
+(5 rows)
+
+----
+---- No. J-1-2 specified schema name in the hint option
+----
+-- No. J-1-2-1
+/*+HashJoin(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+LOG:  pg_hint_plan:
+used hint:
+HashJoin(t1 t2)
+not used hint:
+duplication hint:
+error hint:
+
+          QUERY PLAN          
+------------------------------
+ Hash Join
+   Hash Cond: (t1.c1 = t2.c1)
+   ->  Seq Scan on t1
+   ->  Hash
+         ->  Seq Scan on t2
+(5 rows)
+
+-- No. J-1-2-2
+/*+HashJoin(s1.t1 s1.t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+LOG:  pg_hint_plan:
+used hint:
+not used hint:
+HashJoin(s1.t1 s1.t2)
+duplication hint:
+error hint:
+
+              QUERY PLAN              
+--------------------------------------
+ Merge Join
+   Merge Cond: (t1.c1 = t2.c1)
+   ->  Index Scan using t1_pkey on t1
+   ->  Sort
+         Sort Key: t2.c1
+         ->  Seq Scan on t2
+(6 rows)
+
+----
+---- No. J-1-3 table doesn't exist in the hint option
+----
+-- No. J-1-3-1
+/*+HashJoin(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+LOG:  pg_hint_plan:
+used hint:
+HashJoin(t1 t2)
+not used hint:
+duplication hint:
+error hint:
+
+          QUERY PLAN          
+------------------------------
+ Hash Join
+   Hash Cond: (t1.c1 = t2.c1)
+   ->  Seq Scan on t1
+   ->  Hash
+         ->  Seq Scan on t2
+(5 rows)
+
+-- No. J-1-3-1
+/*+HashJoin(t3 t4)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+LOG:  pg_hint_plan:
+used hint:
+not used hint:
+HashJoin(t3 t4)
+duplication hint:
+error hint:
+
+              QUERY PLAN              
+--------------------------------------
+ Merge Join
+   Merge Cond: (t1.c1 = t2.c1)
+   ->  Index Scan using t1_pkey on t1
+   ->  Sort
+         Sort Key: t2.c1
+         ->  Seq Scan on t2
+(6 rows)
+
+----
+---- No. J-1-4 conflict table name
+----
+-- No. J-1-4-1
+/*+HashJoin(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+LOG:  pg_hint_plan:
+used hint:
+HashJoin(t1 t2)
+not used hint:
+duplication hint:
+error hint:
+
+          QUERY PLAN          
+------------------------------
+ Hash Join
+   Hash Cond: (t1.c1 = t2.c1)
+   ->  Seq Scan on t1
+   ->  Hash
+         ->  Seq Scan on t2
+(5 rows)
+
+-- No. J-1-4-2
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = s2.t1.c1;
+              QUERY PLAN              
+--------------------------------------
+ Merge Join
+   Merge Cond: (s1.t1.c1 = s2.t1.c1)
+   ->  Index Scan using t1_pkey on t1
+   ->  Sort
+         Sort Key: s2.t1.c1
+         ->  Seq Scan on t1
+(6 rows)
+
+/*+HashJoin(s1.t1 s2.t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = s2.t1.c1;
+LOG:  pg_hint_plan:
+used hint:
+not used hint:
+HashJoin(s1.t1 s2.t1)
+duplication hint:
+error hint:
+
+              QUERY PLAN              
+--------------------------------------
+ Merge Join
+   Merge Cond: (s1.t1.c1 = s2.t1.c1)
+   ->  Index Scan using t1_pkey on t1
+   ->  Sort
+         Sort Key: s2.t1.c1
+         ->  Seq Scan on t1
+(6 rows)
+
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = s2t1.c1;
+              QUERY PLAN              
+--------------------------------------
+ Merge Join
+   Merge Cond: (t1.c1 = s2t1.c1)
+   ->  Index Scan using t1_pkey on t1
+   ->  Sort
+         Sort Key: s2t1.c1
+         ->  Seq Scan on t1 s2t1
+(6 rows)
+
+/*+HashJoin(t1 s2t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = s2t1.c1;
+LOG:  pg_hint_plan:
+used hint:
+HashJoin(s2t1 t1)
+not used hint:
+duplication hint:
+error hint:
+
+           QUERY PLAN            
+---------------------------------
+ Hash Join
+   Hash Cond: (t1.c1 = s2t1.c1)
+   ->  Seq Scan on t1
+   ->  Hash
+         ->  Seq Scan on t1 s2t1
+(5 rows)
+
+-- No. J-1-4-3
+EXPLAIN (COSTS false) SELECT *, (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+                     QUERY PLAN                     
+----------------------------------------------------
+ Merge Join
+   Merge Cond: (s1.t1.c1 = s1.t2.c1)
+   InitPlan 1 (returns $0)
+     ->  Aggregate
+           ->  Merge Join
+                 Merge Cond: (s1.t1.c1 = s1.t2.c1)
+                 ->  Index Scan using t1_pkey on t1
+                 ->  Sort
+                       Sort Key: s1.t2.c1
+                       ->  Seq Scan on t2
+   ->  Index Scan using t1_pkey on t1
+   ->  Sort
+         Sort Key: s1.t2.c1
+         ->  Seq Scan on t2
+(14 rows)
+
+/*+HashJoin(t1 t2)*/
+EXPLAIN (COSTS false) SELECT *, (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+LOG:  pg_hint_plan:
+used hint:
+HashJoin(t1 t2)
+not used hint:
+duplication hint:
+error hint:
+
+                    QUERY PLAN                    
+--------------------------------------------------
+ Hash Join
+   Hash Cond: (s1.t1.c1 = s1.t2.c1)
+   InitPlan 1 (returns $0)
+     ->  Aggregate
+           ->  Hash Join
+                 Hash Cond: (s1.t1.c1 = s1.t2.c1)
+                 ->  Seq Scan on t1
+                 ->  Hash
+                       ->  Seq Scan on t2
+   ->  Seq Scan on t1
+   ->  Hash
+         ->  Seq Scan on t2
+(12 rows)
+
+/*+NestLoop(st1 st2)HashJoin(t1 t2)*/
+EXPLAIN (COSTS false) SELECT *, (SELECT max(st1.c1) FROM s1.t1 st1, s1.t2 st2 WHERE st1.c1 = st2.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+LOG:  pg_hint_plan:
+used hint:
+NestLoop(st1 st2)
+HashJoin(t1 t2)
+not used hint:
+duplication hint:
+error hint:
+
+                       QUERY PLAN                       
+--------------------------------------------------------
+ Hash Join
+   Hash Cond: (t1.c1 = t2.c1)
+   InitPlan 1 (returns $1)
+     ->  Aggregate
+           ->  Nested Loop
+                 ->  Seq Scan on t2 st2
+                 ->  Index Scan using t1_pkey on t1 st1
+                       Index Cond: (c1 = st2.c1)
+   ->  Seq Scan on t1
+   ->  Hash
+         ->  Seq Scan on t2
+(11 rows)
+
+----
+---- No. J-1-5 conflict table name
+----
+-- No. J-1-5-1
+-- TODO
+----
+---- No. J-1-6 object type for the hint
+----
+-- No. J-1-6-1
+/*+HashJoin(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+LOG:  pg_hint_plan:
+used hint:
+HashJoin(t1 t2)
+not used hint:
+duplication hint:
+error hint:
+
+          QUERY PLAN          
+------------------------------
+ Hash Join
+   Hash Cond: (t1.c1 = t2.c1)
+   ->  Seq Scan on t1
+   ->  Hash
+         ->  Seq Scan on t2
+(5 rows)
+
+-- No. J-1-6-2
+EXPLAIN (COSTS false) SELECT * FROM s1.p1 t1, s1.p1 t2 WHERE t1.c1 = t2.c1;
+              QUERY PLAN               
+---------------------------------------
+ Hash Join
+   Hash Cond: (t1.c1 = t2.c1)
+   ->  Append
+         ->  Seq Scan on p1 t1
+         ->  Seq Scan on p1c1 t1
+         ->  Seq Scan on p1c2 t1
+         ->  Seq Scan on p1c3 t1
+   ->  Hash
+         ->  Append
+               ->  Seq Scan on p1 t2
+               ->  Seq Scan on p1c1 t2
+               ->  Seq Scan on p1c2 t2
+               ->  Seq Scan on p1c3 t2
+(13 rows)
+
+/*+NestLoop(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.p1 t1, s1.p1 t2 WHERE t1.c1 = t2.c1;
+LOG:  pg_hint_plan:
+used hint:
+NestLoop(t1 t2)
+not used hint:
+duplication hint:
+error hint:
+
+                        QUERY PLAN                         
+-----------------------------------------------------------
+ Nested Loop
+   Join Filter: (t1.c1 = t2.c1)
+   ->  Append
+         ->  Seq Scan on p1 t1
+         ->  Seq Scan on p1c1 t1
+         ->  Seq Scan on p1c2 t1
+         ->  Seq Scan on p1c3 t1
+   ->  Append
+         ->  Index Scan using p1_pkey on p1 t2
+               Index Cond: ((c1 = t1.c1) AND (c1 = t1.c1))
+         ->  Index Scan using p1c1_i on p1c1 t2
+               Index Cond: ((c1 = t1.c1) AND (c1 = t1.c1))
+         ->  Index Scan using p1c2_i on p1c2 t2
+               Index Cond: ((c1 = t1.c1) AND (c1 = t1.c1))
+         ->  Index Scan using p1c3_i on p1c3 t2
+               Index Cond: ((c1 = t1.c1) AND (c1 = t1.c1))
+(16 rows)
+
+-- No. J-1-6-3
+EXPLAIN (COSTS false) SELECT * FROM s1.ul1 t1, s1.ul1 t2 WHERE t1.c1 = t2.c1;
+           QUERY PLAN           
+--------------------------------
+ Hash Join
+   Hash Cond: (t1.c1 = t2.c1)
+   ->  Seq Scan on ul1 t1
+   ->  Hash
+         ->  Seq Scan on ul1 t2
+(5 rows)
+
+/*+NestLoop(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ul1 t1, s1.ul1 t2 WHERE t1.c1 = t2.c1;
+LOG:  pg_hint_plan:
+used hint:
+NestLoop(t1 t2)
+not used hint:
+duplication hint:
+error hint:
+
+                QUERY PLAN                 
+-------------------------------------------
+ Nested Loop
+   ->  Seq Scan on ul1 t1
+   ->  Index Scan using ul1_pkey on ul1 t2
+         Index Cond: (c1 = t1.c1)
+(4 rows)
+
+-- No. J-1-6-4
+CREATE TEMP TABLE tm1 (LIKE s1.t1 INCLUDING ALL);
+NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "tm1_pkey" for table "tm1"
+EXPLAIN (COSTS false) SELECT * FROM tm1 t1, tm1 t2 WHERE t1.c1 = t2.c1;
+           QUERY PLAN           
+--------------------------------
+ Hash Join
+   Hash Cond: (t1.c1 = t2.c1)
+   ->  Seq Scan on tm1 t1
+   ->  Hash
+         ->  Seq Scan on tm1 t2
+(5 rows)
+
+/*+NestLoop(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM tm1 t1, tm1 t2 WHERE t1.c1 = t2.c1;
+LOG:  pg_hint_plan:
+used hint:
+NestLoop(t1 t2)
+not used hint:
+duplication hint:
+error hint:
+
+                QUERY PLAN                 
+-------------------------------------------
+ Nested Loop
+   ->  Seq Scan on tm1 t1
+   ->  Index Scan using tm1_pkey on tm1 t2
+         Index Cond: (c1 = t1.c1)
+(4 rows)
+
+-- No. J-1-6-5
+EXPLAIN (COSTS false) SELECT * FROM pg_catalog.pg_class t1, pg_catalog.pg_class t2 WHERE t1.oid = t2.oid;
+             QUERY PLAN              
+-------------------------------------
+ Hash Join
+   Hash Cond: (t1.oid = t2.oid)
+   ->  Seq Scan on pg_class t1
+   ->  Hash
+         ->  Seq Scan on pg_class t2
+(5 rows)
+
+/*+NestLoop(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM pg_catalog.pg_class t1, pg_catalog.pg_class t2 WHERE t1.oid = t2.oid;
+LOG:  pg_hint_plan:
+used hint:
+NestLoop(t1 t2)
+not used hint:
+duplication hint:
+error hint:
+
+                        QUERY PLAN                        
+----------------------------------------------------------
+ Nested Loop
+   ->  Seq Scan on pg_class t1
+   ->  Index Scan using pg_class_oid_index on pg_class t2
+         Index Cond: (oid = t1.oid)
+(4 rows)
+
+-- No. J-1-6-6
+-- refer fdw.sql
+-- No. J-1-6-7
+EXPLAIN (COSTS false) SELECT * FROM s1.f1() t1, s1.f1() t2 WHERE t1.c1 = t2.c1;
+           QUERY PLAN           
+--------------------------------
+ Nested Loop
+   Join Filter: (t1.c1 = t2.c1)
+   ->  Function Scan on f1 t1
+   ->  Function Scan on f1 t2
+(4 rows)
+
+/*+HashJoin(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.f1() t1, s1.f1() t2 WHERE t1.c1 = t2.c1;
+LOG:  pg_hint_plan:
+used hint:
+HashJoin(t1 t2)
+not used hint:
+duplication hint:
+error hint:
+
+             QUERY PLAN             
+------------------------------------
+ Hash Join
+   Hash Cond: (t1.c1 = t2.c1)
+   ->  Function Scan on f1 t1
+   ->  Hash
+         ->  Function Scan on f1 t2
+(5 rows)
+
+-- No. J-1-6-8
+EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t1 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t2 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1;
+                       QUERY PLAN                       
+--------------------------------------------------------
+ Hash Join
+   Hash Cond: ("*VALUES*".column1 = "*VALUES*".column1)
+   ->  Values Scan on "*VALUES*"
+   ->  Hash
+         ->  Values Scan on "*VALUES*"
+(5 rows)
+
+/*+NestLoop(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t1 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t2 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1;
+LOG:  pg_hint_plan:
+used hint:
+not used hint:
+NestLoop(t1 t2)
+duplication hint:
+error hint:
+
+                       QUERY PLAN                       
+--------------------------------------------------------
+ Hash Join
+   Hash Cond: ("*VALUES*".column1 = "*VALUES*".column1)
+   ->  Values Scan on "*VALUES*"
+   ->  Hash
+         ->  Values Scan on "*VALUES*"
+(5 rows)
+
+/*+NestLoop(*VALUES* *VALUES*)*/
+EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t1 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t2 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1;
+INFO:  hint syntax error at or near "NestLoop(*VALUES* *VALUES*)"
+DETAIL:  Relation name "*VALUES*" is ambiguous.
+ERROR:  negative bitmapset member not allowed
+-- No. J-1-6-9
+EXPLAIN (COSTS false) WITH c1(c1) AS (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1) SELECT * FROM s1.t1, c1 WHERE t1.c1 = c1.c1;
+                     QUERY PLAN                     
+----------------------------------------------------
+ Nested Loop
+   CTE c1
+     ->  Aggregate
+           ->  Merge Join
+                 Merge Cond: (s1.t1.c1 = t2.c1)
+                 ->  Index Scan using t1_pkey on t1
+                 ->  Sort
+                       Sort Key: t2.c1
+                       ->  Seq Scan on t2
+   ->  CTE Scan on c1
+   ->  Index Scan using t1_pkey on t1
+         Index Cond: (c1 = c1.c1)
+(12 rows)
+
+/*+NestLoop(t1 t2)HashJoin(t1 c1)*/
+EXPLAIN (COSTS false) WITH c1(c1) AS (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1) SELECT * FROM s1.t1, c1 WHERE t1.c1 = c1.c1;
+LOG:  pg_hint_plan:
+used hint:
+HashJoin(c1 t1)
+NestLoop(t1 t2)
+not used hint:
+duplication hint:
+error hint:
+
+                     QUERY PLAN                     
+----------------------------------------------------
+ Hash Join
+   Hash Cond: (s1.t1.c1 = c1.c1)
+   CTE c1
+     ->  Aggregate
+           ->  Nested Loop
+                 ->  Seq Scan on t2
+                 ->  Index Scan using t1_pkey on t1
+                       Index Cond: (c1 = t2.c1)
+   ->  Seq Scan on t1
+   ->  Hash
+         ->  CTE Scan on c1
+(11 rows)
+
+-- No. J-1-6-10
+EXPLAIN (COSTS false) SELECT * FROM s1.v1 t1, s1.v1 t2 WHERE t1.c1 = t2.c1;
+            QUERY PLAN            
+----------------------------------
+ Hash Join
+   Hash Cond: (v1t1.c1 = v1t1.c1)
+   ->  Seq Scan on t1 v1t1
+   ->  Hash
+         ->  Seq Scan on t1 v1t1
+(5 rows)
+
+/*+NestLoop(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.v1 t1, s1.v1 t2 WHERE t1.c1 = t2.c1;
+LOG:  pg_hint_plan:
+used hint:
+not used hint:
+NestLoop(t1 t2)
+duplication hint:
+error hint:
+
+            QUERY PLAN            
+----------------------------------
+ Hash Join
+   Hash Cond: (v1t1.c1 = v1t1.c1)
+   ->  Seq Scan on t1 v1t1
+   ->  Hash
+         ->  Seq Scan on t1 v1t1
+(5 rows)
+
+/*+NestLoop(v1t1 v1t1_)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.v1 t1, s1.v1_ t2 WHERE t1.c1 = t2.c1;
+LOG:  pg_hint_plan:
+used hint:
+NestLoop(v1t1 v1t1_)
+not used hint:
+duplication hint:
+error hint:
+
+                 QUERY PLAN                 
+--------------------------------------------
+ Nested Loop
+   ->  Seq Scan on t1 v1t1
+   ->  Index Scan using t1_pkey on t1 v1t1_
+         Index Cond: (c1 = v1t1.c1)
+(4 rows)
+
+-- No. J-1-6-11
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.c1 = (SELECT max(st1.c1) FROM s1.t1 st1, s1.t2 st2 WHERE st1.c1 = st2.c1);
+                       QUERY PLAN                       
+--------------------------------------------------------
+ Nested Loop
+   InitPlan 1 (returns $0)
+     ->  Aggregate
+           ->  Merge Join
+                 Merge Cond: (st1.c1 = st2.c1)
+                 ->  Index Scan using t1_pkey on t1 st1
+                 ->  Sort
+                       Sort Key: st2.c1
+                       ->  Seq Scan on t2 st2
+   ->  Index Scan using t1_pkey on t1
+         Index Cond: (c1 = $0)
+   ->  Seq Scan on t2
+         Filter: (c1 = $0)
+(13 rows)
+
+/*+MergeJoin(t1 t2)NestLoop(st1 st2)*/
+EXPLAIN (COSTS true) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.c1 = (SELECT max(st1.c1) FROM s1.t1 st1, s1.t2 st2 WHERE st1.c1 = st2.c1);
+LOG:  pg_hint_plan:
+used hint:
+NestLoop(st1 st2)
+MergeJoin(t1 t2)
+not used hint:
+duplication hint:
+error hint:
+
+                                        QUERY PLAN                                        
+------------------------------------------------------------------------------------------
+ Nested Loop  (cost=10000000074.28..10000000084.81 rows=1 width=29)
+   InitPlan 1 (returns $1)
+     ->  Aggregate  (cost=74.27..74.28 rows=1 width=4)
+           ->  Nested Loop  (cost=0.00..74.02 rows=100 width=4)
+                 ->  Seq Scan on t2 st2  (cost=0.00..2.00 rows=100 width=4)
+                 ->  Index Scan using t1_pkey on t1 st1  (cost=0.00..0.71 rows=1 width=4)
+                       Index Cond: (c1 = st2.c1)
+   ->  Index Scan using t1_pkey on t1  (cost=0.00..8.27 rows=1 width=15)
+         Index Cond: (c1 = $1)
+   ->  Seq Scan on t2  (cost=0.00..2.25 rows=1 width=14)
+         Filter: (c1 = $1)
+(11 rows)
+
+\q
index 398783b..fd24301 100644 (file)
@@ -198,41 +198,47 @@ EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = 1 AND s1.t1.c1
          Filter: (c1 = 1)
 (5 rows)
 
-/*+IndexScan(t1)*/
+/*+BitmapScan(t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = 1 AND s1.t1.c1 = s2.t1.c1;
 LOG:  pg_hint_plan:
 used hint:
-IndexScan(t1)
+BitmapScan(t1)
 not used hint:
 duplication hint:
 error hint:
 
-              QUERY PLAN              
---------------------------------------
+                QUERY PLAN                
+------------------------------------------
  Nested Loop
-   ->  Index Scan using t1_pkey on t1
-         Index Cond: (c1 = 1)
-   ->  Index Scan using t1_pkey on t1
-         Index Cond: (c1 = 1)
-(5 rows)
+   ->  Bitmap Heap Scan on t1
+         Recheck Cond: (c1 = 1)
+         ->  Bitmap Index Scan on t1_pkey
+               Index Cond: (c1 = 1)
+   ->  Bitmap Heap Scan on t1
+         Recheck Cond: (c1 = 1)
+         ->  Bitmap Index Scan on t1_pkey
+               Index Cond: (c1 = 1)
+(9 rows)
 
-/*+SeqScan(t1)*/
+/*+BitmapScan(t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = 1 AND s1.t1.c1 = s2t1.c1;
 LOG:  pg_hint_plan:
 used hint:
-SeqScan(t1)
+BitmapScan(t1)
 not used hint:
 duplication hint:
 error hint:
 
-        QUERY PLAN         
----------------------------
+                QUERY PLAN                
+------------------------------------------
  Nested Loop
-   ->  Seq Scan on t1
-         Filter: (c1 = 1)
+   ->  Bitmap Heap Scan on t1
+         Recheck Cond: (c1 = 1)
+         ->  Bitmap Index Scan on t1_pkey
+               Index Cond: (c1 = 1)
    ->  Seq Scan on t1 s2t1
          Filter: (c1 = 1)
-(5 rows)
+(7 rows)
 
 /*+BitmapScan(s2t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = 1 AND s1.t1.c1 = s2t1.c1;
@@ -268,68 +274,76 @@ EXPLAIN (COSTS false) SELECT (SELECT max(c1) FROM s1.t1 WHERE s1.t1.c1 = 1) FROM
                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
 (8 rows)
 
-/*+SeqScan(t1)*/
+/*+BitmapScan(t1)*/
 EXPLAIN (COSTS false) SELECT (SELECT max(c1) FROM s1.t1 WHERE s1.t1.c1 = 1) FROM s1.t1 WHERE s1.t1.c1 = 1;
 LOG:  pg_hint_plan:
 used hint:
-SeqScan(t1)
+BitmapScan(t1)
 not used hint:
 duplication hint:
 error hint:
 
-                           QUERY PLAN                            
------------------------------------------------------------------
Seq Scan on t1
-   Filter: (c1 = 1)
+                                QUERY PLAN                                 
+---------------------------------------------------------------------------
Bitmap Heap Scan on t1
+   Recheck Cond: (c1 = 1)
    InitPlan 2 (returns $1)
      ->  Result
            InitPlan 1 (returns $0)
              ->  Limit
-                   ->  Seq Scan on t1
-                         Filter: ((c1 IS NOT NULL) AND (c1 = 1))
-(8 rows)
+                   ->  Bitmap Heap Scan on t1
+                         Recheck Cond: ((c1 IS NOT NULL) AND (c1 = 1))
+                         ->  Bitmap Index Scan on t1_pkey
+                               Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
+   ->  Bitmap Index Scan on t1_pkey
+         Index Cond: (c1 = 1)
+(12 rows)
 
-/*+SeqScan(t11)*/
+/*+BitmapScan(t11)*/
 EXPLAIN (COSTS false) SELECT (SELECT max(c1) FROM s1.t1 t11 WHERE t11.c1 = 1) FROM s1.t1 t12 WHERE t12.c1 = 1;
 LOG:  pg_hint_plan:
 used hint:
-SeqScan(t11)
+BitmapScan(t11)
 not used hint:
 duplication hint:
 error hint:
 
-                           QUERY PLAN                            
------------------------------------------------------------------
+                                QUERY PLAN                                 
+---------------------------------------------------------------------------
  Index Scan using t1_pkey on t1 t12
    Index Cond: (c1 = 1)
    InitPlan 2 (returns $1)
      ->  Result
            InitPlan 1 (returns $0)
              ->  Limit
-                   ->  Seq Scan on t1 t11
-                         Filter: ((c1 IS NOT NULL) AND (c1 = 1))
-(8 rows)
+                   ->  Bitmap Heap Scan on t1 t11
+                         Recheck Cond: ((c1 IS NOT NULL) AND (c1 = 1))
+                         ->  Bitmap Index Scan on t1_pkey
+                               Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
+(10 rows)
 
-/*+SeqScan(t12)*/
+/*+BitmapScan(t12)*/
 EXPLAIN (COSTS false) SELECT (SELECT max(c1) FROM s1.t1 t11 WHERE t11.c1 = 1) FROM s1.t1 t12 WHERE t12.c1 = 1;
 LOG:  pg_hint_plan:
 used hint:
-SeqScan(t12)
+BitmapScan(t12)
 not used hint:
 duplication hint:
 error hint:
 
                              QUERY PLAN                              
 ---------------------------------------------------------------------
Seq Scan on t1 t12
-   Filter: (c1 = 1)
Bitmap Heap Scan on t1 t12
+   Recheck Cond: (c1 = 1)
    InitPlan 2 (returns $1)
      ->  Result
            InitPlan 1 (returns $0)
              ->  Limit
                    ->  Index Scan using t1_pkey on t1 t11
                          Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
-(8 rows)
+   ->  Bitmap Index Scan on t1_pkey
+         Index Cond: (c1 = 1)
+(10 rows)
 
 ----
 ---- No. S-1-5 object type for the hint
@@ -2230,3 +2244,456 @@ error hint:
                Filter: (c1 = 1)
 (8 rows)
 
+----
+---- No. S-3-12 specified same table
+----
+-- No. S-3-12-1
+/*+IndexScan(ti1) BitmapScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+INFO:  hint syntax error at or near "IndexScan(ti1) BitmapScan(ti1)"
+DETAIL:  Conflict scan method hint.
+LOG:  pg_hint_plan:
+used hint:
+BitmapScan(ti1)
+not used hint:
+duplication hint:
+IndexScan(ti1)
+error hint:
+
+             QUERY PLAN              
+-------------------------------------
+ Bitmap Heap Scan on ti1
+   Recheck Cond: (c1 = 1)
+   Filter: (ctid = '(1,1)'::tid)
+   ->  Bitmap Index Scan on ti1_uniq
+         Index Cond: (c1 = 1)
+(5 rows)
+
+-- No. S-3-12-2
+/*+IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+INFO:  hint syntax error at or near "IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
+DETAIL:  Conflict scan method hint.
+LOG:  pg_hint_plan:
+used hint:
+BitmapScan(ti1 ti1_btree)
+not used hint:
+duplication hint:
+IndexScan(ti1 ti1_pkey)
+error hint:
+
+              QUERY PLAN              
+--------------------------------------
+ Bitmap Heap Scan on ti1
+   Recheck Cond: (c1 = 1)
+   Filter: (ctid = '(1,1)'::tid)
+   ->  Bitmap Index Scan on ti1_btree
+         Index Cond: (c1 = 1)
+(5 rows)
+
+-- No. S-3-12-3
+/*+BitmapScan(ti1) IndexScan(ti1) BitmapScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+INFO:  hint syntax error at or near "BitmapScan(ti1) IndexScan(ti1) BitmapScan(ti1)"
+DETAIL:  Conflict scan method hint.
+INFO:  hint syntax error at or near "IndexScan(ti1) BitmapScan(ti1)"
+DETAIL:  Conflict scan method hint.
+LOG:  pg_hint_plan:
+used hint:
+BitmapScan(ti1)
+not used hint:
+duplication hint:
+BitmapScan(ti1)
+IndexScan(ti1)
+error hint:
+
+             QUERY PLAN              
+-------------------------------------
+ Bitmap Heap Scan on ti1
+   Recheck Cond: (c1 = 1)
+   Filter: (ctid = '(1,1)'::tid)
+   ->  Bitmap Index Scan on ti1_uniq
+         Index Cond: (c1 = 1)
+(5 rows)
+
+-- No. S-3-12-4
+/*+BitmapScan(ti1 ti1_hash) IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+INFO:  hint syntax error at or near "BitmapScan(ti1 ti1_hash) IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
+DETAIL:  Conflict scan method hint.
+INFO:  hint syntax error at or near "IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
+DETAIL:  Conflict scan method hint.
+LOG:  pg_hint_plan:
+used hint:
+BitmapScan(ti1 ti1_btree)
+not used hint:
+duplication hint:
+BitmapScan(ti1 ti1_hash)
+IndexScan(ti1 ti1_pkey)
+error hint:
+
+              QUERY PLAN              
+--------------------------------------
+ Bitmap Heap Scan on ti1
+   Recheck Cond: (c1 = 1)
+   Filter: (ctid = '(1,1)'::tid)
+   ->  Bitmap Index Scan on ti1_btree
+         Index Cond: (c1 = 1)
+(5 rows)
+
+----
+---- No. S-3-13 message output
+----
+-- No. S-3-13-1
+/*+SeqScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+LOG:  pg_hint_plan:
+used hint:
+SeqScan(ti1)
+not used hint:
+duplication hint:
+error hint:
+
+                   QUERY PLAN                   
+------------------------------------------------
+ Seq Scan on ti1
+   Filter: ((c1 = 1) AND (ctid = '(1,1)'::tid))
+(2 rows)
+
+-- No. S-3-13-2
+/*+SeqScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+INFO:  hint syntax error at or near "ti1_pkey)"
+DETAIL:  Closed parenthesis is necessary.
+            QUERY PLAN             
+-----------------------------------
+ Tid Scan on ti1
+   TID Cond: (ctid = '(1,1)'::tid)
+   Filter: (c1 = 1)
+(3 rows)
+
+-- No. S-3-13-3
+/*+SeqScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+INFO:  hint syntax error at or near "ti1_pkey ti1_btree)"
+DETAIL:  Closed parenthesis is necessary.
+            QUERY PLAN             
+-----------------------------------
+ Tid Scan on ti1
+   TID Cond: (ctid = '(1,1)'::tid)
+   Filter: (c1 = 1)
+(3 rows)
+
+-- No. S-3-13-4
+/*+IndexScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(ti1)
+not used hint:
+duplication hint:
+error hint:
+
+            QUERY PLAN            
+----------------------------------
+ Index Scan using ti1_uniq on ti1
+   Index Cond: (c1 = 1)
+   Filter: (ctid = '(1,1)'::tid)
+(3 rows)
+
+-- No. S-3-13-5
+/*+IndexScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(ti1 ti1_pkey)
+not used hint:
+duplication hint:
+error hint:
+
+            QUERY PLAN            
+----------------------------------
+ Index Scan using ti1_pkey on ti1
+   Index Cond: (c1 = 1)
+   Filter: (ctid = '(1,1)'::tid)
+(3 rows)
+
+-- No. S-3-13-6
+/*+IndexScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(ti1 ti1_pkey ti1_btree)
+not used hint:
+duplication hint:
+error hint:
+
+            QUERY PLAN             
+-----------------------------------
+ Index Scan using ti1_btree on ti1
+   Index Cond: (c1 = 1)
+   Filter: (ctid = '(1,1)'::tid)
+(3 rows)
+
+-- No. S-3-13-7
+/*+BitmapScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+LOG:  pg_hint_plan:
+used hint:
+BitmapScan(ti1)
+not used hint:
+duplication hint:
+error hint:
+
+             QUERY PLAN              
+-------------------------------------
+ Bitmap Heap Scan on ti1
+   Recheck Cond: (c1 = 1)
+   Filter: (ctid = '(1,1)'::tid)
+   ->  Bitmap Index Scan on ti1_uniq
+         Index Cond: (c1 = 1)
+(5 rows)
+
+-- No. S-3-13-8
+/*+BitmapScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+LOG:  pg_hint_plan:
+used hint:
+BitmapScan(ti1 ti1_pkey)
+not used hint:
+duplication hint:
+error hint:
+
+             QUERY PLAN              
+-------------------------------------
+ Bitmap Heap Scan on ti1
+   Recheck Cond: (c1 = 1)
+   Filter: (ctid = '(1,1)'::tid)
+   ->  Bitmap Index Scan on ti1_pkey
+         Index Cond: (c1 = 1)
+(5 rows)
+
+-- No. S-3-13-9
+/*+BitmapScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+LOG:  pg_hint_plan:
+used hint:
+BitmapScan(ti1 ti1_pkey ti1_btree)
+not used hint:
+duplication hint:
+error hint:
+
+              QUERY PLAN              
+--------------------------------------
+ Bitmap Heap Scan on ti1
+   Recheck Cond: (c1 = 1)
+   Filter: (ctid = '(1,1)'::tid)
+   ->  Bitmap Index Scan on ti1_btree
+         Index Cond: (c1 = 1)
+(5 rows)
+
+-- No. S-3-13-10
+/*+TidScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+LOG:  pg_hint_plan:
+used hint:
+TidScan(ti1)
+not used hint:
+duplication hint:
+error hint:
+
+            QUERY PLAN             
+-----------------------------------
+ Tid Scan on ti1
+   TID Cond: (ctid = '(1,1)'::tid)
+   Filter: (c1 = 1)
+(3 rows)
+
+-- No. S-3-13-11
+/*+TidScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+INFO:  hint syntax error at or near "ti1_pkey)"
+DETAIL:  Closed parenthesis is necessary.
+            QUERY PLAN             
+-----------------------------------
+ Tid Scan on ti1
+   TID Cond: (ctid = '(1,1)'::tid)
+   Filter: (c1 = 1)
+(3 rows)
+
+-- No. S-3-13-12
+/*+TidScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+INFO:  hint syntax error at or near "ti1_pkey ti1_btree)"
+DETAIL:  Closed parenthesis is necessary.
+            QUERY PLAN             
+-----------------------------------
+ Tid Scan on ti1
+   TID Cond: (ctid = '(1,1)'::tid)
+   Filter: (c1 = 1)
+(3 rows)
+
+-- No. S-3-13-13
+/*+NoSeqScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+LOG:  pg_hint_plan:
+used hint:
+NoSeqScan(ti1)
+not used hint:
+duplication hint:
+error hint:
+
+            QUERY PLAN             
+-----------------------------------
+ Tid Scan on ti1
+   TID Cond: (ctid = '(1,1)'::tid)
+   Filter: (c1 = 1)
+(3 rows)
+
+-- No. S-3-13-14
+/*+NoSeqScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+INFO:  hint syntax error at or near "ti1_pkey)"
+DETAIL:  Closed parenthesis is necessary.
+            QUERY PLAN             
+-----------------------------------
+ Tid Scan on ti1
+   TID Cond: (ctid = '(1,1)'::tid)
+   Filter: (c1 = 1)
+(3 rows)
+
+-- No. S-3-13-15
+/*+NoSeqScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+INFO:  hint syntax error at or near "ti1_pkey ti1_btree)"
+DETAIL:  Closed parenthesis is necessary.
+            QUERY PLAN             
+-----------------------------------
+ Tid Scan on ti1
+   TID Cond: (ctid = '(1,1)'::tid)
+   Filter: (c1 = 1)
+(3 rows)
+
+-- No. S-3-13-16
+/*+NoIndexScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+LOG:  pg_hint_plan:
+used hint:
+NoIndexScan(ti1)
+not used hint:
+duplication hint:
+error hint:
+
+            QUERY PLAN             
+-----------------------------------
+ Tid Scan on ti1
+   TID Cond: (ctid = '(1,1)'::tid)
+   Filter: (c1 = 1)
+(3 rows)
+
+-- No. S-3-13-17
+/*+NoIndexScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+INFO:  hint syntax error at or near "ti1_pkey)"
+DETAIL:  Closed parenthesis is necessary.
+            QUERY PLAN             
+-----------------------------------
+ Tid Scan on ti1
+   TID Cond: (ctid = '(1,1)'::tid)
+   Filter: (c1 = 1)
+(3 rows)
+
+-- No. S-3-13-18
+/*+NoIndexScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+INFO:  hint syntax error at or near "ti1_pkey ti1_btree)"
+DETAIL:  Closed parenthesis is necessary.
+            QUERY PLAN             
+-----------------------------------
+ Tid Scan on ti1
+   TID Cond: (ctid = '(1,1)'::tid)
+   Filter: (c1 = 1)
+(3 rows)
+
+-- No. S-3-13-19
+/*+NoBitmapScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+LOG:  pg_hint_plan:
+used hint:
+NoBitmapScan(ti1)
+not used hint:
+duplication hint:
+error hint:
+
+            QUERY PLAN             
+-----------------------------------
+ Tid Scan on ti1
+   TID Cond: (ctid = '(1,1)'::tid)
+   Filter: (c1 = 1)
+(3 rows)
+
+-- No. S-3-13-20
+/*+NoBitmapScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+INFO:  hint syntax error at or near "ti1_pkey)"
+DETAIL:  Closed parenthesis is necessary.
+            QUERY PLAN             
+-----------------------------------
+ Tid Scan on ti1
+   TID Cond: (ctid = '(1,1)'::tid)
+   Filter: (c1 = 1)
+(3 rows)
+
+-- No. S-3-13-21
+/*+NoBitmapScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+INFO:  hint syntax error at or near "ti1_pkey ti1_btree)"
+DETAIL:  Closed parenthesis is necessary.
+            QUERY PLAN             
+-----------------------------------
+ Tid Scan on ti1
+   TID Cond: (ctid = '(1,1)'::tid)
+   Filter: (c1 = 1)
+(3 rows)
+
+-- No. S-3-13-22
+/*+NoTidScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+LOG:  pg_hint_plan:
+used hint:
+NoTidScan(ti1)
+not used hint:
+duplication hint:
+error hint:
+
+            QUERY PLAN            
+----------------------------------
+ Index Scan using ti1_uniq on ti1
+   Index Cond: (c1 = 1)
+   Filter: (ctid = '(1,1)'::tid)
+(3 rows)
+
+-- No. S-3-13-23
+/*+NoTidScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+INFO:  hint syntax error at or near "ti1_pkey)"
+DETAIL:  Closed parenthesis is necessary.
+            QUERY PLAN             
+-----------------------------------
+ Tid Scan on ti1
+   TID Cond: (ctid = '(1,1)'::tid)
+   Filter: (c1 = 1)
+(3 rows)
+
+-- No. S-3-13-24
+/*+NoTidScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+INFO:  hint syntax error at or near "ti1_pkey ti1_btree)"
+DETAIL:  Closed parenthesis is necessary.
+            QUERY PLAN             
+-----------------------------------
+ Tid Scan on ti1
+   TID Cond: (ctid = '(1,1)'::tid)
+   Filter: (c1 = 1)
+(3 rows)
+
index 03c2a80..fcab338 100644 (file)
@@ -174,6 +174,7 @@ CREATE UNIQUE INDEX ti1_uniq ON s1.ti1 (c1);
 CREATE INDEX ti1_multi ON s1.ti1 (c1, c2, c3, c4);
 CREATE INDEX ti1_ts    ON s1.ti1 USING gin(to_tsvector('english', c4));
 CREATE VIEW s1.v1 AS SELECT v1t1.c1, v1t1.c2, v1t1.c3, v1t1.c4 FROM s1.t1 v1t1;
+CREATE VIEW s1.v1_ AS SELECT v1t1_.c1, v1t1_.c2, v1t1_.c3, v1t1_.c4 FROM s1.t1 v1t1_;
 CREATE VIEW s1.v2 AS SELECT v2t1.c1, v2t1.c2, v2t1.c3, v2t1.c4 FROM s1.t1 v2t1 JOIN s1.t2 v2t2 ON(v2t1.c1 = v2t2.c1);
 CREATE VIEW s1.v3 AS SELECT v3t1.c1, v3t1.c2, v3t1.c3, v3t1.c4 FROM s1.t1 v3t1 JOIN s1.t2 v3t2 ON(v3t1.c1 = v3t2.c1) JOIN s1.t3 v3t3 ON(v3t1.c1 = v3t3.c1);
 ANALYZE;
diff --git a/sql/ut-J.sql b/sql/ut-J.sql
new file mode 100644 (file)
index 0000000..95a2c1a
--- /dev/null
@@ -0,0 +1,625 @@
+LOAD 'pg_hint_plan';
+SET pg_hint_plan.enable TO on;
+SET pg_hint_plan.debug_print TO on;
+SET client_min_messages TO LOG;
+SET search_path TO public;
+
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+
+----
+---- No. J-1-1 specified pattern of the object name
+----
+
+-- No. J-1-1-1
+/*+HashJoin(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+
+-- No. J-1-1-2
+/*+HashJoin(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 t_1, s1.t2 t_2 WHERE t_1.c1 = t_2.c1;
+
+-- No. J-1-1-3
+/*+HashJoin(t_1 t_2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 t_1, s1.t2 t_2 WHERE t_1.c1 = t_2.c1;
+
+
+----
+---- No. J-1-2 specified schema name in the hint option
+----
+
+-- No. J-1-2-1
+/*+HashJoin(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+
+-- No. J-1-2-2
+/*+HashJoin(s1.t1 s1.t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+
+----
+---- No. J-1-3 table doesn't exist in the hint option
+----
+
+-- No. J-1-3-1
+/*+HashJoin(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+
+-- No. J-1-3-1
+/*+HashJoin(t3 t4)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+
+----
+---- No. J-1-4 conflict table name
+----
+
+-- No. J-1-4-1
+/*+HashJoin(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+
+-- No. J-1-4-2
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = s2.t1.c1;
+/*+HashJoin(s1.t1 s2.t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = s2.t1.c1;
+
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = s2t1.c1;
+/*+HashJoin(t1 s2t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = s2t1.c1;
+
+-- No. J-1-4-3
+EXPLAIN (COSTS false) SELECT *, (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+/*+HashJoin(t1 t2)*/
+EXPLAIN (COSTS false) SELECT *, (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+/*+NestLoop(st1 st2)HashJoin(t1 t2)*/
+EXPLAIN (COSTS false) SELECT *, (SELECT max(st1.c1) FROM s1.t1 st1, s1.t2 st2 WHERE st1.c1 = st2.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+
+----
+---- No. J-1-5 conflict table name
+----
+
+-- No. J-1-5-1
+-- TODO
+
+----
+---- No. J-1-6 object type for the hint
+----
+
+-- No. J-1-6-1
+/*+HashJoin(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+
+-- No. J-1-6-2
+EXPLAIN (COSTS false) SELECT * FROM s1.p1 t1, s1.p1 t2 WHERE t1.c1 = t2.c1;
+/*+NestLoop(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.p1 t1, s1.p1 t2 WHERE t1.c1 = t2.c1;
+
+-- No. J-1-6-3
+EXPLAIN (COSTS false) SELECT * FROM s1.ul1 t1, s1.ul1 t2 WHERE t1.c1 = t2.c1;
+/*+NestLoop(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ul1 t1, s1.ul1 t2 WHERE t1.c1 = t2.c1;
+
+-- No. J-1-6-4
+CREATE TEMP TABLE tm1 (LIKE s1.t1 INCLUDING ALL);
+EXPLAIN (COSTS false) SELECT * FROM tm1 t1, tm1 t2 WHERE t1.c1 = t2.c1;
+/*+NestLoop(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM tm1 t1, tm1 t2 WHERE t1.c1 = t2.c1;
+
+-- No. J-1-6-5
+EXPLAIN (COSTS false) SELECT * FROM pg_catalog.pg_class t1, pg_catalog.pg_class t2 WHERE t1.oid = t2.oid;
+/*+NestLoop(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM pg_catalog.pg_class t1, pg_catalog.pg_class t2 WHERE t1.oid = t2.oid;
+
+-- No. J-1-6-6
+-- refer fdw.sql
+
+-- No. J-1-6-7
+EXPLAIN (COSTS false) SELECT * FROM s1.f1() t1, s1.f1() t2 WHERE t1.c1 = t2.c1;
+/*+HashJoin(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.f1() t1, s1.f1() t2 WHERE t1.c1 = t2.c1;
+
+-- No. J-1-6-8
+EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t1 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t2 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1;
+/*+NestLoop(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t1 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t2 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1;
+/*+NestLoop(*VALUES* *VALUES*)*/
+EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t1 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t2 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1;
+
+-- No. J-1-6-9
+EXPLAIN (COSTS false) WITH c1(c1) AS (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1) SELECT * FROM s1.t1, c1 WHERE t1.c1 = c1.c1;
+/*+NestLoop(t1 t2)HashJoin(t1 c1)*/
+EXPLAIN (COSTS false) WITH c1(c1) AS (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1) SELECT * FROM s1.t1, c1 WHERE t1.c1 = c1.c1;
+
+-- No. J-1-6-10
+EXPLAIN (COSTS false) SELECT * FROM s1.v1 t1, s1.v1 t2 WHERE t1.c1 = t2.c1;
+/*+NestLoop(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.v1 t1, s1.v1 t2 WHERE t1.c1 = t2.c1;
+/*+NestLoop(v1t1 v1t1_)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.v1 t1, s1.v1_ t2 WHERE t1.c1 = t2.c1;
+
+-- No. J-1-6-11
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.c1 = (SELECT max(st1.c1) FROM s1.t1 st1, s1.t2 st2 WHERE st1.c1 = st2.c1);
+/*+MergeJoin(t1 t2)NestLoop(st1 st2)*/
+EXPLAIN (COSTS true) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.c1 = (SELECT max(st1.c1) FROM s1.t1 st1, s1.t2 st2 WHERE st1.c1 = st2.c1);
+
+\q
+
+----
+---- No. S-3-1 scan method hint
+----
+
+-- No. S-3-1-1
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
+/*+SeqScan(t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
+
+-- No. S-3-1-2
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
+/*+SeqScan(t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
+
+-- No. S-3-1-3
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
+/*+IndexScan(t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
+
+-- No. S-3-1-4
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
+/*+IndexScan(t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
+
+-- No. S-3-1-5
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
+/*+BitmapScan(t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
+
+-- No. S-3-1-6
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
+/*+BitmapScan(t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
+
+-- No. S-3-1-7
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
+/*+TidScan(t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
+
+-- No. S-3-1-8
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid IN ('(1,1)', '(2,2)', '(3,3)');
+/*+TidScan(t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid IN ('(1,1)', '(2,2)', '(3,3)');
+
+-- No. S-3-1-9
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
+/*+NoSeqScan(t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
+
+-- No. S-3-1-10
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
+/*+NoSeqScan(t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
+
+-- No. S-3-1-11
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
+/*+NoIndexScan(t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
+
+-- No. S-3-1-12
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
+/*+NoIndexScan(t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 >= 1;
+
+-- No. S-3-1-13
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
+/*+NoBitmapScan(t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 < 10;
+
+-- No. S-3-1-14
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
+/*+NoBitmapScan(t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
+
+-- No. S-3-1-15
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
+/*+NoTidScan(t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
+
+-- No. S-3-1-16
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
+/*+NoTidScan(t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
+
+----
+---- No. S-3-3 index name specified
+----
+
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
+SET enable_tidscan TO off;
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
+SET enable_indexscan TO off;
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
+RESET enable_tidscan;
+RESET enable_indexscan;
+
+-- No. S-3-3-1
+/*+IndexScan(ti1 ti1_i3)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-3-2
+/*+IndexScan(ti1 ti1_i3 ti1_i2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-3-3
+/*+IndexScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-3-4
+/*+BitmapScan(ti1 ti1_i3)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-3-5
+/*+BitmapScan(ti1 ti1_i3 ti1_i2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-3-6
+/*+BitmapScan(ti1 ti1_i4 ti1_i3 ti1_i2 ti1_i1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE ti1.c2 = 1 AND ctid = '(1,1)';
+
+----
+---- No. S-3-4 index type
+----
+
+\d s1.ti1
+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)';
+
+-- No. S-3-4-1
+/*+IndexScan(ti1 ti1_btree)*/
+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)';
+
+-- No. S-3-4-2
+/*+IndexScan(ti1 ti1_hash)*/
+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)';
+
+-- No. S-3-4-3
+/*+IndexScan(ti1 ti1_gist)*/
+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)';
+
+-- No. S-3-4-4
+/*+IndexScan(ti1 ti1_gin)*/
+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)';
+
+-- No. S-3-4-5
+/*+IndexScan(ti1 ti1_expr)*/
+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)';
+
+-- No. S-3-4-6
+/*+IndexScan(ti1 ti1_pred)*/
+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)';
+
+-- No. S-3-4-7
+/*+IndexScan(ti1 ti1_uniq)*/
+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)';
+
+-- No. S-3-4-8
+/*+IndexScan(ti1 ti1_multi)*/
+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)';
+
+-- No. S-3-4-9
+/*+IndexScan(ti1 ti1_ts)*/
+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)';
+
+-- No. S-3-4-10
+/*+IndexScan(ti1 ti1_pkey)*/
+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)';
+
+-- No. S-3-4-11
+/*+IndexScan(ti1 ti1_c2_key)*/
+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)';
+
+-- No. S-3-4-12
+/*+BitmapScan(ti1 ti1_btree)*/
+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)';
+
+-- No. S-3-4-13
+/*+BitmapScan(ti1 ti1_hash)*/
+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)';
+
+-- No. S-3-4-14
+/*+BitmapScan(ti1 ti1_gist)*/
+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)';
+
+-- No. S-3-4-15
+/*+BitmapScan(ti1 ti1_gin)*/
+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)';
+
+-- No. S-3-4-16
+/*+BitmapScan(ti1 ti1_expr)*/
+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)';
+
+-- No. S-3-4-17
+/*+BitmapScan(ti1 ti1_pred)*/
+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)';
+
+-- No. S-3-4-18
+/*+BitmapScan(ti1 ti1_uniq)*/
+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)';
+
+-- No. S-3-4-19
+/*+BitmapScan(ti1 ti1_multi)*/
+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)';
+
+-- No. S-3-4-20
+/*+BitmapScan(ti1 ti1_ts)*/
+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)';
+
+-- No. S-3-4-10
+/*+BitmapScan(ti1 ti1_pkey)*/
+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)';
+
+-- No. S-3-4-11
+/*+BitmapScan(ti1 ti1_c2_key)*/
+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)';
+
+----
+---- No. S-3-5 not used index
+----
+
+-- No. S-3-5-1
+/*+IndexScan(ti1 ti1_pred)*/
+EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
+
+-- No. S-3-5-2
+/*+BitmapScan(ti1 ti1_pred)*/
+EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
+
+----
+---- No. S-3-6 not exist index
+----
+
+-- No. S-3-6-1
+/*+IndexScan(ti1 not_exist)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 100;
+
+-- No. S-3-6-2
+/*+BitmapScan(ti1 not_exist)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 100;
+
+----
+---- No. S-3-7 query structure
+----
+
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
+
+-- No. S-3-7-1
+/*+SeqScan(t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE c1 = 100;
+
+-- No. S-3-7-2
+/*+SeqScan(t1)BitmapScan(t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
+
+-- No. S-3-7-3
+/*+SeqScan(t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.ctid = '(1,1)';
+
+----
+---- No. S-3-8 query structure
+----
+
+-- No. S-3-8-1
+EXPLAIN (COSTS false) 
+WITH c1 (c1) AS (
+SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.c1 = 1)
+SELECT max(b3t1.c1), (
+SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
+                  ) FROM s1.t1 b3t1 WHERE b3t1.c1 = (
+SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
+/*+BitmapScan(b1t1)BitmapScan(b2t1)BitmapScan(b3t1)BitmapScan(b4t1)*/
+EXPLAIN (COSTS false) 
+WITH c1 (c1) AS (
+SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.c1 = 1)
+SELECT max(b3t1.c1), (
+SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
+                  ) FROM s1.t1 b3t1 WHERE b3t1.c1 = (
+SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
+
+-- No. S-3-8-2
+EXPLAIN (COSTS false) 
+WITH cte1 (c1) AS (
+SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
+SELECT max(b3t1.c1), (
+SELECT max(b2t1.c1) FROM s1.t1 b2t1 JOIN s1.t2 b2t2 ON(b2t1.c1 = b2t2.c1) WHERE b2t1.c1 = 1
+                  ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
+SELECT max(b4t1.c1) FROM s1.t1 b4t1 JOIN s1.t2 b4t2 ON(b4t1.c1 = b4t2.c1) WHERE b4t1.c1 = 1);
+/*+BitmapScan(b1t1)BitmapScan(b2t1)BitmapScan(b3t1)BitmapScan(b4t1)BitmapScan(b1t2)BitmapScan(b2t2)BitmapScan(b3t2)BitmapScan(b4t2)*/
+EXPLAIN (COSTS false) 
+WITH cte1 (c1) AS (
+SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
+SELECT max(b3t1.c1), (
+SELECT max(b2t1.c1) FROM s1.t1 b2t1 JOIN s1.t2 b2t2 ON(b2t1.c1 = b2t2.c1) WHERE b2t1.c1 = 1
+                  ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
+SELECT max(b4t1.c1) FROM s1.t1 b4t1 JOIN s1.t2 b4t2 ON(b4t1.c1 = b4t2.c1) WHERE b4t1.c1 = 1);
+
+-- No. S-3-8-3
+EXPLAIN (COSTS false) 
+WITH cte1 (c1) AS (
+SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
+SELECT max(b3t1.c1), (
+SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
+                  ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
+SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
+/*+BitmapScan(b1t1)BitmapScan(b2t1)BitmapScan(b3t1)BitmapScan(b4t1)BitmapScan(b1t2)BitmapScan(b3t2)*/
+EXPLAIN (COSTS false) 
+WITH cte1 (c1) AS (
+SELECT max(b1t1.c1) FROM s1.t1 b1t1 JOIN s1.t2 b1t2 ON(b1t1.c1 = b1t2.c1) WHERE b1t1.c1 = 1)
+SELECT max(b3t1.c1), (
+SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
+                  ) FROM s1.t1 b3t1 JOIN s1.t2 b3t2 ON(b3t1.c1 = b3t2.c1) JOIN cte1 ON(b3t1.c1 = cte1.c1) WHERE b3t1.c1 = (
+SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
+
+----
+---- No. S-3-9 inheritance table select type
+----
+
+-- No. S-3-9-1
+EXPLAIN (COSTS false) SELECT * FROM ONLY s1.p1 WHERE c1 = 1;
+/*+IndexScan(p1)*/
+EXPLAIN (COSTS false) SELECT * FROM ONLY s1.p1 WHERE c1 = 1;
+
+-- No. S-3-9-2
+EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
+/*+IndexScan(p1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
+
+----
+---- No. S-3-10 inheritance table number
+----
+
+-- No. S-3-10-1
+EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
+/*+IndexScan(p1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.p1 WHERE c1 = 1;
+
+-- No. S-3-10-2
+EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
+/*+IndexScan(p2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
+
+----
+---- No. S-3-11 inheritance table specified table
+----
+
+EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
+
+-- No. S-3-11-1
+/*+IndexScan(p2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
+
+-- No. S-3-11-2
+/*+IndexScan(p2c1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
+
+-- No. S-3-11-3
+/*+IndexScan(p2 p2_pkey p2c1_pkey p2c1c1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
+
+-- No. S-3-11-4
+/*+IndexScan(p2 p2c1_pkey)*/
+EXPLAIN (COSTS true) SELECT * FROM s1.p2 WHERE c1 = 1;
+
+----
+---- No. S-3-12 specified same table
+----
+
+-- No. S-3-12-1
+/*+IndexScan(ti1) BitmapScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-12-2
+/*+IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-12-3
+/*+BitmapScan(ti1) IndexScan(ti1) BitmapScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-12-4
+/*+BitmapScan(ti1 ti1_hash) IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+----
+---- No. S-3-13 message output
+----
+
+-- No. S-3-13-1
+/*+SeqScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-2
+/*+SeqScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-3
+/*+SeqScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-4
+/*+IndexScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-5
+/*+IndexScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-6
+/*+IndexScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-7
+/*+BitmapScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-8
+/*+BitmapScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-9
+/*+BitmapScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-10
+/*+TidScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-11
+/*+TidScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-12
+/*+TidScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-13
+/*+NoSeqScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-14
+/*+NoSeqScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-15
+/*+NoSeqScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-16
+/*+NoIndexScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-17
+/*+NoIndexScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-18
+/*+NoIndexScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-19
+/*+NoBitmapScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-20
+/*+NoBitmapScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-21
+/*+NoBitmapScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-22
+/*+NoTidScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-23
+/*+NoTidScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-24
+/*+NoTidScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
index e2c6e32..71ad473 100644 (file)
@@ -60,22 +60,22 @@ EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = 1 AND t1.c1 = t2.
 
 -- No. S-1-4-2
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = 1 AND s1.t1.c1 = s2.t1.c1;
-/*+IndexScan(t1)*/
+/*+BitmapScan(t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = 1 AND s1.t1.c1 = s2.t1.c1;
 
-/*+SeqScan(t1)*/
+/*+BitmapScan(t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = 1 AND s1.t1.c1 = s2t1.c1;
 /*+BitmapScan(s2t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = 1 AND s1.t1.c1 = s2t1.c1;
 
 -- No. S-1-4-3
 EXPLAIN (COSTS false) SELECT (SELECT max(c1) FROM s1.t1 WHERE s1.t1.c1 = 1) FROM s1.t1 WHERE s1.t1.c1 = 1;
-/*+SeqScan(t1)*/
+/*+BitmapScan(t1)*/
 EXPLAIN (COSTS false) SELECT (SELECT max(c1) FROM s1.t1 WHERE s1.t1.c1 = 1) FROM s1.t1 WHERE s1.t1.c1 = 1;
 
-/*+SeqScan(t11)*/
+/*+BitmapScan(t11)*/
 EXPLAIN (COSTS false) SELECT (SELECT max(c1) FROM s1.t1 t11 WHERE t11.c1 = 1) FROM s1.t1 t12 WHERE t12.c1 = 1;
-/*+SeqScan(t12)*/
+/*+BitmapScan(t12)*/
 EXPLAIN (COSTS false) SELECT (SELECT max(c1) FROM s1.t1 t11 WHERE t11.c1 = 1) FROM s1.t1 t12 WHERE t12.c1 = 1;
 
 ----
@@ -501,3 +501,123 @@ EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
 /*+IndexScan(p2 p2c1_pkey)*/
 EXPLAIN (COSTS true) SELECT * FROM s1.p2 WHERE c1 = 1;
 
+----
+---- No. S-3-12 specified same table
+----
+
+-- No. S-3-12-1
+/*+IndexScan(ti1) BitmapScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-12-2
+/*+IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-12-3
+/*+BitmapScan(ti1) IndexScan(ti1) BitmapScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-12-4
+/*+BitmapScan(ti1 ti1_hash) IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+----
+---- No. S-3-13 message output
+----
+
+-- No. S-3-13-1
+/*+SeqScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-2
+/*+SeqScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-3
+/*+SeqScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-4
+/*+IndexScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-5
+/*+IndexScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-6
+/*+IndexScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-7
+/*+BitmapScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-8
+/*+BitmapScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-9
+/*+BitmapScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-10
+/*+TidScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-11
+/*+TidScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-12
+/*+TidScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-13
+/*+NoSeqScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-14
+/*+NoSeqScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-15
+/*+NoSeqScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-16
+/*+NoIndexScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-17
+/*+NoIndexScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-18
+/*+NoIndexScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-19
+/*+NoBitmapScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-20
+/*+NoBitmapScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-21
+/*+NoBitmapScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-22
+/*+NoTidScan(ti1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-23
+/*+NoTidScan(ti1 ti1_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
+-- No. S-3-13-24
+/*+NoTidScan(ti1 ti1_pkey ti1_btree)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
+
index 3e12b51..c84727e 100644 (file)
@@ -102,6 +102,7 @@ CREATE INDEX ti1_multi ON s1.ti1 (c1, c2, c3, c4);
 CREATE INDEX ti1_ts    ON s1.ti1 USING gin(to_tsvector('english', c4));
 
 CREATE VIEW s1.v1 AS SELECT v1t1.c1, v1t1.c2, v1t1.c3, v1t1.c4 FROM s1.t1 v1t1;
+CREATE VIEW s1.v1_ AS SELECT v1t1_.c1, v1t1_.c2, v1t1_.c3, v1t1_.c4 FROM s1.t1 v1t1_;
 CREATE VIEW s1.v2 AS SELECT v2t1.c1, v2t1.c2, v2t1.c3, v2t1.c4 FROM s1.t1 v2t1 JOIN s1.t2 v2t2 ON(v2t1.c1 = v2t2.c1);
 CREATE VIEW s1.v3 AS SELECT v3t1.c1, v3t1.c2, v3t1.c3, v3t1.c4 FROM s1.t1 v3t1 JOIN s1.t2 v3t2 ON(v3t1.c1 = v3t2.c1) JOIN s1.t3 v3t3 ON(v3t1.c1 = v3t3.c1);