• R/O
  • HTTP
  • SSH
  • HTTPS

pg_hint_plan: Commit

firtst release


Commit MetaInfo

Revision1ebd8cda012b78cdbff640ea2e4c04a746204162 (tree)
Zeit2013-09-17 15:01:00
AutorTakashi Suzuki <suzuki.takashi@metr...>
CommiterTakashi Suzuki

Log Message

A-13-4の試験の内容を項目表にあうように変更した。

Ändern Zusammenfassung

Diff

--- a/expected/ut-A-9.1.out
+++ b/expected/ut-A-9.1.out
@@ -4236,18 +4236,26 @@ error hint:
42364236 ----
42374237 ---- No. A-13-4 output of debugging log on hint status
42384238 ----
4239+CREATE OR REPLACE FUNCTION recall_planner() RETURNS int AS $$
4240+ SELECT /*+ IndexScan(t_1) */t_1.c1
4241+ FROM s1.t1 t_1
4242+ JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4243+ ORDER BY t_1.c1 LIMIT 1;
4244+$$ LANGUAGE SQL IMMUTABLE;
42394245 --No.13-4-1
42404246 /*+HashJoin(t_1 t_2)*/
42414247 EXPLAIN (COSTS false)
4242- SELECT nested_planner(2) FROM s1.t1 t_1
4248+ SELECT recall_planner() FROM s1.t1 t_1
42434249 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
42444250 ORDER BY t_1.c1;
4245-NOTICE: nested_planner(2)
4246-NOTICE: nested_planner(1)
4247-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
4248- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4249- ORDER BY t_1.c1 LIMIT 1"
4250-PL/pgSQL function "nested_planner" line 12 at SQL statement
4251+LOG: pg_hint_plan:
4252+used hint:
4253+HashJoin(t_1 t_2)
4254+not used hint:
4255+duplication hint:
4256+error hint:
4257+
4258+CONTEXT: SQL function "recall_planner" during startup
42514259 LOG: pg_hint_plan:
42524260 used hint:
42534261 HashJoin(t_1 t_2)
@@ -4269,15 +4277,17 @@ error hint:
42694277 --No.13-4-2
42704278 /*+HashJoin(st_1 st_2)*/
42714279 EXPLAIN (COSTS false)
4272- SELECT nested_planner(2) FROM s1.t1 st_1
4280+ SELECT recall_planner() FROM s1.t1 st_1
42734281 JOIN s1.t2 st_2 ON (st_1.c1 = st_2.c1)
42744282 ORDER BY st_1.c1;
4275-NOTICE: nested_planner(2)
4276-NOTICE: nested_planner(1)
4277-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
4278- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4279- ORDER BY t_1.c1 LIMIT 1"
4280-PL/pgSQL function "nested_planner" line 12 at SQL statement
4283+LOG: pg_hint_plan:
4284+used hint:
4285+not used hint:
4286+HashJoin(st_1 st_2)
4287+duplication hint:
4288+error hint:
4289+
4290+CONTEXT: SQL function "recall_planner" during startup
42814291 LOG: pg_hint_plan:
42824292 used hint:
42834293 HashJoin(st_1 st_2)
@@ -4299,15 +4309,17 @@ error hint:
42994309 --No.13-4-3
43004310 /*+HashJoin(t_1 t_2)*/
43014311 EXPLAIN (COSTS false)
4302- SELECT nested_planner(2) FROM s1.t1 st_1
4312+ SELECT recall_planner() FROM s1.t1 st_1
43034313 JOIN s1.t2 st_2 ON (st_1.c1 = st_2.c1)
43044314 ORDER BY st_1.c1;
4305-NOTICE: nested_planner(2)
4306-NOTICE: nested_planner(1)
4307-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
4308- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4309- ORDER BY t_1.c1 LIMIT 1"
4310-PL/pgSQL function "nested_planner" line 12 at SQL statement
4315+LOG: pg_hint_plan:
4316+used hint:
4317+HashJoin(t_1 t_2)
4318+not used hint:
4319+duplication hint:
4320+error hint:
4321+
4322+CONTEXT: SQL function "recall_planner" during startup
43114323 LOG: pg_hint_plan:
43124324 used hint:
43134325 not used hint:
@@ -4328,15 +4340,17 @@ error hint:
43284340 --No.13-4-4
43294341 /*+HashJoin(st_1 st_2)*/
43304342 EXPLAIN (COSTS false)
4331- SELECT nested_planner(2) FROM s1.t1 t_1
4343+ SELECT recall_planner() FROM s1.t1 t_1
43324344 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
43334345 ORDER BY t_1.c1;
4334-NOTICE: nested_planner(2)
4335-NOTICE: nested_planner(1)
4336-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
4337- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4338- ORDER BY t_1.c1 LIMIT 1"
4339-PL/pgSQL function "nested_planner" line 12 at SQL statement
4346+LOG: pg_hint_plan:
4347+used hint:
4348+not used hint:
4349+HashJoin(st_1 st_2)
4350+duplication hint:
4351+error hint:
4352+
4353+CONTEXT: SQL function "recall_planner" during startup
43404354 LOG: pg_hint_plan:
43414355 used hint:
43424356 not used hint:
@@ -4357,14 +4371,19 @@ error hint:
43574371 --No.13-4-5
43584372 /*+HashJoin(t_1 t_1)*/
43594373 EXPLAIN (COSTS false)
4360- SELECT nested_planner(2) FROM s1.t1 t_1
4374+ SELECT recall_planner() FROM s1.t1 t_1
43614375 ORDER BY t_1.c1;
4362-NOTICE: nested_planner(2)
4363-NOTICE: nested_planner(1)
4364-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
4365- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4366- ORDER BY t_1.c1 LIMIT 1"
4367-PL/pgSQL function "nested_planner" line 12 at SQL statement
4376+INFO: hint syntax error at or near "HashJoin(t_1 t_1)"
4377+DETAIL: Relation name "t_1" is duplicated.
4378+CONTEXT: SQL function "recall_planner" during startup
4379+LOG: pg_hint_plan:
4380+used hint:
4381+not used hint:
4382+duplication hint:
4383+error hint:
4384+HashJoin(t_1 t_1)
4385+
4386+CONTEXT: SQL function "recall_planner" during startup
43684387 LOG: pg_hint_plan:
43694388 used hint:
43704389 not used hint:
@@ -4378,54 +4397,15 @@ error hint:
43784397 (1 row)
43794398
43804399 --No.13-4-6
4381-CREATE OR REPLACE FUNCTION nested_planner_one_t(cnt int) RETURNS int AS $$
4382-DECLARE
4383- new_cnt int;
4384-BEGIN
4385- RAISE NOTICE 'nested_planner_one_t(%)', cnt;
4386-
4387- IF cnt <= 1 THEN
4388- RETURN 0;
4389- END IF;
4390-
4391- SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) INTO new_cnt
4400+CREATE OR REPLACE FUNCTION recall_planner_one_t() RETURNS int AS $$
4401+ SELECT /*+ IndexScan(t_1) */t_1.c1
43924402 FROM s1.t1 t_1
43934403 ORDER BY t_1.c1 LIMIT 1;
4394-
4395- RETURN new_cnt;
4396-END;
4397-$$ LANGUAGE plpgsql IMMUTABLE;
4404+$$ LANGUAGE SQL IMMUTABLE;
43984405 EXPLAIN (COSTS false)
4399- SELECT nested_planner_one_t(2) FROM s1.t1 t_1
4406+ SELECT recall_planner_one_t() FROM s1.t1 t_1
44004407 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
44014408 ORDER BY t_1.c1;
4402-NOTICE: nested_planner_one_t(2)
4403-LOG: pg_hint_plan:
4404-used hint:
4405-IndexScan(t_1)
4406-not used hint:
4407-duplication hint:
4408-error hint:
4409-
4410-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) FROM s1.t1 t_1
4411- ORDER BY t_1.c1 LIMIT 1"
4412-PL/pgSQL function "nested_planner_one_t" line 11 at SQL statement
4413-NOTICE: nested_planner_one_t(1)
4414-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) FROM s1.t1 t_1
4415- ORDER BY t_1.c1 LIMIT 1"
4416-PL/pgSQL function "nested_planner_one_t" line 11 at SQL statement
4417-LOG: pg_hint_plan:
4418-used hint:
4419-not used hint:
4420-IndexScan(t_1)
4421-duplication hint:
4422-error hint:
4423-
4424-CONTEXT: SQL statement "SELECT 0"
4425-PL/pgSQL function "nested_planner_one_t" line 8 at RETURN
4426-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) FROM s1.t1 t_1
4427- ORDER BY t_1.c1 LIMIT 1"
4428-PL/pgSQL function "nested_planner_one_t" line 11 at SQL statement
44294409 QUERY PLAN
44304410 ----------------------------------------
44314411 Merge Join
@@ -4438,14 +4418,17 @@ PL/pgSQL function "nested_planner_one_t" line 11 at SQL statement
44384418
44394419 /*+HashJoin(t_1 t_1)*/
44404420 EXPLAIN (COSTS false)
4441- SELECT nested_planner_one_t(2) FROM s1.t1 t_1
4421+ SELECT recall_planner_one_t() FROM s1.t1 t_1
44424422 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
44434423 ORDER BY t_1.c1;
4444-NOTICE: nested_planner_one_t(2)
4445-NOTICE: nested_planner_one_t(1)
4446-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) FROM s1.t1 t_1
4447- ORDER BY t_1.c1 LIMIT 1"
4448-PL/pgSQL function "nested_planner_one_t" line 11 at SQL statement
4424+LOG: pg_hint_plan:
4425+used hint:
4426+not used hint:
4427+HashJoin(t_1 t_1)
4428+duplication hint:
4429+error hint:
4430+
4431+CONTEXT: SQL function "recall_planner_one_t" during startup
44494432 INFO: hint syntax error at or near "HashJoin(t_1 t_1)"
44504433 DETAIL: Relation name "t_1" is duplicated.
44514434 LOG: pg_hint_plan:
@@ -4465,19 +4448,25 @@ HashJoin(t_1 t_1)
44654448 -> Seq Scan on t2 t_2
44664449 (6 rows)
44674450
4468-DROP FUNCTION nested_planner_one_t(int);
4451+DROP FUNCTION recall_planner_one_t(int);
4452+ERROR: function recall_planner_one_t(integer) does not exist
44694453 --No.13-4-7
44704454 /*+HashJoin(t_1 t_1)*/
44714455 EXPLAIN (COSTS false)
4472- SELECT nested_planner(2) FROM s1.t1 t_1
4456+ SELECT recall_planner() FROM s1.t1 t_1
44734457 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
44744458 ORDER BY t_1.c1;
4475-NOTICE: nested_planner(2)
4476-NOTICE: nested_planner(1)
4477-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
4478- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4479- ORDER BY t_1.c1 LIMIT 1"
4480-PL/pgSQL function "nested_planner" line 12 at SQL statement
4459+INFO: hint syntax error at or near "HashJoin(t_1 t_1)"
4460+DETAIL: Relation name "t_1" is duplicated.
4461+CONTEXT: SQL function "recall_planner" during startup
4462+LOG: pg_hint_plan:
4463+used hint:
4464+not used hint:
4465+duplication hint:
4466+error hint:
4467+HashJoin(t_1 t_1)
4468+
4469+CONTEXT: SQL function "recall_planner" during startup
44814470 INFO: hint syntax error at or near "HashJoin(t_1 t_1)"
44824471 DETAIL: Relation name "t_1" is duplicated.
44834472 LOG: pg_hint_plan:
@@ -4500,17 +4489,23 @@ HashJoin(t_1 t_1)
45004489 --No.13-4-8
45014490 /*+MergeJoin(t_1 t_2)HashJoin(t_1 t_2)*/
45024491 EXPLAIN (COSTS false)
4503- SELECT nested_planner(2) FROM s1.t1 t_1
4492+ SELECT recall_planner() FROM s1.t1 t_1
45044493 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
45054494 ORDER BY t_1.c1;
45064495 INFO: hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)"
45074496 DETAIL: Conflict join method hint.
4508-NOTICE: nested_planner(2)
4509-NOTICE: nested_planner(1)
4510-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
4511- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4512- ORDER BY t_1.c1 LIMIT 1"
4513-PL/pgSQL function "nested_planner" line 12 at SQL statement
4497+INFO: hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)"
4498+DETAIL: Conflict join method hint.
4499+CONTEXT: SQL function "recall_planner" during startup
4500+LOG: pg_hint_plan:
4501+used hint:
4502+HashJoin(t_1 t_2)
4503+not used hint:
4504+duplication hint:
4505+MergeJoin(t_1 t_2)
4506+error hint:
4507+
4508+CONTEXT: SQL function "recall_planner" during startup
45144509 LOG: pg_hint_plan:
45154510 used hint:
45164511 HashJoin(t_1 t_2)
--- a/expected/ut-A-9.2.out
+++ b/expected/ut-A-9.2.out
@@ -4544,29 +4544,26 @@ error hint:
45444544 ----
45454545 ---- No. A-13-4 output of debugging log on hint status
45464546 ----
4547+CREATE OR REPLACE FUNCTION recall_planner() RETURNS int AS $$
4548+ SELECT /*+ IndexScan(t_1) */t_1.c1
4549+ FROM s1.t1 t_1
4550+ JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4551+ ORDER BY t_1.c1 LIMIT 1;
4552+$$ LANGUAGE SQL IMMUTABLE;
45474553 --No.13-4-1
45484554 /*+HashJoin(t_1 t_2)*/
45494555 EXPLAIN (COSTS false)
4550- SELECT nested_planner(2) FROM s1.t1 t_1
4556+ SELECT recall_planner() FROM s1.t1 t_1
45514557 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
45524558 ORDER BY t_1.c1;
4553-NOTICE: nested_planner(2)
4554-NOTICE: nested_planner(1)
4555-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
4556- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4557- ORDER BY t_1.c1 LIMIT 1"
4558-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
45594559 LOG: pg_hint_plan:
45604560 used hint:
4561-IndexScan(t_1)
4561+HashJoin(t_1 t_2)
45624562 not used hint:
45634563 duplication hint:
45644564 error hint:
45654565
4566-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
4567- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4568- ORDER BY t_1.c1 LIMIT 1"
4569-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
4566+CONTEXT: SQL function "recall_planner" during startup
45704567 LOG: pg_hint_plan:
45714568 used hint:
45724569 HashJoin(t_1 t_2)
@@ -4588,26 +4585,17 @@ error hint:
45884585 --No.13-4-2
45894586 /*+HashJoin(st_1 st_2)*/
45904587 EXPLAIN (COSTS false)
4591- SELECT nested_planner(2) FROM s1.t1 st_1
4588+ SELECT recall_planner() FROM s1.t1 st_1
45924589 JOIN s1.t2 st_2 ON (st_1.c1 = st_2.c1)
45934590 ORDER BY st_1.c1;
4594-NOTICE: nested_planner(2)
4595-NOTICE: nested_planner(1)
4596-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
4597- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4598- ORDER BY t_1.c1 LIMIT 1"
4599-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
46004591 LOG: pg_hint_plan:
46014592 used hint:
4602-IndexScan(t_1)
46034593 not used hint:
4594+HashJoin(st_1 st_2)
46044595 duplication hint:
46054596 error hint:
46064597
4607-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
4608- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4609- ORDER BY t_1.c1 LIMIT 1"
4610-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
4598+CONTEXT: SQL function "recall_planner" during startup
46114599 LOG: pg_hint_plan:
46124600 used hint:
46134601 HashJoin(st_1 st_2)
@@ -4629,26 +4617,17 @@ error hint:
46294617 --No.13-4-3
46304618 /*+HashJoin(t_1 t_2)*/
46314619 EXPLAIN (COSTS false)
4632- SELECT nested_planner(2) FROM s1.t1 st_1
4620+ SELECT recall_planner() FROM s1.t1 st_1
46334621 JOIN s1.t2 st_2 ON (st_1.c1 = st_2.c1)
46344622 ORDER BY st_1.c1;
4635-NOTICE: nested_planner(2)
4636-NOTICE: nested_planner(1)
4637-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
4638- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4639- ORDER BY t_1.c1 LIMIT 1"
4640-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
46414623 LOG: pg_hint_plan:
46424624 used hint:
4643-IndexScan(t_1)
4625+HashJoin(t_1 t_2)
46444626 not used hint:
46454627 duplication hint:
46464628 error hint:
46474629
4648-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
4649- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4650- ORDER BY t_1.c1 LIMIT 1"
4651-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
4630+CONTEXT: SQL function "recall_planner" during startup
46524631 LOG: pg_hint_plan:
46534632 used hint:
46544633 not used hint:
@@ -4669,26 +4648,17 @@ error hint:
46694648 --No.13-4-4
46704649 /*+HashJoin(st_1 st_2)*/
46714650 EXPLAIN (COSTS false)
4672- SELECT nested_planner(2) FROM s1.t1 t_1
4651+ SELECT recall_planner() FROM s1.t1 t_1
46734652 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
46744653 ORDER BY t_1.c1;
4675-NOTICE: nested_planner(2)
4676-NOTICE: nested_planner(1)
4677-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
4678- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4679- ORDER BY t_1.c1 LIMIT 1"
4680-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
46814654 LOG: pg_hint_plan:
46824655 used hint:
4683-IndexScan(t_1)
46844656 not used hint:
4657+HashJoin(st_1 st_2)
46854658 duplication hint:
46864659 error hint:
46874660
4688-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
4689- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4690- ORDER BY t_1.c1 LIMIT 1"
4691-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
4661+CONTEXT: SQL function "recall_planner" during startup
46924662 LOG: pg_hint_plan:
46934663 used hint:
46944664 not used hint:
@@ -4709,25 +4679,19 @@ error hint:
47094679 --No.13-4-5
47104680 /*+HashJoin(t_1 t_1)*/
47114681 EXPLAIN (COSTS false)
4712- SELECT nested_planner(2) FROM s1.t1 t_1
4682+ SELECT recall_planner() FROM s1.t1 t_1
47134683 ORDER BY t_1.c1;
4714-NOTICE: nested_planner(2)
4715-NOTICE: nested_planner(1)
4716-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
4717- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4718- ORDER BY t_1.c1 LIMIT 1"
4719-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
4684+INFO: hint syntax error at or near "HashJoin(t_1 t_1)"
4685+DETAIL: Relation name "t_1" is duplicated.
4686+CONTEXT: SQL function "recall_planner" during startup
47204687 LOG: pg_hint_plan:
47214688 used hint:
4722-IndexScan(t_1)
47234689 not used hint:
47244690 duplication hint:
47254691 error hint:
4692+HashJoin(t_1 t_1)
47264693
4727-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
4728- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4729- ORDER BY t_1.c1 LIMIT 1"
4730-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
4694+CONTEXT: SQL function "recall_planner" during startup
47314695 LOG: pg_hint_plan:
47324696 used hint:
47334697 not used hint:
@@ -4741,53 +4705,15 @@ error hint:
47414705 (1 row)
47424706
47434707 --No.13-4-6
4744-CREATE OR REPLACE FUNCTION nested_planner_one_t(cnt int) RETURNS int AS $$
4745-DECLARE
4746- new_cnt int;
4747-BEGIN
4748- RAISE NOTICE 'nested_planner_one_t(%)', cnt;
4749-
4750- IF cnt <= 1 THEN
4751- RETURN 0;
4752- END IF;
4753-
4754- SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) INTO new_cnt
4708+CREATE OR REPLACE FUNCTION recall_planner_one_t() RETURNS int AS $$
4709+ SELECT /*+ IndexScan(t_1) */t_1.c1
47554710 FROM s1.t1 t_1
47564711 ORDER BY t_1.c1 LIMIT 1;
4757-
4758- RETURN new_cnt;
4759-END;
4760-$$ LANGUAGE plpgsql IMMUTABLE;
4712+$$ LANGUAGE SQL IMMUTABLE;
47614713 EXPLAIN (COSTS false)
4762- SELECT nested_planner_one_t(2) FROM s1.t1 t_1
4714+ SELECT recall_planner_one_t() FROM s1.t1 t_1
47634715 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
47644716 ORDER BY t_1.c1;
4765-NOTICE: nested_planner_one_t(2)
4766-NOTICE: nested_planner_one_t(1)
4767-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) FROM s1.t1 t_1
4768- ORDER BY t_1.c1 LIMIT 1"
4769-PL/pgSQL function nested_planner_one_t(integer) line 11 at SQL statement
4770-LOG: pg_hint_plan:
4771-used hint:
4772-not used hint:
4773-IndexScan(t_1)
4774-duplication hint:
4775-error hint:
4776-
4777-CONTEXT: PL/pgSQL function nested_planner_one_t(integer) line 8 at RETURN
4778-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) FROM s1.t1 t_1
4779- ORDER BY t_1.c1 LIMIT 1"
4780-PL/pgSQL function nested_planner_one_t(integer) line 11 at SQL statement
4781-LOG: pg_hint_plan:
4782-used hint:
4783-IndexScan(t_1)
4784-not used hint:
4785-duplication hint:
4786-error hint:
4787-
4788-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) FROM s1.t1 t_1
4789- ORDER BY t_1.c1 LIMIT 1"
4790-PL/pgSQL function nested_planner_one_t(integer) line 11 at SQL statement
47914717 QUERY PLAN
47924718 ---------------------------------------------
47934719 Merge Join
@@ -4800,24 +4726,17 @@ PL/pgSQL function nested_planner_one_t(integer) line 11 at SQL statement
48004726
48014727 /*+HashJoin(t_1 t_1)*/
48024728 EXPLAIN (COSTS false)
4803- SELECT nested_planner_one_t(2) FROM s1.t1 t_1
4729+ SELECT recall_planner_one_t() FROM s1.t1 t_1
48044730 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
48054731 ORDER BY t_1.c1;
4806-NOTICE: nested_planner_one_t(2)
4807-NOTICE: nested_planner_one_t(1)
4808-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) FROM s1.t1 t_1
4809- ORDER BY t_1.c1 LIMIT 1"
4810-PL/pgSQL function nested_planner_one_t(integer) line 11 at SQL statement
48114732 LOG: pg_hint_plan:
48124733 used hint:
4813-IndexScan(t_1)
48144734 not used hint:
4735+HashJoin(t_1 t_1)
48154736 duplication hint:
48164737 error hint:
48174738
4818-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) FROM s1.t1 t_1
4819- ORDER BY t_1.c1 LIMIT 1"
4820-PL/pgSQL function nested_planner_one_t(integer) line 11 at SQL statement
4739+CONTEXT: SQL function "recall_planner_one_t" during startup
48214740 INFO: hint syntax error at or near "HashJoin(t_1 t_1)"
48224741 DETAIL: Relation name "t_1" is duplicated.
48234742 LOG: pg_hint_plan:
@@ -4837,30 +4756,25 @@ HashJoin(t_1 t_1)
48374756 -> Seq Scan on t2 t_2
48384757 (6 rows)
48394758
4840-DROP FUNCTION nested_planner_one_t(int);
4759+DROP FUNCTION recall_planner_one_t(int);
4760+ERROR: function recall_planner_one_t(integer) does not exist
48414761 --No.13-4-7
48424762 /*+HashJoin(t_1 t_1)*/
48434763 EXPLAIN (COSTS false)
4844- SELECT nested_planner(2) FROM s1.t1 t_1
4764+ SELECT recall_planner() FROM s1.t1 t_1
48454765 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
48464766 ORDER BY t_1.c1;
4847-NOTICE: nested_planner(2)
4848-NOTICE: nested_planner(1)
4849-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
4850- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4851- ORDER BY t_1.c1 LIMIT 1"
4852-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
4767+INFO: hint syntax error at or near "HashJoin(t_1 t_1)"
4768+DETAIL: Relation name "t_1" is duplicated.
4769+CONTEXT: SQL function "recall_planner" during startup
48534770 LOG: pg_hint_plan:
48544771 used hint:
4855-IndexScan(t_1)
48564772 not used hint:
48574773 duplication hint:
48584774 error hint:
4775+HashJoin(t_1 t_1)
48594776
4860-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
4861- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4862- ORDER BY t_1.c1 LIMIT 1"
4863-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
4777+CONTEXT: SQL function "recall_planner" during startup
48644778 INFO: hint syntax error at or near "HashJoin(t_1 t_1)"
48654779 DETAIL: Relation name "t_1" is duplicated.
48664780 LOG: pg_hint_plan:
@@ -4883,28 +4797,23 @@ HashJoin(t_1 t_1)
48834797 --No.13-4-8
48844798 /*+MergeJoin(t_1 t_2)HashJoin(t_1 t_2)*/
48854799 EXPLAIN (COSTS false)
4886- SELECT nested_planner(2) FROM s1.t1 t_1
4800+ SELECT recall_planner() FROM s1.t1 t_1
48874801 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
48884802 ORDER BY t_1.c1;
48894803 INFO: hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)"
48904804 DETAIL: Conflict join method hint.
4891-NOTICE: nested_planner(2)
4892-NOTICE: nested_planner(1)
4893-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
4894- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4895- ORDER BY t_1.c1 LIMIT 1"
4896-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
4805+INFO: hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)"
4806+DETAIL: Conflict join method hint.
4807+CONTEXT: SQL function "recall_planner" during startup
48974808 LOG: pg_hint_plan:
48984809 used hint:
4899-IndexScan(t_1)
4810+HashJoin(t_1 t_2)
49004811 not used hint:
49014812 duplication hint:
4813+MergeJoin(t_1 t_2)
49024814 error hint:
49034815
4904-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
4905- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4906- ORDER BY t_1.c1 LIMIT 1"
4907-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
4816+CONTEXT: SQL function "recall_planner" during startup
49084817 LOG: pg_hint_plan:
49094818 used hint:
49104819 HashJoin(t_1 t_2)
--- a/sql/ut-A.sql
+++ b/sql/ut-A.sql
@@ -1114,82 +1114,76 @@ EXPLAIN (COSTS false) SELECT nested_planner(5) FROM s1.t1 t_1 ORDER BY t_1.c1;
11141114 ----
11151115 ---- No. A-13-4 output of debugging log on hint status
11161116 ----
1117+CREATE OR REPLACE FUNCTION recall_planner() RETURNS int AS $$
1118+ SELECT /*+ IndexScan(t_1) */t_1.c1
1119+ FROM s1.t1 t_1
1120+ JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
1121+ ORDER BY t_1.c1 LIMIT 1;
1122+$$ LANGUAGE SQL IMMUTABLE;
11171123
11181124 --No.13-4-1
11191125 /*+HashJoin(t_1 t_2)*/
11201126 EXPLAIN (COSTS false)
1121- SELECT nested_planner(2) FROM s1.t1 t_1
1127+ SELECT recall_planner() FROM s1.t1 t_1
11221128 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
11231129 ORDER BY t_1.c1;
11241130
11251131 --No.13-4-2
11261132 /*+HashJoin(st_1 st_2)*/
11271133 EXPLAIN (COSTS false)
1128- SELECT nested_planner(2) FROM s1.t1 st_1
1134+ SELECT recall_planner() FROM s1.t1 st_1
11291135 JOIN s1.t2 st_2 ON (st_1.c1 = st_2.c1)
11301136 ORDER BY st_1.c1;
11311137
11321138 --No.13-4-3
11331139 /*+HashJoin(t_1 t_2)*/
11341140 EXPLAIN (COSTS false)
1135- SELECT nested_planner(2) FROM s1.t1 st_1
1141+ SELECT recall_planner() FROM s1.t1 st_1
11361142 JOIN s1.t2 st_2 ON (st_1.c1 = st_2.c1)
11371143 ORDER BY st_1.c1;
11381144
11391145 --No.13-4-4
11401146 /*+HashJoin(st_1 st_2)*/
11411147 EXPLAIN (COSTS false)
1142- SELECT nested_planner(2) FROM s1.t1 t_1
1148+ SELECT recall_planner() FROM s1.t1 t_1
11431149 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
11441150 ORDER BY t_1.c1;
11451151
11461152 --No.13-4-5
11471153 /*+HashJoin(t_1 t_1)*/
11481154 EXPLAIN (COSTS false)
1149- SELECT nested_planner(2) FROM s1.t1 t_1
1155+ SELECT recall_planner() FROM s1.t1 t_1
11501156 ORDER BY t_1.c1;
11511157
11521158 --No.13-4-6
1153-CREATE OR REPLACE FUNCTION nested_planner_one_t(cnt int) RETURNS int AS $$
1154-DECLARE
1155- new_cnt int;
1156-BEGIN
1157- RAISE NOTICE 'nested_planner_one_t(%)', cnt;
1158-
1159- IF cnt <= 1 THEN
1160- RETURN 0;
1161- END IF;
1162-
1163- SELECT /*+ IndexScan(t_1) */ nested_planner_one_t(cnt - 1) INTO new_cnt
1159+CREATE OR REPLACE FUNCTION recall_planner_one_t() RETURNS int AS $$
1160+ SELECT /*+ IndexScan(t_1) */t_1.c1
11641161 FROM s1.t1 t_1
11651162 ORDER BY t_1.c1 LIMIT 1;
1166-
1167- RETURN new_cnt;
1168-END;
1169-$$ LANGUAGE plpgsql IMMUTABLE;
1163+$$ LANGUAGE SQL IMMUTABLE;
11701164
11711165 EXPLAIN (COSTS false)
1172- SELECT nested_planner_one_t(2) FROM s1.t1 t_1
1166+ SELECT recall_planner_one_t() FROM s1.t1 t_1
11731167 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
11741168 ORDER BY t_1.c1;
11751169 /*+HashJoin(t_1 t_1)*/
11761170 EXPLAIN (COSTS false)
1177- SELECT nested_planner_one_t(2) FROM s1.t1 t_1
1171+ SELECT recall_planner_one_t() FROM s1.t1 t_1
11781172 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
11791173 ORDER BY t_1.c1;
11801174
1181-DROP FUNCTION nested_planner_one_t(int);
1175+DROP FUNCTION recall_planner_one_t(int);
11821176
11831177 --No.13-4-7
11841178 /*+HashJoin(t_1 t_1)*/
11851179 EXPLAIN (COSTS false)
1186- SELECT nested_planner(2) FROM s1.t1 t_1
1180+ SELECT recall_planner() FROM s1.t1 t_1
11871181 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
11881182 ORDER BY t_1.c1;
11891183
11901184 --No.13-4-8
11911185 /*+MergeJoin(t_1 t_2)HashJoin(t_1 t_2)*/
11921186 EXPLAIN (COSTS false)
1193- SELECT nested_planner(2) FROM s1.t1 t_1
1187+ SELECT recall_planner() FROM s1.t1 t_1
11941188 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
11951189 ORDER BY t_1.c1;
Show on old repository browser