• R/O
  • HTTP
  • SSH
  • HTTPS

pg_hint_plan: コミット

firtst release


コミットメタ情報

リビジョン066f0649c604b6a672bca3c3e51311769c5b3d81 (tree)
日時2018-06-08 14:12:56
作者Kyotaro Horiguchi <horiguchi.kyotaro@lab....>
コミッターKyotaro Horiguchi

ログメッセージ

Took in core improvement.

Took in the following commit of core.

80e12a6218 Change more places to be less trusting of RestrictInfo.is_pushed_down.

Fixed typos and removed useless include on the way.

変更サマリ

差分

--- a/core.c
+++ b/core.c
@@ -20,7 +20,7 @@
2020 * mark_dummy_rel()
2121 * restriction_is_constant_false()
2222 *
23- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
23+ * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
2424 * Portions Copyright (c) 1994, Regents of the University of California
2525 *
2626 *-------------------------------------------------------------------------
@@ -1224,18 +1224,21 @@ mark_dummy_rel(RelOptInfo *rel)
12241224 }
12251225
12261226 /*
1227- * restriction_is_constant_false --- is a restrictlist just FALSE?
1227+ * restriction_is_constant_false --- is a restrictlist just false?
12281228 *
1229- * In cases where a qual is provably constant FALSE, eval_const_expressions
1229+ * In cases where a qual is provably constant false, eval_const_expressions
12301230 * will generally have thrown away anything that's ANDed with it. In outer
12311231 * join situations this will leave us computing cartesian products only to
12321232 * decide there's no match for an outer row, which is pretty stupid. So,
12331233 * we need to detect the case.
12341234 *
1235- * If only_pushed_down is TRUE, then consider only pushed-down quals.
1235+ * If only_pushed_down is true, then consider only quals that are pushed-down
1236+ * from the point of view of the joinrel.
12361237 */
12371238 static bool
1238-restriction_is_constant_false(List *restrictlist, bool only_pushed_down)
1239+restriction_is_constant_false(List *restrictlist,
1240+ RelOptInfo *joinrel,
1241+ bool only_pushed_down)
12391242 {
12401243 ListCell *lc;
12411244
@@ -1250,7 +1253,7 @@ restriction_is_constant_false(List *restrictlist, bool only_pushed_down)
12501253 RestrictInfo *rinfo = (RestrictInfo *) lfirst(lc);
12511254
12521255 Assert(IsA(rinfo, RestrictInfo));
1253- if (only_pushed_down && !rinfo->is_pushed_down)
1256+ if (only_pushed_down && !RINFO_IS_PUSHED_DOWN(rinfo, joinrel->relids))
12541257 continue;
12551258
12561259 if (rinfo->clause && IsA(rinfo->clause, Const))
--- a/make_join_rel.c
+++ b/make_join_rel.c
@@ -6,8 +6,8 @@
66 * src/backend/optimizer/path/joinrels.c
77 * make_join_rel()
88 *
9- * Portions Copyright (c) 2013-2014, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
10- * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
9+ * Portions Copyright (c) 2013-2018, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
10+ * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
1111 * Portions Copyright (c) 1994, Regents of the University of California
1212 *
1313 *-------------------------------------------------------------------------
@@ -229,7 +229,7 @@ make_join_rel(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2)
229229 {
230230 case JOIN_INNER:
231231 if (is_dummy_rel(rel1) || is_dummy_rel(rel2) ||
232- restriction_is_constant_false(restrictlist, false))
232+ restriction_is_constant_false(restrictlist, joinrel, false))
233233 {
234234 mark_dummy_rel(joinrel);
235235 break;
@@ -243,12 +243,12 @@ make_join_rel(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2)
243243 break;
244244 case JOIN_LEFT:
245245 if (is_dummy_rel(rel1) ||
246- restriction_is_constant_false(restrictlist, true))
246+ restriction_is_constant_false(restrictlist, joinrel, true))
247247 {
248248 mark_dummy_rel(joinrel);
249249 break;
250250 }
251- if (restriction_is_constant_false(restrictlist, false) &&
251+ if (restriction_is_constant_false(restrictlist, joinrel, false) &&
252252 bms_is_subset(rel2->relids, sjinfo->syn_righthand))
253253 mark_dummy_rel(rel2);
254254 add_paths_to_joinrel(root, joinrel, rel1, rel2,
@@ -260,7 +260,7 @@ make_join_rel(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2)
260260 break;
261261 case JOIN_FULL:
262262 if ((is_dummy_rel(rel1) && is_dummy_rel(rel2)) ||
263- restriction_is_constant_false(restrictlist, true))
263+ restriction_is_constant_false(restrictlist, joinrel, true))
264264 {
265265 mark_dummy_rel(joinrel);
266266 break;
@@ -296,7 +296,7 @@ make_join_rel(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2)
296296 bms_is_subset(sjinfo->min_righthand, rel2->relids))
297297 {
298298 if (is_dummy_rel(rel1) || is_dummy_rel(rel2) ||
299- restriction_is_constant_false(restrictlist, false))
299+ restriction_is_constant_false(restrictlist, joinrel, false))
300300 {
301301 mark_dummy_rel(joinrel);
302302 break;
@@ -319,7 +319,7 @@ make_join_rel(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2)
319319 sjinfo) != NULL)
320320 {
321321 if (is_dummy_rel(rel1) || is_dummy_rel(rel2) ||
322- restriction_is_constant_false(restrictlist, false))
322+ restriction_is_constant_false(restrictlist, joinrel, false))
323323 {
324324 mark_dummy_rel(joinrel);
325325 break;
@@ -334,12 +334,12 @@ make_join_rel(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2)
334334 break;
335335 case JOIN_ANTI:
336336 if (is_dummy_rel(rel1) ||
337- restriction_is_constant_false(restrictlist, true))
337+ restriction_is_constant_false(restrictlist, joinrel, true))
338338 {
339339 mark_dummy_rel(joinrel);
340340 break;
341341 }
342- if (restriction_is_constant_false(restrictlist, false) &&
342+ if (restriction_is_constant_false(restrictlist, joinrel, false) &&
343343 bms_is_subset(rel2->relids, sjinfo->syn_righthand))
344344 mark_dummy_rel(rel2);
345345 add_paths_to_joinrel(root, joinrel, rel1, rel2,
--- a/pg_stat_statements.c
+++ b/pg_stat_statements.c
@@ -10,8 +10,6 @@
1010 */
1111 #include "postgres.h"
1212
13-#include <sys/stat.h>
14-
1513 #include "access/hash.h"
1614 #include "parser/scanner.h"
1715
旧リポジトリブラウザで表示