Changeset: 4f85e95ff098 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4f85e95ff098
Modified Files:
gdk/gdk_utils.c
sql/server/rel_optimizer.c
Branch: default
Log Message:
Merged with Oct2020
diffs (63 lines):
diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -599,7 +599,7 @@ MT_init(void)
/* assume "max" if not a number */
fclose(f);
}
- /* soft limit */
+ /* soft high limit */
strcpy(pth + l, "memory.high");
f = fopen(pth, "r");
if (f != NULL) {
@@ -610,6 +610,17 @@ MT_init(void)
/* assume "max" if not a number */
fclose(f);
}
+ /* soft low limit */
+ strcpy(pth + l, "memory.low");
+ f = fopen(pth, "r");
+ if (f != NULL) {
+ if (fscanf(f, "%" SCNu64, &mem) == 1 &&
mem > 0 && mem < (uint64_t) _MT_pagesize * _MT_npages) {
+ _MT_npages = (size_t) (mem /
_MT_pagesize);
+ }
+ success = true;
+ /* assume "max" if not a number */
+ fclose(f);
+ }
/* limit of memory+swap usage
* we use this as maximum virtual memory size */
strcpy(pth + l, "memory.swap.max");
diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c
--- a/sql/server/rel_optimizer.c
+++ b/sql/server/rel_optimizer.c
@@ -5364,19 +5364,6 @@ find_projection_for_join2semi(sql_rel *r
if (is_project(rel->op) && !is_union(rel->op)) {
if (rel->card < CARD_AGGR) /* const or groupby without group by
exps */
return true;
-
- if (is_groupby(rel->op)) { /* if just groupby columns are
projected, it will be distinct */
- bool all_groupby_columns = true;
-
- if (list_empty(rel->r)) /* global aggregate */
- return true;
- for (node *n = rel->exps->h; n && all_groupby_columns;
n = n->next) {
- sql_exp *e = n->data;
- all_groupby_columns &= (e->type == e_column &&
(find_prop(e->p, PROP_HASHCOL) || exps_find_exp(rel->r, e)));
- }
- if (all_groupby_columns)
- return true;
- }
if (list_length(rel->exps) == 1) {
sql_exp *e = rel->exps->h->data;
/* a single group by column in the projection list from
a group by relation is guaranteed to be unique, but not an aggregate */
@@ -5385,7 +5372,8 @@ find_projection_for_join2semi(sql_rel *r
sql_exp *found = NULL;
bool underjoin = false;
- if (is_groupby(rel->op) || need_distinct(rel)
|| find_prop(e->p, PROP_HASHCOL))
+ /* if just one groupby column is projected, it
will be distinct */
+ if ((is_groupby(rel->op) && list_length(rel->r)
== 1 && exps_find_exp(rel->r, e)) || need_distinct(rel) || find_prop(e->p,
PROP_HASHCOL))
return true;
if ((found =
rel_find_exp_and_corresponding_rel(rel->l, e, &res, &underjoin)) && !underjoin)
{ /* grouping column on inner relation */
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list