Changeset: df47e4450a77 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/df47e4450a77
Modified Files:
gdk/gdk_bbp.c
gdk/gdk_utils.c
Branch: default
Log Message:
Merge with Mar2025 branch.
diffs (248 lines):
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -4722,14 +4722,14 @@ BBPprintinfo(void)
bats[1][1][1][1][1].sz,
humansize(bats[1][1][1][1][1].sz, mbuf, sizeof(mbuf)));
if (bats[1][1][1][1][0].nr > 0)
- printf("fix, dirty, persistent, not loaded, hot: %d bats, %zu%s
virtual, %zu%s malloc\n",
+ printf("fix, dirty, persistent, loaded, cold: %d bats, %zu%s
virtual, %zu%s malloc\n",
bats[1][1][1][1][0].nr,
bats[1][1][1][1][0].vmsz,
humansize(bats[1][1][1][1][0].vmsz, vbuf, sizeof(vbuf)),
bats[1][1][1][1][0].sz,
humansize(bats[1][1][1][1][0].sz, mbuf, sizeof(mbuf)));
if (bats[1][1][1][0][1].nr > 0)
- printf("fix, dirty, persistent, loaded, cold: %d bats, %zu%s
virtual, %zu%s malloc\n",
+ printf("fix, dirty, persistent, not loaded, hot: %d bats, %zu%s
virtual, %zu%s malloc\n",
bats[1][1][1][0][1].nr,
bats[1][1][1][0][1].vmsz,
humansize(bats[1][1][1][0][1].vmsz, vbuf, sizeof(vbuf)),
@@ -4750,14 +4750,14 @@ BBPprintinfo(void)
bats[1][1][0][1][1].sz,
humansize(bats[1][1][0][1][1].sz, mbuf, sizeof(mbuf)));
if (bats[1][1][0][1][0].nr > 0)
- printf("fix, dirty, transient, not loaded, hot: %d bats, %zu%s
virtual, %zu%s malloc\n",
+ printf("fix, dirty, transient, loaded, cold: %d bats, %zu%s
virtual, %zu%s malloc\n",
bats[1][1][0][1][0].nr,
bats[1][1][0][1][0].vmsz,
humansize(bats[1][1][0][1][0].vmsz, vbuf, sizeof(vbuf)),
bats[1][1][0][1][0].sz,
humansize(bats[1][1][0][1][0].sz, mbuf, sizeof(mbuf)));
if (bats[1][1][0][0][1].nr > 0)
- printf("fix, dirty, transient, loaded, cold: %d bats, %zu%s
virtual, %zu%s malloc\n",
+ printf("fix, dirty, transient, not loaded, hot: %d bats, %zu%s
virtual, %zu%s malloc\n",
bats[1][1][0][0][1].nr,
bats[1][1][0][0][1].vmsz,
humansize(bats[1][1][0][0][1].vmsz, vbuf, sizeof(vbuf)),
@@ -4778,14 +4778,14 @@ BBPprintinfo(void)
bats[1][0][1][1][1].sz,
humansize(bats[1][0][1][1][1].sz, mbuf, sizeof(mbuf)));
if (bats[1][0][1][1][0].nr > 0)
- printf("fix, clean, persistent, not loaded, hot: %d bats, %zu%s
virtual, %zu%s malloc\n",
+ printf("fix, clean, persistent, loaded, cold: %d bats, %zu%s
virtual, %zu%s malloc\n",
bats[1][0][1][1][0].nr,
bats[1][0][1][1][0].vmsz,
humansize(bats[1][0][1][1][0].vmsz, vbuf, sizeof(vbuf)),
bats[1][0][1][1][0].sz,
humansize(bats[1][0][1][1][0].sz, mbuf, sizeof(mbuf)));
if (bats[1][0][1][0][1].nr > 0)
- printf("fix, clean, persistent, loaded, cold: %d bats, %zu%s
virtual, %zu%s malloc\n",
+ printf("fix, clean, persistent, not loaded, hot: %d bats, %zu%s
virtual, %zu%s malloc\n",
bats[1][0][1][0][1].nr,
bats[1][0][1][0][1].vmsz,
humansize(bats[1][0][1][0][1].vmsz, vbuf, sizeof(vbuf)),
@@ -4806,14 +4806,14 @@ BBPprintinfo(void)
bats[1][0][0][1][1].sz,
humansize(bats[1][0][0][1][1].sz, mbuf, sizeof(mbuf)));
if (bats[1][0][0][1][0].nr > 0)
- printf("fix, clean, transient, not loaded, hot: %d bats, %zu%s
virtual, %zu%s malloc\n",
+ printf("fix, clean, transient, loaded, cold: %d bats, %zu%s
virtual, %zu%s malloc\n",
bats[1][0][0][1][0].nr,
bats[1][0][0][1][0].vmsz,
humansize(bats[1][0][0][1][0].vmsz, vbuf, sizeof(vbuf)),
bats[1][0][0][1][0].sz,
humansize(bats[1][0][0][1][0].sz, mbuf, sizeof(mbuf)));
if (bats[1][0][0][0][1].nr > 0)
- printf("fix, clean, transient, loaded, cold: %d bats, %zu%s
virtual, %zu%s malloc\n",
+ printf("fix, clean, transient, not loaded, hot: %d bats, %zu%s
virtual, %zu%s malloc\n",
bats[1][0][0][0][1].nr,
bats[1][0][0][0][1].vmsz,
humansize(bats[1][0][0][0][1].vmsz, vbuf, sizeof(vbuf)),
@@ -4834,14 +4834,14 @@ BBPprintinfo(void)
bats[0][1][1][1][1].sz,
humansize(bats[0][1][1][1][1].sz, mbuf, sizeof(mbuf)));
if (bats[0][1][1][1][0].nr > 0)
- printf("no fix, dirty, persistent, not loaded, hot: %d bats,
%zu%s virtual, %zu%s malloc\n",
+ printf("no fix, dirty, persistent, loaded, cold: %d bats, %zu%s
virtual, %zu%s malloc\n",
bats[0][1][1][1][0].nr,
bats[0][1][1][1][0].vmsz,
humansize(bats[0][1][1][1][0].vmsz, vbuf, sizeof(vbuf)),
bats[0][1][1][1][0].sz,
humansize(bats[0][1][1][1][0].sz, mbuf, sizeof(mbuf)));
if (bats[0][1][1][0][1].nr > 0)
- printf("no fix, dirty, persistent, loaded, cold: %d bats, %zu%s
virtual, %zu%s malloc\n",
+ printf("no fix, dirty, persistent, not loaded, hot: %d bats,
%zu%s virtual, %zu%s malloc\n",
bats[0][1][1][0][1].nr,
bats[0][1][1][0][1].vmsz,
humansize(bats[0][1][1][0][1].vmsz, vbuf, sizeof(vbuf)),
@@ -4862,14 +4862,14 @@ BBPprintinfo(void)
bats[0][1][0][1][1].sz,
humansize(bats[0][1][0][1][1].sz, mbuf, sizeof(mbuf)));
if (bats[0][1][0][1][0].nr > 0)
- printf("no fix, dirty, transient, not loaded, hot: %d bats,
%zu%s virtual, %zu%s malloc\n",
+ printf("no fix, dirty, transient, loaded, cold: %d bats, %zu%s
virtual, %zu%s malloc\n",
bats[0][1][0][1][0].nr,
bats[0][1][0][1][0].vmsz,
humansize(bats[0][1][0][1][0].vmsz, vbuf, sizeof(vbuf)),
bats[0][1][0][1][0].sz,
humansize(bats[0][1][0][1][0].sz, mbuf, sizeof(mbuf)));
if (bats[0][1][0][0][1].nr > 0)
- printf("no fix, dirty, transient, loaded, cold: %d bats, %zu%s
virtual, %zu%s malloc\n",
+ printf("no fix, dirty, transient, not loaded, hot: %d bats,
%zu%s virtual, %zu%s malloc\n",
bats[0][1][0][0][1].nr,
bats[0][1][0][0][1].vmsz,
humansize(bats[0][1][0][0][1].vmsz, vbuf, sizeof(vbuf)),
@@ -4890,14 +4890,14 @@ BBPprintinfo(void)
bats[0][0][1][1][1].sz,
humansize(bats[0][0][1][1][1].sz, mbuf, sizeof(mbuf)));
if (bats[0][0][1][1][0].nr > 0)
- printf("no fix, clean, persistent, not loaded, hot: %d bats,
%zu%s virtual, %zu%s malloc\n",
+ printf("no fix, clean, persistent, loaded, cold: %d bats, %zu%s
virtual, %zu%s malloc\n",
bats[0][0][1][1][0].nr,
bats[0][0][1][1][0].vmsz,
humansize(bats[0][0][1][1][0].vmsz, vbuf, sizeof(vbuf)),
bats[0][0][1][1][0].sz,
humansize(bats[0][0][1][1][0].sz, mbuf, sizeof(mbuf)));
if (bats[0][0][1][0][1].nr > 0)
- printf("no fix, clean, persistent, loaded, cold: %d bats, %zu%s
virtual, %zu%s malloc\n",
+ printf("no fix, clean, persistent, not loaded, hot: %d bats,
%zu%s virtual, %zu%s malloc\n",
bats[0][0][1][0][1].nr,
bats[0][0][1][0][1].vmsz,
humansize(bats[0][0][1][0][1].vmsz, vbuf, sizeof(vbuf)),
@@ -4918,14 +4918,14 @@ BBPprintinfo(void)
bats[0][0][0][1][1].sz,
humansize(bats[0][0][0][1][1].sz, mbuf, sizeof(mbuf)));
if (bats[0][0][0][1][0].nr > 0)
- printf("no fix, clean, transient, not loaded, hot: %d bats,
%zu%s virtual, %zu%s malloc\n",
+ printf("no fix, clean, transient, loaded, cold: %d bats, %zu%s
virtual, %zu%s malloc\n",
bats[0][0][0][1][0].nr,
bats[0][0][0][1][0].vmsz,
humansize(bats[0][0][0][1][0].vmsz, vbuf, sizeof(vbuf)),
bats[0][0][0][1][0].sz,
humansize(bats[0][0][0][1][0].sz, mbuf, sizeof(mbuf)));
if (bats[0][0][0][0][1].nr > 0)
- printf("no fix, clean, transient, loaded, cold: %d bats, %zu%s
virtual, %zu%s malloc\n",
+ printf("no fix, clean, transient, not loaded, hot: %d bats,
%zu%s virtual, %zu%s malloc\n",
bats[0][0][0][0][1].nr,
bats[0][0][0][0][1].vmsz,
humansize(bats[0][0][0][0][1].vmsz, vbuf, sizeof(vbuf)),
diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -2055,7 +2055,13 @@ GDKprintinfo(void)
mallctl("stats.mapped", &jemapped, &(size_t){sizeof(jemapped)},
NULL, 0) == 0 &&
mallctl("stats.resident", &jeresident,
&(size_t){sizeof(jeresident)}, NULL, 0) == 0 &&
mallctl("stats.retained", &jeretained,
&(size_t){sizeof(jeretained)}, NULL, 0) == 0)
- printf("JEmalloc: allocated %zu, active %zu, mapped %zu,
resident %zu, retained %zu\n", jeallocated, jeactive, jemapped, jeresident,
jeretained);
+ printf("JEmalloc: allocated %zu%s, active %zu%s, "
+ "mapped %zu%s, resident %zu%s, retained %zu%s\n",
+ jeallocated, humansize(jeallocated, (char[24]){0}, 24),
+ jeactive, humansize(jeactive, (char[24]){0}, 24),
+ jemapped, humansize(jemapped, (char[24]){0}, 24),
+ jeresident, humansize(jeresident, (char[24]){0}, 24),
+ jeretained, humansize(jeretained, (char[24]){0}, 24));
#endif
#elif defined(HAVE_MALLINFO2)
struct mallinfo2 mi = mallinfo2();
diff --git a/monetdb5/optimizer/opt_mitosis.c b/monetdb5/optimizer/opt_mitosis.c
--- a/monetdb5/optimizer/opt_mitosis.c
+++ b/monetdb5/optimizer/opt_mitosis.c
@@ -16,14 +16,14 @@
#include "gdk_utils.h"
#define MIN_PART_SIZE 100000 /* minimal record count per partition */
-#define MAX_PARTS2THREADS_RATIO 4 /* There should be at most this
multiple more of partitions then threads */
+#define MAX_PARTS2THREADS_RATIO 4 /* There should be at most this
multiple more of partitions than threads */
str
OPTmitosisImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
InstrPtr pci)
{
- int i, j, limit, slimit, estimate = 0, pieces = 1, mito_parts = 0,
+ int i, j, limit, slimit, pieces = 1, mito_parts = 0,
mito_size = 0, row_size = 0, mt = -1, nr_cols = 0, nr_aggrs = 0,
nr_maps = 0;
str schema = 0, table = 0;
@@ -50,11 +50,10 @@ OPTmitosisImplementation(Client cntxt, M
&& p->argc > 2 && getArgType(mb, p, 2) == TYPE_str
&& isVarConstant(mb, getArg(p, 2))
&& getVarConstant(mb, getArg(p, 2)).val.sval != NULL
- &&
- (strstr(getVarConstant(mb, getArg(p, 2)).val.sval,
- "PRIMARY KEY constraint")
- || strstr(getVarConstant(mb, getArg(p, 2)).val.sval,
- "UNIQUE constraint"))) {
+ && (strstr(getVarConstant(mb, getArg(p, 2)).val.sval,
+ "PRIMARY KEY constraint")
+ || strstr(getVarConstant(mb, getArg(p,
2)).val.sval,
+ "UNIQUE constraint"))) {
pieces = 0;
goto bailout;
}
@@ -118,7 +117,8 @@ OPTmitosisImplementation(Client cntxt, M
/* locate the largest non-partitioned table */
if (getModuleId(p) != sqlRef
- || (getFunctionId(p) != bindRef && getFunctionId(p) !=
bindidxRef
+ || (getFunctionId(p) != bindRef
+ && getFunctionId(p) != bindidxRef
&& getFunctionId(p) != tidRef))
continue;
/* don't split insert BATs */
@@ -135,12 +135,11 @@ OPTmitosisImplementation(Client cntxt, M
if (r == rowcnt)
nr_cols++;
if (r > rowcnt) {
- /* the rowsize depends on the column types, assume
void-headed */
+ /* the rowsize depends on the column types */
row_size = ATOMsize(getBatType(getArgType(mb, p, 0)));
rowcnt = r;
nr_cols = 1;
target = p;
- estimate++;
r = 0;
}
}
@@ -229,9 +228,8 @@ OPTmitosisImplementation(Client cntxt, M
/* at this stage we have identified the #chunks to be used for the
largest table */
limit = mb->stop;
slimit = mb->ssize;
- if (newMalBlkStmt(mb, mb->stop + 2 * estimate) < 0)
+ if (newMalBlkStmt(mb, mb->stop + nr_cols * pieces + 2) < 0)
throw(MAL, "optimizer.mitosis", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
- estimate = 0;
schema = getVarConstant(mb, getArg(target, 2)).val.sval;
table = getVarConstant(mb, getArg(target, 3)).val.sval;
@@ -241,7 +239,8 @@ OPTmitosisImplementation(Client cntxt, M
p = old[i];
if (getModuleId(p) != sqlRef
- || !(getFunctionId(p) == bindRef || getFunctionId(p) ==
bindidxRef
+ || !(getFunctionId(p) == bindRef
+ || getFunctionId(p) == bindidxRef
|| getFunctionId(p) == tidRef)) {
pushInstruction(mb, p);
continue;
@@ -271,9 +270,6 @@ OPTmitosisImplementation(Client cntxt, M
pushInstruction(mb, p);
continue;
}
- /* we keep the original bind operation, because it allows for
- * easy undo when the mergtable can not do something */
- // pushInstruction(mb, p);
qtpe = getVarType(mb, getArg(p, 0));
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]