OSDN Git Service

Rowsヒント句の絶対値指定(R-3-1-*)の試験を追加した。
authorTakashi Suzuki <suzuki.takashi@metrosystems.co.jp>
Thu, 16 Jan 2014 07:44:21 +0000 (16:44 +0900)
committerTakashi Suzuki <suzuki.takashi@metrosystems.co.jp>
Thu, 16 Jan 2014 07:51:15 +0000 (16:51 +0900)
expected/R_3-1-1.out [new file with mode: 0644]
expected/R_3-1-2.out [new file with mode: 0644]
expected/ut-R.out
sql/ut-R.sql

diff --git a/expected/R_3-1-1.out b/expected/R_3-1-1.out
new file mode 100644 (file)
index 0000000..36073c1
--- /dev/null
@@ -0,0 +1,10 @@
+                                QUERY PLAN                                 
+---------------------------------------------------------------------------
+ Merge Join  (cost=xxx rows=1 width=29)
+   Merge Cond: (t1.c1 = t2.c1)
+   ->  Index Scan using t1_i1 on t1  (cost=xxx rows=1000 width=15)
+   ->  Sort  (cost=xxx rows=100 width=14)
+         Sort Key: t2.c1
+         ->  Seq Scan on t2  (cost=xxx rows=100 width=14)
+(6 rows)
+
diff --git a/expected/R_3-1-2.out b/expected/R_3-1-2.out
new file mode 100644 (file)
index 0000000..3171e12
--- /dev/null
@@ -0,0 +1,10 @@
+                                QUERY PLAN                                 
+---------------------------------------------------------------------------
+ Merge Join  (cost=xxx rows=5 width=29)
+   Merge Cond: (t1.c1 = t2.c1)
+   ->  Index Scan using t1_i1 on t1  (cost=xxx rows=1000 width=15)
+   ->  Sort  (cost=xxx rows=100 width=14)
+         Sort Key: t2.c1
+         ->  Seq Scan on t2  (cost=xxx rows=100 width=14)
+(6 rows)
+
index cc6bab9..95493c2 100644 (file)
@@ -2175,3 +2175,35 @@ error hint:
 \o
 \! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-5-3.out.log > results/R_2-5-3.out
 \! diff expected/R_2-5-3.out results/R_2-5-3.out
+----
+---- No. R-3-1 abusolute value
+----
+-- No. R-3-1-1
+\o results/R_3-1-1.out.log
+/*+Rows(t1 t2 #0)*/
+EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+WARNING:  make rows estimation 1 since below 1 : Rows(t1 t2 #0)
+LOG:  pg_hint_plan:
+used hint:
+Rows(t1 t2 #0)
+not used hint:
+duplication hint:
+error hint:
+
+\o
+\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-1-1.out.log > results/R_3-1-1.out
+\! diff expected/R_3-1-1.out results/R_3-1-1.out
+-- No. R-3-1-2
+\o results/R_3-1-2.out.log
+/*+Rows(t1 t2 #5)*/
+EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+LOG:  pg_hint_plan:
+used hint:
+Rows(t1 t2 #5)
+not used hint:
+duplication hint:
+error hint:
+
+\o
+\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-1-2.out.log > results/R_3-1-2.out
+\! diff expected/R_3-1-2.out results/R_3-1-2.out
index 6c58d5d..aeff8ef 100644 (file)
@@ -1080,3 +1080,23 @@ EXPLAIN SELECT bmt1.c1 FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2,
 \! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-5-3.out.log > results/R_2-5-3.out
 \! diff expected/R_2-5-3.out results/R_2-5-3.out
 
+----
+---- No. R-3-1 abusolute value
+----
+
+-- No. R-3-1-1
+\o results/R_3-1-1.out.log
+/*+Rows(t1 t2 #0)*/
+EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+\o
+\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-1-1.out.log > results/R_3-1-1.out
+\! diff expected/R_3-1-1.out results/R_3-1-1.out
+
+-- No. R-3-1-2
+\o results/R_3-1-2.out.log
+/*+Rows(t1 t2 #5)*/
+EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+\o
+\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-1-2.out.log > results/R_3-1-2.out
+\! diff expected/R_3-1-2.out results/R_3-1-2.out
+