CONTEXT: SQL statement "SELECT /*+SeqScan(t1)*/ t1.id FROM t1 WHERE t1.id = 1"
PL/pgSQL function inline_code_block line 5 at SQL statement
DROP EXTENSION pg_hint_plan;
+-- Rows hint tests
+-- value types
+EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
+ QUERY PLAN
+------------------------------------------------------------------------------
+ Merge Join (cost=0.00..90.08 rows=1000 width=16)
+ Merge Cond: (t1.id = t2.id)
+ -> Index Scan using t1_pkey on t1 (cost=0.00..318.25 rows=10000 width=8)
+ -> Index Scan using t2_pkey on t2 (cost=0.00..43.25 rows=1000 width=8)
+(4 rows)
+
+/*+ Rows(t1 t2 #99) */
+EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
+LOG: pg_hint_plan:
+used hint:
+Rows(t1 t2 #99)
+not used hint:
+duplication hint:
+error hint:
+
+ QUERY PLAN
+------------------------------------------------------------------------------
+ Merge Join (cost=0.00..90.08 rows=99 width=16)
+ Merge Cond: (t1.id = t2.id)
+ -> Index Scan using t1_pkey on t1 (cost=0.00..318.25 rows=10000 width=8)
+ -> Index Scan using t2_pkey on t2 (cost=0.00..43.25 rows=1000 width=8)
+(4 rows)
+
+/*+ Rows(t1 t2 +99) */
+EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
+LOG: pg_hint_plan:
+used hint:
+Rows(t1 t2 +99)
+not used hint:
+duplication hint:
+error hint:
+
+ QUERY PLAN
+------------------------------------------------------------------------------
+ Merge Join (cost=0.00..90.08 rows=1099 width=16)
+ Merge Cond: (t1.id = t2.id)
+ -> Index Scan using t1_pkey on t1 (cost=0.00..318.25 rows=10000 width=8)
+ -> Index Scan using t2_pkey on t2 (cost=0.00..43.25 rows=1000 width=8)
+(4 rows)
+
+/*+ Rows(t1 t2 -99) */
+EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
+LOG: pg_hint_plan:
+used hint:
+Rows(t1 t2 -99)
+not used hint:
+duplication hint:
+error hint:
+
+ QUERY PLAN
+------------------------------------------------------------------------------
+ Merge Join (cost=0.00..90.08 rows=901 width=16)
+ Merge Cond: (t1.id = t2.id)
+ -> Index Scan using t1_pkey on t1 (cost=0.00..318.25 rows=10000 width=8)
+ -> Index Scan using t2_pkey on t2 (cost=0.00..43.25 rows=1000 width=8)
+(4 rows)
+
+/*+ Rows(t1 t2 *99) */
+EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
+LOG: pg_hint_plan:
+used hint:
+Rows(t1 t2 *99)
+not used hint:
+duplication hint:
+error hint:
+
+ QUERY PLAN
+------------------------------------------------------------------------------
+ Merge Join (cost=0.00..90.08 rows=99000 width=16)
+ Merge Cond: (t1.id = t2.id)
+ -> Index Scan using t1_pkey on t1 (cost=0.00..318.25 rows=10000 width=8)
+ -> Index Scan using t2_pkey on t2 (cost=0.00..43.25 rows=1000 width=8)
+(4 rows)
+
+/*+ Rows(t1 t2 /99) */
+EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
+LOG: pg_hint_plan:
+used hint:
+Rows(t1 t2 /99)
+not used hint:
+duplication hint:
+error hint:
+
+ QUERY PLAN
+------------------------------------------------------------------------------
+ Merge Join (cost=0.00..90.08 rows=10 width=16)
+ Merge Cond: (t1.id = t2.id)
+ -> Index Scan using t1_pkey on t1 (cost=0.00..318.25 rows=10000 width=8)
+ -> Index Scan using t2_pkey on t2 (cost=0.00..43.25 rows=1000 width=8)
+(4 rows)
+
DROP EXTENSION pg_hint_plan;
-- Rows hint tests
+-- value types
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
-/*+ Rows(t1 t2 #10) */
+/*+ Rows(t1 t2 #99) */
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
-/*+ Rows(t1 t2 *10) */
+/*+ Rows(t1 t2 +99) */
+EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
+/*+ Rows(t1 t2 -99) */
+EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
+/*+ Rows(t1 t2 *99) */
+EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
+/*+ Rows(t1 t2 /99) */
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);