diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index 10895fb287..cdf4762c60 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -143,6 +143,8 @@
 /* Hooks for plugins to get control when we ask for stats */
 get_relation_stats_hook_type get_relation_stats_hook = NULL;
 get_index_stats_hook_type get_index_stats_hook = NULL;
+mutate_bounds_hook_type mutate_bounds_hook = NULL;
+
 
 static double eqsel_internal(PG_FUNCTION_ARGS, bool negate);
 static double eqjoinsel_inner(Oid opfuncoid, Oid collation,
@@ -669,6 +671,9 @@ scalarineqsel(PlannerInfo *root, Oid operator, bool isgt, bool iseq,
 
 	fmgr_info(get_opcode(operator), &opproc);
 
+	if (mutate_bounds_hook) {
+		mutate_bounds_hook(root, &constval, isgt, iseq);
+	}
 	/*
 	 * If we have most-common-values info, add up the fractions of the MCV
 	 * entries that satisfy MCV OP CONST.  These fractions contribute directly
diff --git a/src/include/utils/selfuncs.h b/src/include/utils/selfuncs.h
index 9dd444e1ff..b406b0aa2b 100644
--- a/src/include/utils/selfuncs.h
+++ b/src/include/utils/selfuncs.h
@@ -145,6 +145,9 @@ typedef bool (*get_index_stats_hook_type) (PlannerInfo *root,
 										   VariableStatData *vardata);
 extern PGDLLIMPORT get_index_stats_hook_type get_index_stats_hook;
 
+typedef bool (*mutate_bounds_hook_type) (PlannerInfo *root,  Datum *bound, bool isgt, bool iseq);
+extern PGDLLIMPORT mutate_bounds_hook_type mutate_bounds_hook;
+
 /* Functions in selfuncs.c */
 
 extern void examine_variable(PlannerInfo *root, Node *node, int varRelid,
