summaryrefslogtreecommitdiff
path: root/src/include/statistics/extended_stats_internal.h
diff options
context:
space:
mode:
authorTomas Vondra2019-07-19 14:28:28 +0000
committerTomas Vondra2019-07-20 14:37:30 +0000
commite38a55ba46bbd2510baccdbaa01298cbca972b88 (patch)
treeffe8d65df95070437e606d65b2ae3084cdbb1344 /src/include/statistics/extended_stats_internal.h
parent6f40ee4f837ec1ac59c8ddc73b67a04978a184d5 (diff)
Rework examine_opclause_expression to use varonleft
The examine_opclause_expression function needs to return information on which side of the operator we found the Var, but the variable was called "isgt" which is rather misleading (it assumes the operator is either less-than or greater-than, but it may be equality or something else). Other places in the planner use a variable called "varonleft" for this purpose, so just adopt the same convention here. The code also assumed we don't care about this flag for equality, as (Var = Const) and (Const = Var) should be the same thing. But that does not work for cross-type operators, in which case we need to pass the parameters to the procedure in the right order. So just use the same code for all types of expressions. This means we don't need to care about the selectivity estimation function anymore, at least not in this code. We should only get the supported cases here (thanks to statext_is_compatible_clause). Reviewed-by: Tom Lane Discussion: https://postgr.es/m/8736jdhbhc.fsf%40ansel.ydns.eu Backpatch-to: 12
Diffstat (limited to 'src/include/statistics/extended_stats_internal.h')
-rw-r--r--src/include/statistics/extended_stats_internal.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/statistics/extended_stats_internal.h b/src/include/statistics/extended_stats_internal.h
index c7f01d4edc7..8433c34f6d7 100644
--- a/src/include/statistics/extended_stats_internal.h
+++ b/src/include/statistics/extended_stats_internal.h
@@ -98,7 +98,7 @@ extern SortItem *build_sorted_items(int numrows, int *nitems, HeapTuple *rows,
int numattrs, AttrNumber *attnums);
extern bool examine_opclause_expression(OpExpr *expr, Var **varp,
- Const **cstp, bool *isgtp);
+ Const **cstp, bool *varonleftp);
extern Selectivity mcv_clauselist_selectivity(PlannerInfo *root,
StatisticExtInfo *stat,