Changeset: e02d612ed10b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e02d612ed10b
Modified Files:
        sql/server/rel_statistics.c
Branch: properties
Log Message:

The unique flag propagation wasn't right


diffs (18 lines):

diff --git a/sql/server/rel_statistics.c b/sql/server/rel_statistics.c
--- a/sql/server/rel_statistics.c
+++ b/sql/server/rel_statistics.c
@@ -59,13 +59,13 @@ rel_propagate_column_ref_statistics(mvc 
                                        sql_exp *comp = n->data, *le = comp->l, 
*lne = NULL, *re = comp->r, *rne = NULL, *fe = comp->f, *fne = NULL;
 
                                        if (comp->type == e_cmp) {
-                                               still_unique |= comp->flag == 
cmp_equal && is_unique(le) && is_unique(re); /* unique if only equi-joins on 
unique columns are there */
                                                if (is_theta_exp(comp->flag) && 
((lne = comparison_find_column(le, e)) || (rne = comparison_find_column(re, e)) 
|| (fe && (fne = comparison_find_column(fe, e))))) {
                                                        atom *lval_min = 
find_prop_and_get(le->p, PROP_MIN), *lval_max = find_prop_and_get(le->p, 
PROP_MAX),
                                                                 *rval_min = 
find_prop_and_get(re->p, PROP_MIN), *rval_max = find_prop_and_get(re->p, 
PROP_MAX);
 
                                                        /* not semantics found 
or if explicitly filtering not null values from the column */
                                                        found_without_semantics 
|= !is_semantics(comp) || (comp->flag == cmp_equal && lne && is_anti(comp) && 
exp_is_null(re));
+                                                       still_unique |= 
comp->flag == cmp_equal && is_unique(le) && is_unique(re); /* unique if only 
equi-joins on unique columns are there */
                                                        if (is_full(rel->op) || 
(is_left(rel->op) && found_left) || (is_right(rel->op) && found_right)) /* on 
outer joins, min and max cannot be propagated on some cases */
                                                                continue;
                                                        /* if (end2 >= start1 
&& start2 <= end1) then the 2 intervals are intersected */
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to