OSDN Git Service

GUCパラメータ変更済みフラグの判定について、真/偽を逆に判定していたバグを
authorMitsuru Hasegawa <hasegawa@metrosystems.co.jp>
Wed, 13 Jun 2012 09:35:25 +0000 (18:35 +0900)
committerMitsuru Hasegawa <hasegawa@metrosystems.co.jp>
Wed, 13 Jun 2012 09:35:25 +0000 (18:35 +0900)
修正した。

expected/pg_hint_plan.out
pg_hint_plan.c

index 0cac1da..3129786 100644 (file)
@@ -197,27 +197,23 @@ EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
 
 /*BitmapScan(t2)*/
 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-                QUERY PLAN                
-------------------------------------------
+              QUERY PLAN              
+--------------------------------------
  Nested Loop
    ->  Seq Scan on t1
-   ->  Bitmap Heap Scan on t2
-         Recheck Cond: (id = t1.id)
-         ->  Bitmap Index Scan on t2_pkey
-               Index Cond: (id = t1.id)
-(6 rows)
+   ->  Index Scan using t2_pkey on t2
+         Index Cond: (id = t1.id)
+(4 rows)
 
 /*BitmapScan(t2)NoSeqScan(t1)*/
 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-                QUERY PLAN                
-------------------------------------------
+              QUERY PLAN              
+--------------------------------------
  Nested Loop
    ->  Index Scan using t1_pkey on t1
-   ->  Bitmap Heap Scan on t2
-         Recheck Cond: (id = t1.id)
-         ->  Bitmap Index Scan on t2_pkey
-               Index Cond: (id = t1.id)
-(6 rows)
+   ->  Index Scan using t2_pkey on t2
+         Index Cond: (id = t1.id)
+(4 rows)
 
 /*NoIndexScan(t1)*/
 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
index 57ade7d..d7fe335 100644 (file)
@@ -1616,7 +1616,11 @@ rebuild_scan_path(PlanHint *plan, PlannerInfo *root, int level, List *initial_re
                                RelnameCmp(&hint->relname, &rte->eref->aliasname) != 0)
                                continue;
 
-                       if (save_nestlevel != 0)
+                       /*
+                        * 複数のスキャンヒントが指定されていた場合でも、1つのネストレベルで
+                        * スキャン関連のGUCパラメータを変更する。
+                        */
+                       if (save_nestlevel == 0)
                                save_nestlevel = NewGUCNestLevel();
 
                        /*