From: Takashi Suzuki Date: Fri, 13 Sep 2013 06:46:41 +0000 (+0900) Subject: PL/pgSQL文に関する仕様変更にそってリグレッションテストの内容を変更した。 X-Git-Tag: REL91_1_1_1~5 X-Git-Url: http://git.osdn.net/view?p=pghintplan%2Fpg_hint_plan.git;a=commitdiff_plain;h=2889ddb02a55230431a29bfce52140c41322a75a PL/pgSQL文に関する仕様変更にそってリグレッションテストの内容を変更した。 --- diff --git a/expected/ut-A-9.1.out b/expected/ut-A-9.1.out index dbc6991..4c138b7 100644 --- a/expected/ut-A-9.1.out +++ b/expected/ut-A-9.1.out @@ -4016,11 +4016,10 @@ BEGIN RETURN 0; END IF; - EXECUTE '/*+ IndexScan(t_1) */' - ' SELECT nested_planner($1) FROM s1.t1 t_1' - ' JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)' - ' ORDER BY t_1.c1 LIMIT 1' - INTO new_cnt USING cnt - 1; + SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) INTO new_cnt + FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1; RETURN new_cnt; END; @@ -4082,9 +4081,22 @@ error hint: --No.13-3-2 EXPLAIN (COSTS false) SELECT nested_planner(2) FROM s1.t1 t_1 ORDER BY t_1.c1; NOTICE: nested_planner(2) +LOG: pg_hint_plan: +used hint: +IndexScan(t_1) +not used hint: +duplication hint: +error hint: + +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement QUERY PLAN ---------------------------------- Index Scan using t1_i1 on t1 t_1 @@ -4094,17 +4106,10 @@ PL/pgSQL function "nested_planner" line 12 at EXECUTE statement EXPLAIN (COSTS false) SELECT nested_planner(2) FROM s1.t1 t_1 ORDER BY t_1.c1; NOTICE: nested_planner(2) NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -LOG: pg_hint_plan: -used hint: -SeqScan(t_2) -not used hint: -duplication hint: -error hint: - -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement LOG: pg_hint_plan: used hint: not used hint: @@ -4121,29 +4126,49 @@ error hint: EXPLAIN (COSTS false) SELECT nested_planner(5) FROM s1.t1 t_1 ORDER BY t_1.c1; NOTICE: nested_planner(5) NOTICE: nested_planner(4) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement NOTICE: nested_planner(3) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement NOTICE: nested_planner(2) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement QUERY PLAN ---------------------------------- Index Scan using t1_i1 on t1 t_1 @@ -4153,77 +4178,49 @@ PL/pgSQL function "nested_planner" line 12 at EXECUTE statement EXPLAIN (COSTS false) SELECT nested_planner(5) FROM s1.t1 t_1 ORDER BY t_1.c1; NOTICE: nested_planner(5) NOTICE: nested_planner(4) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement NOTICE: nested_planner(3) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement NOTICE: nested_planner(2) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -LOG: pg_hint_plan: -used hint: -SeqScan(t_2) -not used hint: -duplication hint: -error hint: - -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -LOG: pg_hint_plan: -used hint: -SeqScan(t_2) -not used hint: -duplication hint: -error hint: - -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -LOG: pg_hint_plan: -used hint: -SeqScan(t_2) -not used hint: -duplication hint: -error hint: - -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -LOG: pg_hint_plan: -used hint: -SeqScan(t_2) -not used hint: -duplication hint: -error hint: - -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement LOG: pg_hint_plan: used hint: not used hint: @@ -4247,17 +4244,10 @@ EXPLAIN (COSTS false) ORDER BY t_1.c1; NOTICE: nested_planner(2) NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -LOG: pg_hint_plan: -used hint: -HashJoin(t_1 t_2) -not used hint: -duplication hint: -error hint: - -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement LOG: pg_hint_plan: used hint: HashJoin(t_1 t_2) @@ -4284,17 +4274,10 @@ EXPLAIN (COSTS false) ORDER BY st_1.c1; NOTICE: nested_planner(2) NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -LOG: pg_hint_plan: -used hint: -not used hint: -HashJoin(st_1 st_2) -duplication hint: -error hint: - -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement LOG: pg_hint_plan: used hint: HashJoin(st_1 st_2) @@ -4321,17 +4304,10 @@ EXPLAIN (COSTS false) ORDER BY st_1.c1; NOTICE: nested_planner(2) NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -LOG: pg_hint_plan: -used hint: -HashJoin(t_1 t_2) -not used hint: -duplication hint: -error hint: - -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement LOG: pg_hint_plan: used hint: not used hint: @@ -4357,17 +4333,10 @@ EXPLAIN (COSTS false) ORDER BY t_1.c1; NOTICE: nested_planner(2) NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -LOG: pg_hint_plan: -used hint: -not used hint: -HashJoin(st_1 st_2) -duplication hint: -error hint: - -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement LOG: pg_hint_plan: used hint: not used hint: @@ -4392,21 +4361,10 @@ EXPLAIN (COSTS false) ORDER BY t_1.c1; NOTICE: nested_planner(2) NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -INFO: hint syntax error at or near "HashJoin(t_1 t_1)" -DETAIL: Relation name "t_1" is duplicated. -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -LOG: pg_hint_plan: -used hint: -not used hint: -duplication hint: -error hint: -HashJoin(t_1 t_1) - -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement LOG: pg_hint_plan: used hint: not used hint: @@ -4430,10 +4388,9 @@ BEGIN RETURN 0; END IF; - EXECUTE '/*+ IndexScan(t_1) */' - ' SELECT nested_planner_one_t($1) FROM s1.t1 t_1' - ' ORDER BY t_1.c1 LIMIT 1' - INTO new_cnt USING cnt - 1; + SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) INTO new_cnt + FROM s1.t1 t_1 + ORDER BY t_1.c1 LIMIT 1; RETURN new_cnt; END; @@ -4443,9 +4400,32 @@ EXPLAIN (COSTS false) JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1; NOTICE: nested_planner_one_t(2) +LOG: pg_hint_plan: +used hint: +IndexScan(t_1) +not used hint: +duplication hint: +error hint: + +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) FROM s1.t1 t_1 + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner_one_t" line 11 at SQL statement NOTICE: nested_planner_one_t(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner_one_t($1) FROM s1.t1 t_1 ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner_one_t" line 11 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) FROM s1.t1 t_1 + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner_one_t" line 11 at SQL statement +LOG: pg_hint_plan: +used hint: +not used hint: +IndexScan(t_1) +duplication hint: +error hint: + +CONTEXT: SQL statement "SELECT 0" +PL/pgSQL function "nested_planner_one_t" line 8 at RETURN +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) FROM s1.t1 t_1 + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner_one_t" line 11 at SQL statement QUERY PLAN ---------------------------------------- Merge Join @@ -4463,17 +4443,9 @@ EXPLAIN (COSTS false) ORDER BY t_1.c1; NOTICE: nested_planner_one_t(2) NOTICE: nested_planner_one_t(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner_one_t($1) FROM s1.t1 t_1 ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner_one_t" line 11 at EXECUTE statement -LOG: pg_hint_plan: -used hint: -not used hint: -HashJoin(t_1 t_1) -duplication hint: -error hint: - -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner_one_t($1) FROM s1.t1 t_1 ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner_one_t" line 11 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) FROM s1.t1 t_1 + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner_one_t" line 11 at SQL statement INFO: hint syntax error at or near "HashJoin(t_1 t_1)" DETAIL: Relation name "t_1" is duplicated. LOG: pg_hint_plan: @@ -4502,21 +4474,10 @@ EXPLAIN (COSTS false) ORDER BY t_1.c1; NOTICE: nested_planner(2) NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -INFO: hint syntax error at or near "HashJoin(t_1 t_1)" -DETAIL: Relation name "t_1" is duplicated. -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -LOG: pg_hint_plan: -used hint: -not used hint: -duplication hint: -error hint: -HashJoin(t_1 t_1) - -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement INFO: hint syntax error at or near "HashJoin(t_1 t_1)" DETAIL: Relation name "t_1" is duplicated. LOG: pg_hint_plan: @@ -4545,23 +4506,11 @@ EXPLAIN (COSTS false) INFO: hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)" DETAIL: Conflict join method hint. NOTICE: nested_planner(2) -INFO: hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)" -DETAIL: Conflict join method hint. -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement -LOG: pg_hint_plan: -used hint: -HashJoin(t_1 t_2) -not used hint: -duplication hint: -MergeJoin(t_1 t_2) -error hint: - -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function "nested_planner" line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function "nested_planner" line 12 at SQL statement LOG: pg_hint_plan: used hint: HashJoin(t_1 t_2) diff --git a/expected/ut-A-9.2.out b/expected/ut-A-9.2.out index 24c0b2e..4bfd135 100644 --- a/expected/ut-A-9.2.out +++ b/expected/ut-A-9.2.out @@ -4166,11 +4166,10 @@ BEGIN RETURN 0; END IF; - EXECUTE '/*+ IndexScan(t_1) */' - ' SELECT nested_planner($1) FROM s1.t1 t_1' - ' JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)' - ' ORDER BY t_1.c1 LIMIT 1' - INTO new_cnt USING cnt - 1; + SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) INTO new_cnt + FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1; RETURN new_cnt; END; @@ -4233,8 +4232,21 @@ error hint: EXPLAIN (COSTS false) SELECT nested_planner(2) FROM s1.t1 t_1 ORDER BY t_1.c1; NOTICE: nested_planner(2) NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +LOG: pg_hint_plan: +used hint: +IndexScan(t_1) +not used hint: +duplication hint: +error hint: + +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement QUERY PLAN --------------------------------------- Index Only Scan using t1_i1 on t1 t_1 @@ -4244,17 +4256,21 @@ PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement EXPLAIN (COSTS false) SELECT nested_planner(2) FROM s1.t1 t_1 ORDER BY t_1.c1; NOTICE: nested_planner(2) NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement LOG: pg_hint_plan: used hint: -SeqScan(t_2) +IndexScan(t_1) not used hint: duplication hint: error hint: -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement LOG: pg_hint_plan: used hint: not used hint: @@ -4271,29 +4287,117 @@ error hint: EXPLAIN (COSTS false) SELECT nested_planner(5) FROM s1.t1 t_1 ORDER BY t_1.c1; NOTICE: nested_planner(5) NOTICE: nested_planner(4) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement NOTICE: nested_planner(3) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement NOTICE: nested_planner(2) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +LOG: pg_hint_plan: +used hint: +IndexScan(t_1) +not used hint: +duplication hint: +error hint: + +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +LOG: pg_hint_plan: +used hint: +IndexScan(t_1) +not used hint: +duplication hint: +error hint: + +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +LOG: pg_hint_plan: +used hint: +IndexScan(t_1) +not used hint: +duplication hint: +error hint: + +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +LOG: pg_hint_plan: +used hint: +IndexScan(t_1) +not used hint: +duplication hint: +error hint: + +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement QUERY PLAN --------------------------------------- Index Only Scan using t1_i1 on t1 t_1 @@ -4302,78 +4406,129 @@ PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement /*+SeqScan(t_2)*/ EXPLAIN (COSTS false) SELECT nested_planner(5) FROM s1.t1 t_1 ORDER BY t_1.c1; NOTICE: nested_planner(5) +LOG: pg_hint_plan: +used hint: +IndexScan(t_1) +not used hint: +duplication hint: +error hint: + +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement NOTICE: nested_planner(4) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement NOTICE: nested_planner(3) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement NOTICE: nested_planner(2) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement LOG: pg_hint_plan: used hint: -SeqScan(t_2) +IndexScan(t_1) not used hint: duplication hint: error hint: -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement LOG: pg_hint_plan: used hint: -SeqScan(t_2) +IndexScan(t_1) not used hint: duplication hint: error hint: -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement LOG: pg_hint_plan: used hint: -SeqScan(t_2) +IndexScan(t_1) not used hint: duplication hint: error hint: -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement -SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement LOG: pg_hint_plan: used hint: -SeqScan(t_2) +IndexScan(t_1) not used hint: duplication hint: error hint: -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement LOG: pg_hint_plan: used hint: not used hint: @@ -4397,17 +4552,21 @@ EXPLAIN (COSTS false) ORDER BY t_1.c1; NOTICE: nested_planner(2) NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement LOG: pg_hint_plan: used hint: -HashJoin(t_1 t_2) +IndexScan(t_1) not used hint: duplication hint: error hint: -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement LOG: pg_hint_plan: used hint: HashJoin(t_1 t_2) @@ -4434,17 +4593,21 @@ EXPLAIN (COSTS false) ORDER BY st_1.c1; NOTICE: nested_planner(2) NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement LOG: pg_hint_plan: used hint: +IndexScan(t_1) not used hint: -HashJoin(st_1 st_2) duplication hint: error hint: -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement LOG: pg_hint_plan: used hint: HashJoin(st_1 st_2) @@ -4471,17 +4634,21 @@ EXPLAIN (COSTS false) ORDER BY st_1.c1; NOTICE: nested_planner(2) NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement LOG: pg_hint_plan: used hint: -HashJoin(t_1 t_2) +IndexScan(t_1) not used hint: duplication hint: error hint: -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement LOG: pg_hint_plan: used hint: not used hint: @@ -4507,17 +4674,21 @@ EXPLAIN (COSTS false) ORDER BY t_1.c1; NOTICE: nested_planner(2) NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement LOG: pg_hint_plan: used hint: +IndexScan(t_1) not used hint: -HashJoin(st_1 st_2) duplication hint: error hint: -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement LOG: pg_hint_plan: used hint: not used hint: @@ -4542,21 +4713,21 @@ EXPLAIN (COSTS false) ORDER BY t_1.c1; NOTICE: nested_planner(2) NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement -INFO: hint syntax error at or near "HashJoin(t_1 t_1)" -DETAIL: Relation name "t_1" is duplicated. -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement LOG: pg_hint_plan: used hint: +IndexScan(t_1) not used hint: duplication hint: error hint: -HashJoin(t_1 t_1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement LOG: pg_hint_plan: used hint: not used hint: @@ -4580,10 +4751,9 @@ BEGIN RETURN 0; END IF; - EXECUTE '/*+ IndexScan(t_1) */' - ' SELECT nested_planner_one_t($1) FROM s1.t1 t_1' - ' ORDER BY t_1.c1 LIMIT 1' - INTO new_cnt USING cnt - 1; + SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) INTO new_cnt + FROM s1.t1 t_1 + ORDER BY t_1.c1 LIMIT 1; RETURN new_cnt; END; @@ -4594,8 +4764,30 @@ EXPLAIN (COSTS false) ORDER BY t_1.c1; NOTICE: nested_planner_one_t(2) NOTICE: nested_planner_one_t(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner_one_t($1) FROM s1.t1 t_1 ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner_one_t(integer) line 11 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) FROM s1.t1 t_1 + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner_one_t(integer) line 11 at SQL statement +LOG: pg_hint_plan: +used hint: +not used hint: +IndexScan(t_1) +duplication hint: +error hint: + +CONTEXT: PL/pgSQL function nested_planner_one_t(integer) line 8 at RETURN +SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) FROM s1.t1 t_1 + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner_one_t(integer) line 11 at SQL statement +LOG: pg_hint_plan: +used hint: +IndexScan(t_1) +not used hint: +duplication hint: +error hint: + +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) FROM s1.t1 t_1 + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner_one_t(integer) line 11 at SQL statement QUERY PLAN --------------------------------------------- Merge Join @@ -4613,17 +4805,19 @@ EXPLAIN (COSTS false) ORDER BY t_1.c1; NOTICE: nested_planner_one_t(2) NOTICE: nested_planner_one_t(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner_one_t($1) FROM s1.t1 t_1 ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner_one_t(integer) line 11 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) FROM s1.t1 t_1 + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner_one_t(integer) line 11 at SQL statement LOG: pg_hint_plan: used hint: +IndexScan(t_1) not used hint: -HashJoin(t_1 t_1) duplication hint: error hint: -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner_one_t($1) FROM s1.t1 t_1 ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner_one_t(integer) line 11 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) FROM s1.t1 t_1 + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner_one_t(integer) line 11 at SQL statement INFO: hint syntax error at or near "HashJoin(t_1 t_1)" DETAIL: Relation name "t_1" is duplicated. LOG: pg_hint_plan: @@ -4652,21 +4846,21 @@ EXPLAIN (COSTS false) ORDER BY t_1.c1; NOTICE: nested_planner(2) NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement -INFO: hint syntax error at or near "HashJoin(t_1 t_1)" -DETAIL: Relation name "t_1" is duplicated. -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement LOG: pg_hint_plan: used hint: +IndexScan(t_1) not used hint: duplication hint: error hint: -HashJoin(t_1 t_1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement INFO: hint syntax error at or near "HashJoin(t_1 t_1)" DETAIL: Relation name "t_1" is duplicated. LOG: pg_hint_plan: @@ -4695,23 +4889,22 @@ EXPLAIN (COSTS false) INFO: hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)" DETAIL: Conflict join method hint. NOTICE: nested_planner(2) -INFO: hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)" -DETAIL: Conflict join method hint. -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement NOTICE: nested_planner(1) -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement LOG: pg_hint_plan: used hint: -HashJoin(t_1 t_2) +IndexScan(t_1) not used hint: duplication hint: -MergeJoin(t_1 t_2) error hint: -CONTEXT: SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1" -PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement +CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1" +PL/pgSQL function nested_planner(integer) line 12 at SQL statement LOG: pg_hint_plan: used hint: HashJoin(t_1 t_2) diff --git a/sql/ut-A.sql b/sql/ut-A.sql index b4dfd8b..17b7bc6 100644 --- a/sql/ut-A.sql +++ b/sql/ut-A.sql @@ -1074,11 +1074,10 @@ BEGIN RETURN 0; END IF; - EXECUTE '/*+ IndexScan(t_1) */' - ' SELECT nested_planner($1) FROM s1.t1 t_1' - ' JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)' - ' ORDER BY t_1.c1 LIMIT 1' - INTO new_cnt USING cnt - 1; + SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) INTO new_cnt + FROM s1.t1 t_1 + JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) + ORDER BY t_1.c1 LIMIT 1; RETURN new_cnt; END; @@ -1161,10 +1160,9 @@ BEGIN RETURN 0; END IF; - EXECUTE '/*+ IndexScan(t_1) */' - ' SELECT nested_planner_one_t($1) FROM s1.t1 t_1' - ' ORDER BY t_1.c1 LIMIT 1' - INTO new_cnt USING cnt - 1; + SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) INTO new_cnt + FROM s1.t1 t_1 + ORDER BY t_1.c1 LIMIT 1; RETURN new_cnt; END;