Changeset: c4ed4853fb79 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c4ed4853fb79
Modified Files:
sql/server/rel_select.c
Branch: literal_features
Log Message:
do less work
diffs (34 lines):
diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -1260,19 +1260,23 @@ bool group_by_pk_project_uk_cond(mvc* sq
if (uki->columns->cnt == 1) {
/* for now only check simple
case where unique key is a single column*/
sql_column* ukc = ((sql_kc
*)uki->columns->h->data)->c;
- if (strcmp(exp->alias.name,
ukc->base.name) == 0)
+ if (strcmp(exp->alias.name,
ukc->base.name) == 0) {
allow = true;
+ break;
+ }
}
}
}
}
- /* sufficiency condition: abort if relation contains union
subrelation
- * because it may break functional dependency between pk and uk
*/
- visitor v = {.sql=sql};
- rel_visitor_topdown(&v, inner, &find_union);
- if (v.data)
- allow = false;
+ if (allow) {
+ /* sufficiency condition: abort if relation contains
union subrelation
+ * because it may break functional dependency between pk
and uk */
+ visitor v = {.sql=sql};
+ rel_visitor_topdown(&v, inner, &find_union);
+ if (v.data)
+ allow = false;
+ }
}
return allow;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]